Class: GroupDocsComparisonCloud::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/groupdocs_comparison_cloud/models/settings.rb

Overview

Defines comparison process additional settings

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Settings

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 179

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.key?(:'GenerateSummaryPage')
    self.generate_summary_page = attributes[:'GenerateSummaryPage']
  end

  if attributes.key?(:'ShowDeletedContent')
    self.show_deleted_content = attributes[:'ShowDeletedContent']
  end

  if attributes.key?(:'ShowInsertedContent')
    self.show_inserted_content = attributes[:'ShowInsertedContent']
  end

  if attributes.key?(:'StyleChangeDetection')
    self.style_change_detection = attributes[:'StyleChangeDetection']
  end

  if attributes.key?(:'InsertedItemsStyle')
    self.inserted_items_style = attributes[:'InsertedItemsStyle']
  end

  if attributes.key?(:'DeletedItemsStyle')
    self.deleted_items_style = attributes[:'DeletedItemsStyle']
  end

  if attributes.key?(:'ChangedItemsStyle')
    self.changed_items_style = attributes[:'ChangedItemsStyle']
  end

  if attributes.key?(:'WordsSeparatorChars')
    if (value = attributes[:'WordsSeparatorChars']).is_a?(Array)
      self.words_separator_chars = value
    end
  end

  if attributes.key?(:'DetailsLevel')
    self.details_level = attributes[:'DetailsLevel']
  end

  if attributes.key?(:'UseFramesForDelInsElements')
    self.use_frames_for_del_ins_elements = attributes[:'UseFramesForDelInsElements']
  end

  if attributes.key?(:'CalculateComponentCoordinates')
    self.calculate_component_coordinates = attributes[:'CalculateComponentCoordinates']
  end

  if attributes.key?(:'MarkChangedContent')
    self.mark_changed_content = attributes[:'MarkChangedContent']
  end

  if attributes.key?(:'MarkNestedContent')
    self.mark_nested_content = attributes[:'MarkNestedContent']
  end

  if attributes.key?(:'CloneMetadata')
    self. = attributes[:'CloneMetadata']
  end

  if attributes.key?(:'MetaData')
    self. = attributes[:'MetaData']
  end

  if attributes.key?(:'PasswordSaveOption')
    self.password_save_option = attributes[:'PasswordSaveOption']
  end

  if attributes.key?(:'Password')
    self.password = attributes[:'Password']
  end

  if attributes.key?(:'DiagramMasterSetting')
    self.diagram_master_setting = attributes[:'DiagramMasterSetting']
  end

  if attributes.key?(:'OriginalSize')
    self.original_size = attributes[:'OriginalSize']
  end

  if attributes.key?(:'HeaderFootersComparison')
    self.header_footers_comparison = attributes[:'HeaderFootersComparison']
  end

  if attributes.key?(:'PaperSize')
    self.paper_size = attributes[:'PaperSize']
  end

  if attributes.key?(:'SensitivityOfComparison')
    self.sensitivity_of_comparison = attributes[:'SensitivityOfComparison']
  end

end

Instance Attribute Details

#calculate_component_coordinatesObject

Indicates whether to calculate coordinates for changed components



65
66
67
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 65

def calculate_component_coordinates
  @calculate_component_coordinates
end

#changed_items_styleObject

Style for components with changed style



53
54
55
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 53

def changed_items_style
  @changed_items_style
end

#clone_metadataObject

Gets or sets type of metadata to clone



74
75
76
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 74

def 
  @clone_metadata
end

#deleted_items_styleObject

Style for deleted components



50
51
52
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 50

def deleted_items_style
  @deleted_items_style
end

#details_levelObject

Gets of sets the comparison details level



59
60
61
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 59

def details_level
  @details_level
end

#diagram_master_settingObject

Gets or sets master for Diagram document



86
87
88
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 86

def diagram_master_setting
  @diagram_master_setting
end

#generate_summary_pageObject

Indicates whether to add summary page to resultant document or not



35
36
37
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 35

def generate_summary_page
  @generate_summary_page
end

#header_footers_comparisonObject

Control to turn on comparison of header/footer contents



92
93
94
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 92

def header_footers_comparison
  @header_footers_comparison
end

#inserted_items_styleObject

Style for inserted components



47
48
49
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 47

def inserted_items_style
  @inserted_items_style
end

#mark_changed_contentObject

Indicates whether to use frames for shapes in Word Processing and for rectangles in Image documents



68
69
70
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 68

def mark_changed_content
  @mark_changed_content
end

#mark_nested_contentObject

Gets or sets a value indicating whether to mark the children of the deleted or inserted element as deleted or inserted



71
72
73
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 71

def mark_nested_content
  @mark_nested_content
end

#meta_dataObject

Gets or sets user metadata



77
78
79
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 77

def 
  @meta_data
end

#original_sizeObject

Gets or sets original document size when picture is compared with other different formats



89
90
91
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 89

def original_size
  @original_size
end

#paper_sizeObject

Gets or sets the result document paper size



95
96
97
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 95

def paper_size
  @paper_size
end

#passwordObject

Gets or sets user password to resultant document



83
84
85
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 83

def password
  @password
end

#password_save_optionObject

Gets or sets type of password saving



80
81
82
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 80

def password_save_option
  @password_save_option
end

#sensitivity_of_comparisonObject

Gets or sets a sensitivity of comparison. Default is 75



98
99
100
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 98

def sensitivity_of_comparison
  @sensitivity_of_comparison
end

#show_deleted_contentObject

Indicates whether to show deleted components in resultant document or not



38
39
40
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 38

def show_deleted_content
  @show_deleted_content
end

#show_inserted_contentObject

Indicates whether to show inserted components in resultant document or not



41
42
43
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 41

def show_inserted_content
  @show_inserted_content
end

#style_change_detectionObject

Indicates whether to detect style changes or not



44
45
46
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 44

def style_change_detection
  @style_change_detection
end

#use_frames_for_del_ins_elementsObject

Indicates whether to use frames for shapes in Word Processing and for rectangles in Image documents



62
63
64
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 62

def use_frames_for_del_ins_elements
  @use_frames_for_del_ins_elements
end

#words_separator_charsObject

An array of delimiters to split text into words



56
57
58
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 56

def words_separator_chars
  @words_separator_chars
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 122

def self.attribute_map
  {
    :'generate_summary_page' => :'GenerateSummaryPage',
    :'show_deleted_content' => :'ShowDeletedContent',
    :'show_inserted_content' => :'ShowInsertedContent',
    :'style_change_detection' => :'StyleChangeDetection',
    :'inserted_items_style' => :'InsertedItemsStyle',
    :'deleted_items_style' => :'DeletedItemsStyle',
    :'changed_items_style' => :'ChangedItemsStyle',
    :'words_separator_chars' => :'WordsSeparatorChars',
    :'details_level' => :'DetailsLevel',
    :'use_frames_for_del_ins_elements' => :'UseFramesForDelInsElements',
    :'calculate_component_coordinates' => :'CalculateComponentCoordinates',
    :'mark_changed_content' => :'MarkChangedContent',
    :'mark_nested_content' => :'MarkNestedContent',
    :'clone_metadata' => :'CloneMetadata',
    :'meta_data' => :'MetaData',
    :'password_save_option' => :'PasswordSaveOption',
    :'password' => :'Password',
    :'diagram_master_setting' => :'DiagramMasterSetting',
    :'original_size' => :'OriginalSize',
    :'header_footers_comparison' => :'HeaderFootersComparison',
    :'paper_size' => :'PaperSize',
    :'sensitivity_of_comparison' => :'SensitivityOfComparison'
  }
end

.swagger_typesObject

Attribute type mapping.



150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 150

def self.swagger_types
  {
    :'generate_summary_page' => :'BOOLEAN',
    :'show_deleted_content' => :'BOOLEAN',
    :'show_inserted_content' => :'BOOLEAN',
    :'style_change_detection' => :'BOOLEAN',
    :'inserted_items_style' => :'ItemsStyle',
    :'deleted_items_style' => :'ItemsStyle',
    :'changed_items_style' => :'ItemsStyle',
    :'words_separator_chars' => :'Array<String>',
    :'details_level' => :'String',
    :'use_frames_for_del_ins_elements' => :'BOOLEAN',
    :'calculate_component_coordinates' => :'BOOLEAN',
    :'mark_changed_content' => :'BOOLEAN',
    :'mark_nested_content' => :'BOOLEAN',
    :'clone_metadata' => :'String',
    :'meta_data' => :'Metadata',
    :'password_save_option' => :'String',
    :'password' => :'String',
    :'diagram_master_setting' => :'DiagramMasterSetting',
    :'original_size' => :'Size',
    :'header_footers_comparison' => :'BOOLEAN',
    :'paper_size' => :'String',
    :'sensitivity_of_comparison' => :'Integer'
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 430

def ==(other)
  return true if self.equal?(other)
  self.class == other.class &&
      generate_summary_page == other.generate_summary_page &&
      show_deleted_content == other.show_deleted_content &&
      show_inserted_content == other.show_inserted_content &&
      style_change_detection == other.style_change_detection &&
      inserted_items_style == other.inserted_items_style &&
      deleted_items_style == other.deleted_items_style &&
      changed_items_style == other.changed_items_style &&
      words_separator_chars == other.words_separator_chars &&
      details_level == other.details_level &&
      use_frames_for_del_ins_elements == other.use_frames_for_del_ins_elements &&
      calculate_component_coordinates == other.calculate_component_coordinates &&
      mark_changed_content == other.mark_changed_content &&
      mark_nested_content == other.mark_nested_content &&
       == other. &&
       == other. &&
      password_save_option == other.password_save_option &&
      password == other.password &&
      diagram_master_setting == other.diagram_master_setting &&
      original_size == other.original_size &&
      header_footers_comparison == other.header_footers_comparison &&
      paper_size == other.paper_size &&
      sensitivity_of_comparison == other.sensitivity_of_comparison
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 502

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    Date.parse value
  when :Date
    Date.parse value
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else
  # model
    temp_model = GroupDocsComparisonCloud.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



569
570
571
572
573
574
575
576
577
578
579
580
581
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 569

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 478

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    pname = uncap(self.class.attribute_map[key]).intern
    value = attributes[pname]
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not                    
      if value.is_a?(Array)
        self.send("#{key}=", value.map { |v| _deserialize($1, v) })
      end
    elsif !value.nil?
      self.send("#{key}=", _deserialize(type, value))
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


459
460
461
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 459

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



465
466
467
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 465

def hash
  [generate_summary_page, show_deleted_content, show_inserted_content, style_change_detection, inserted_items_style, deleted_items_style, changed_items_style, words_separator_chars, details_level, use_frames_for_del_ins_elements, calculate_component_coordinates, mark_changed_content, mark_nested_content, , , password_save_option, password, diagram_master_setting, original_size, header_footers_comparison, paper_size, sensitivity_of_comparison].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properies with the reasons



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 279

def list_invalid_properties
  invalid_properties = []
  if @generate_summary_page.nil?
    invalid_properties.push("invalid value for 'generate_summary_page', generate_summary_page cannot be nil.")
  end

  if @show_deleted_content.nil?
    invalid_properties.push("invalid value for 'show_deleted_content', show_deleted_content cannot be nil.")
  end

  if @show_inserted_content.nil?
    invalid_properties.push("invalid value for 'show_inserted_content', show_inserted_content cannot be nil.")
  end

  if @style_change_detection.nil?
    invalid_properties.push("invalid value for 'style_change_detection', style_change_detection cannot be nil.")
  end

  if @details_level.nil?
    invalid_properties.push("invalid value for 'details_level', details_level cannot be nil.")
  end

  if @use_frames_for_del_ins_elements.nil?
    invalid_properties.push("invalid value for 'use_frames_for_del_ins_elements', use_frames_for_del_ins_elements cannot be nil.")
  end

  if @calculate_component_coordinates.nil?
    invalid_properties.push("invalid value for 'calculate_component_coordinates', calculate_component_coordinates cannot be nil.")
  end

  if @mark_changed_content.nil?
    invalid_properties.push("invalid value for 'mark_changed_content', mark_changed_content cannot be nil.")
  end

  if @mark_nested_content.nil?
    invalid_properties.push("invalid value for 'mark_nested_content', mark_nested_content cannot be nil.")
  end

  if @clone_metadata.nil?
    invalid_properties.push("invalid value for 'clone_metadata', clone_metadata cannot be nil.")
  end

  if @password_save_option.nil?
    invalid_properties.push("invalid value for 'password_save_option', password_save_option cannot be nil.")
  end

  if @header_footers_comparison.nil?
    invalid_properties.push("invalid value for 'header_footers_comparison', header_footers_comparison cannot be nil.")
  end

  if @paper_size.nil?
    invalid_properties.push("invalid value for 'paper_size', paper_size cannot be nil.")
  end

  if @sensitivity_of_comparison.nil?
    invalid_properties.push("invalid value for 'sensitivity_of_comparison', sensitivity_of_comparison cannot be nil.")
  end

  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



549
550
551
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 549

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



555
556
557
558
559
560
561
562
563
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 555

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



543
544
545
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 543

def to_s
  to_hash.to_s
end

#uncap(str) ⇒ Object

Downcases first letter.

Returns:

  • downcased string



471
472
473
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 471

def uncap(str)
  str[0, 1].downcase + str[1..-1]
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/groupdocs_comparison_cloud/models/settings.rb', line 342

def valid?
  return false if @generate_summary_page.nil?
  return false if @show_deleted_content.nil?
  return false if @show_inserted_content.nil?
  return false if @style_change_detection.nil?
  return false if @details_level.nil?
  details_level_validator = EnumAttributeValidator.new('String', ["Low", "Middle", "High"])
  return false unless details_level_validator.valid?(@details_level)
  return false if @use_frames_for_del_ins_elements.nil?
  return false if @calculate_component_coordinates.nil?
  return false if @mark_changed_content.nil?
  return false if @mark_nested_content.nil?
  return false if @clone_metadata.nil?
   = EnumAttributeValidator.new('String', ["Default", "Source", "Target", "FileAuthor"])
  return false unless .valid?(@clone_metadata)
  return false if @password_save_option.nil?
  password_save_option_validator = EnumAttributeValidator.new('String', ["None", "Source", "Target", "User"])
  return false unless password_save_option_validator.valid?(@password_save_option)
  return false if @header_footers_comparison.nil?
  return false if @paper_size.nil?
  paper_size_validator = EnumAttributeValidator.new('String', ["Default", "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8"])
  return false unless paper_size_validator.valid?(@paper_size)
  return false if @sensitivity_of_comparison.nil?
  return true
end