Class: AsposeWordsCloud::StructuredDocumentTagUpdate

Inherits:
Object
  • Object
show all
Defined in:
lib/aspose_words_cloud/models/structured_document_tag_update.rb

Overview

DTO container with a StructuredDocumentTag.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ StructuredDocumentTagUpdate

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
276
277
278
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
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 201

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?(:'Link')
    self.link = attributes[:'Link']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#appearanceObject

Gets or sets the appearance of a structured document tag.



39
40
41
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 39

def appearance
  @appearance
end

#building_block_categoryObject

Gets or sets category of building block for this SDT node. Can not be null.



42
43
44
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 42

def building_block_category
  @building_block_category
end

Gets or sets type of building block for this SDT. Can not be null.



45
46
47
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 45

def building_block_gallery
  @building_block_gallery
end

#calendar_typeObject

Gets or sets the type of calendar for this SDT. Default is Aspose.Words.Markup.SdtCalendarType.Default.



48
49
50
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 48

def calendar_type
  @calendar_type
end

#checkedObject

Gets or sets a value indicating whether current state of the Checkbox SDT. Default value for this property.



51
52
53
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 51

def checked
  @checked
end

#colorObject

Gets or sets the color of the structured document tag.



54
55
56
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 54

def color
  @color
end

#date_display_formatObject

Gets or sets String that represents the format in which dates are displayed. Can not be null. The dates for English (U.S.) is “mm/dd/yyyy”.



57
58
59
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 57

def date_display_format
  @date_display_format
end

#date_display_localeObject

Gets or sets the language format for the date displayed in this SDT.



60
61
62
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 60

def date_display_locale
  @date_display_locale
end

#date_storage_formatObject

Gets or sets format in which the date for a date SDT is stored when the SDT is bound to an XML node in the document’s data store. Default value is Aspose.Words.Markup.SdtDateStorageFormat.DateTime.



64
65
66
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 64

def date_storage_format
  @date_storage_format
end

#full_dateObject

Gets or sets the full date and time last entered into this SDT.



67
68
69
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 67

def full_date
  @full_date
end

#idObject

Gets or sets a unique read-only persistent numerical Id for this SDT.



70
71
72
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 70

def id
  @id
end

#is_showing_placeholder_textObject

Gets or sets a value indicating whether the content of this SDT shall be interpreted to contain placeholder text (as opposed to regular text contents within the SDT). If set to true, this state shall be resumed (showing placeholder text) upon opening his document.



74
75
76
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 74

def is_showing_placeholder_text
  @is_showing_placeholder_text
end

#is_temporaryObject

Gets or sets a value indicating whether this SDT shall be removed from the WordProcessingML document when its contents are modified.



77
78
79
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 77

def is_temporary
  @is_temporary
end

#levelObject

Gets or sets the level at which this SDT occurs in the document tree.



80
81
82
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 80

def level
  @level
end

Gets or sets the link to the document.



33
34
35
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 33

def link
  @link
end

#list_itemsObject

Gets or sets Aspose.Words.Markup.SdtListItemCollection associated with this SDT.



83
84
85
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 83

def list_items
  @list_items
end

#lock_content_controlObject

Gets or sets a value indicating whether, this property will prohibit a user from deleting this SDT.



86
87
88
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 86

def lock_content_control
  @lock_content_control
end

#lock_contentsObject

Gets or sets a value indicating whether, this property will prohibit a user from editing the contents of this SDT.



89
90
91
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 89

def lock_contents
  @lock_contents
end

#multilineObject

Gets or sets a value indicating whether this SDT allows multiple lines of text.



92
93
94
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 92

def multiline
  @multiline
end

#node_idObject

Gets or sets the node id.



36
37
38
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 36

def node_id
  @node_id
end

#placeholder_nameObject

Gets or sets Name of the Aspose.Words.BuildingBlocks.BuildingBlock containing placeholder text. Aspose.Words.BuildingBlocks.BuildingBlock with this name Aspose.Words.BuildingBlocks.BuildingBlock.Name has to be present in the Aspose.Words.Document.GlossaryDocument otherwise System.InvalidOperationException will occur.



96
97
98
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 96

def placeholder_name
  @placeholder_name
end

#sdt_typeObject

Gets or sets type of this Structured document tag.



99
100
101
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 99

def sdt_type
  @sdt_type
end

#style_nameObject

Gets or sets the name of the style applied to the structured document tag.



102
103
104
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 102

def style_name
  @style_name
end

#tagObject

Gets or sets a tag associated with the current SDT node. Can not be null.



105
106
107
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 105

def tag
  @tag
end

#titleObject

Gets or sets the friendly name associated with this SDT. Can not be null.



108
109
110
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 108

def title
  @title
end

#word_open_xmlObject

Gets a string that represents the XML contained within the node in the Aspose.Words.SaveFormat.FlatOpc format.



111
112
113
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 111

def word_open_xml
  @word_open_xml
end

Class Method Details

.attribute_mapObject

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



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 136

def self.attribute_map
  {
    :'link' => :'Link',
    :'node_id' => :'NodeId',
    :'appearance' => :'Appearance',
    :'building_block_category' => :'BuildingBlockCategory',
    :'building_block_gallery' => :'BuildingBlockGallery',
    :'calendar_type' => :'CalendarType',
    :'checked' => :'Checked',
    :'color' => :'Color',
    :'date_display_format' => :'DateDisplayFormat',
    :'date_display_locale' => :'DateDisplayLocale',
    :'date_storage_format' => :'DateStorageFormat',
    :'full_date' => :'FullDate',
    :'id' => :'Id',
    :'is_showing_placeholder_text' => :'IsShowingPlaceholderText',
    :'is_temporary' => :'IsTemporary',
    :'level' => :'Level',
    :'list_items' => :'ListItems',
    :'lock_content_control' => :'LockContentControl',
    :'lock_contents' => :'LockContents',
    :'multiline' => :'Multiline',
    :'placeholder_name' => :'PlaceholderName',
    :'sdt_type' => :'SdtType',
    :'style_name' => :'StyleName',
    :'tag' => :'Tag',
    :'title' => :'Title',
    :'word_open_xml' => :'WordOpenXML'
  }
end

.swagger_typesObject

Attribute type mapping.



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 168

def self.swagger_types
  {
    :'link' => :'WordsApiLink',
    :'node_id' => :'String',
    :'appearance' => :'String',
    :'building_block_category' => :'String',
    :'building_block_gallery' => :'String',
    :'calendar_type' => :'String',
    :'checked' => :'BOOLEAN',
    :'color' => :'String',
    :'date_display_format' => :'String',
    :'date_display_locale' => :'Integer',
    :'date_storage_format' => :'String',
    :'full_date' => :'DateTime',
    :'id' => :'Integer',
    :'is_showing_placeholder_text' => :'BOOLEAN',
    :'is_temporary' => :'BOOLEAN',
    :'level' => :'String',
    :'list_items' => :'Array<StructuredDocumentTagListItem>',
    :'lock_content_control' => :'BOOLEAN',
    :'lock_contents' => :'BOOLEAN',
    :'multiline' => :'BOOLEAN',
    :'placeholder_name' => :'String',
    :'sdt_type' => :'String',
    :'style_name' => :'String',
    :'tag' => :'String',
    :'title' => :'String',
    :'word_open_xml' => :'String'
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 411

def ==(other)
  return true if self.equal?(other)
  self.class == other.class &&
      link == other.link &&
      node_id == other.node_id &&
      appearance == other.appearance &&
      building_block_category == other.building_block_category &&
      building_block_gallery == other.building_block_gallery &&
      calendar_type == other.calendar_type &&
      checked == other.checked &&
      color == other.color &&
      date_display_format == other.date_display_format &&
      date_display_locale == other.date_display_locale &&
      date_storage_format == other.date_storage_format &&
      full_date == other.full_date &&
      id == other.id &&
      is_showing_placeholder_text == other.is_showing_placeholder_text &&
      is_temporary == other.is_temporary &&
      level == other.level &&
      list_items == other.list_items &&
      lock_content_control == other.lock_content_control &&
      lock_contents == other.lock_contents &&
      multiline == other.multiline &&
      placeholder_name == other.placeholder_name &&
      sdt_type == other.sdt_type &&
      style_name == other.style_name &&
      tag == other.tag &&
      title == other.title &&
      word_open_xml == other.word_open_xml
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



479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 479

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    Time.at(/\d/.match(value)[0].to_f).to_datetime
  when :Date
    Time.at(/\d/.match(value)[0].to_f).to_date
  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 = AsposeWordsCloud.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



546
547
548
549
550
551
552
553
554
555
556
557
558
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 546

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



457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 457

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    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 attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#collectFilesContent(resultFilesContent) ⇒ Object



560
561
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 560

def collectFilesContent(resultFilesContent)
end

#eql?(other) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


444
445
446
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 444

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



450
451
452
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 450

def hash
  [link, node_id, appearance, building_block_category, building_block_gallery, calendar_type, checked, color, date_display_format, date_display_locale, date_storage_format, full_date, id, is_showing_placeholder_text, is_temporary, level, list_items, lock_content_control, lock_contents, multiline, placeholder_name, sdt_type, style_name, tag, title, word_open_xml].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properies with the reasons



316
317
318
319
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 316

def list_invalid_properties
  invalid_properties = []
  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



526
527
528
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 526

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



532
533
534
535
536
537
538
539
540
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 532

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



520
521
522
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 520

def to_s
  to_hash.to_s
end

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/aspose_words_cloud/models/structured_document_tag_update.rb', line 323

def valid?
  appearance_validator = EnumAttributeValidator.new('String', ["Default", "BoundingBox", "Tags", "Hidden"])
  return false unless appearance_validator.valid?(@appearance)
  calendar_type_validator = EnumAttributeValidator.new('String', ["Default", "Gregorian", "GregorianArabic", "GregorianMeFrench", "GregorianUs", "GregorianXlitEnglish", "GregorianXlitFrench", "Hebrew", "Hijri", "Japan", "Korea", "None", "Saka", "Taiwan", "Thai"])
  return false unless calendar_type_validator.valid?(@calendar_type)
  date_storage_format_validator = EnumAttributeValidator.new('String', ["Date", "DateTime", "Default", "Text"])
  return false unless date_storage_format_validator.valid?(@date_storage_format)
  level_validator = EnumAttributeValidator.new('String', ["Unknown", "Inline", "Block", "Row", "Cell"])
  return false unless level_validator.valid?(@level)
  sdt_type_validator = EnumAttributeValidator.new('String', ["None", "Bibliography", "Citation", "Equation", "DropDownList", "ComboBox", "Date", "BuildingBlockGallery", "DocPartObj", "Group", "Picture", "RichText", "PlainText", "Checkbox", "RepeatingSection", "RepeatingSectionItem", "EntityPicker"])
  return false unless sdt_type_validator.valid?(@sdt_type)

  return true
end