Class: KlaviyoAPI::TableBlockStyles

Inherits:
Object
  • Object
show all
Defined in:
lib/klaviyo-api-sdk/models/table_block_styles.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TableBlockStyles

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
339
340
341
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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 260

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `KlaviyoAPI::TableBlockStyles` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `KlaviyoAPI::TableBlockStyles`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#block_background_colorObject

Returns the value of attribute block_background_color.



17
18
19
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 17

def block_background_color
  @block_background_color
end

#block_border_colorObject

Returns the value of attribute block_border_color.



19
20
21
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 19

def block_border_color
  @block_border_color
end

#block_border_styleObject

Border style.



22
23
24
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 22

def block_border_style
  @block_border_style
end

#block_border_widthObject

Returns the value of attribute block_border_width.



24
25
26
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 24

def block_border_width
  @block_border_width
end

#block_padding_bottomObject

Returns the value of attribute block_padding_bottom.



26
27
28
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 26

def block_padding_bottom
  @block_padding_bottom
end

#block_padding_leftObject

Returns the value of attribute block_padding_left.



28
29
30
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 28

def block_padding_left
  @block_padding_left
end

#block_padding_rightObject

Returns the value of attribute block_padding_right.



30
31
32
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 30

def block_padding_right
  @block_padding_right
end

#block_padding_topObject

Returns the value of attribute block_padding_top.



32
33
34
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 32

def block_padding_top
  @block_padding_top
end

#cell_horizontal_border_colorObject

Returns the value of attribute cell_horizontal_border_color.



34
35
36
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 34

def cell_horizontal_border_color
  @cell_horizontal_border_color
end

#cell_horizontal_border_styleObject

Border style.



37
38
39
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 37

def cell_horizontal_border_style
  @cell_horizontal_border_style
end

#cell_horizontal_border_widthObject

Returns the value of attribute cell_horizontal_border_width.



39
40
41
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 39

def cell_horizontal_border_width
  @cell_horizontal_border_width
end

#cell_padding_bottomObject

Returns the value of attribute cell_padding_bottom.



41
42
43
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 41

def cell_padding_bottom
  @cell_padding_bottom
end

#cell_padding_leftObject

Returns the value of attribute cell_padding_left.



43
44
45
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 43

def cell_padding_left
  @cell_padding_left
end

#cell_padding_rightObject

Returns the value of attribute cell_padding_right.



45
46
47
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 45

def cell_padding_right
  @cell_padding_right
end

#cell_padding_topObject

Returns the value of attribute cell_padding_top.



47
48
49
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 47

def cell_padding_top
  @cell_padding_top
end

#cell_vertical_alignObject

Vertical alignment.



50
51
52
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 50

def cell_vertical_align
  @cell_vertical_align
end

#cell_vertical_border_colorObject

Returns the value of attribute cell_vertical_border_color.



52
53
54
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 52

def cell_vertical_border_color
  @cell_vertical_border_color
end

#cell_vertical_border_styleObject

Border style.



55
56
57
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 55

def cell_vertical_border_style
  @cell_vertical_border_style
end

#cell_vertical_border_widthObject

Returns the value of attribute cell_vertical_border_width.



57
58
59
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 57

def cell_vertical_border_width
  @cell_vertical_border_width
end

#header_background_colorObject

Returns the value of attribute header_background_color.



59
60
61
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 59

def header_background_color
  @header_background_color
end

#header_font_colorObject

Returns the value of attribute header_font_color.



61
62
63
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 61

def header_font_color
  @header_font_color
end

#header_font_familyObject

Returns the value of attribute header_font_family.



63
64
65
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 63

def header_font_family
  @header_font_family
end

#header_font_sizeObject

Returns the value of attribute header_font_size.



65
66
67
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 65

def header_font_size
  @header_font_size
end

#header_font_styleObject

Font style.



68
69
70
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 68

def header_font_style
  @header_font_style
end

#header_font_weightObject

Returns the value of attribute header_font_weight.



70
71
72
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 70

def header_font_weight
  @header_font_weight
end

#header_letter_spacingObject

Returns the value of attribute header_letter_spacing.



72
73
74
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 72

def header_letter_spacing
  @header_letter_spacing
end

#header_line_heightObject

Returns the value of attribute header_line_height.



74
75
76
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 74

def header_line_height
  @header_line_height
end

#header_padding_bottomObject

Returns the value of attribute header_padding_bottom.



76
77
78
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 76

def header_padding_bottom
  @header_padding_bottom
end

#header_padding_leftObject

Returns the value of attribute header_padding_left.



78
79
80
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 78

def header_padding_left
  @header_padding_left
end

#header_padding_rightObject

Returns the value of attribute header_padding_right.



80
81
82
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 80

def header_padding_right
  @header_padding_right
end

#header_padding_topObject

Returns the value of attribute header_padding_top.



82
83
84
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 82

def header_padding_top
  @header_padding_top
end

#header_text_decorationObject

Returns the value of attribute header_text_decoration.



84
85
86
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 84

def header_text_decoration
  @header_text_decoration
end

#table_background_colorObject

Returns the value of attribute table_background_color.



86
87
88
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 86

def table_background_color
  @table_background_color
end

#table_font_colorObject

Returns the value of attribute table_font_color.



88
89
90
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 88

def table_font_color
  @table_font_color
end

#table_font_familyObject

Returns the value of attribute table_font_family.



90
91
92
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 90

def table_font_family
  @table_font_family
end

#table_font_sizeObject

Returns the value of attribute table_font_size.



92
93
94
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 92

def table_font_size
  @table_font_size
end

#table_text_alignObject

Text Alignment.



95
96
97
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 95

def table_text_align
  @table_text_align
end

#use_legacy_mobile_paddingObject

Returns the value of attribute use_legacy_mobile_padding.



97
98
99
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 97

def use_legacy_mobile_padding
  @use_legacy_mobile_padding
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



166
167
168
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 166

def self.acceptable_attributes
  attribute_map.values
end

.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 122

def self.attribute_map
  {
    :'block_background_color' => :'block_background_color',
    :'block_border_color' => :'block_border_color',
    :'block_border_style' => :'block_border_style',
    :'block_border_width' => :'block_border_width',
    :'block_padding_bottom' => :'block_padding_bottom',
    :'block_padding_left' => :'block_padding_left',
    :'block_padding_right' => :'block_padding_right',
    :'block_padding_top' => :'block_padding_top',
    :'cell_horizontal_border_color' => :'cell_horizontal_border_color',
    :'cell_horizontal_border_style' => :'cell_horizontal_border_style',
    :'cell_horizontal_border_width' => :'cell_horizontal_border_width',
    :'cell_padding_bottom' => :'cell_padding_bottom',
    :'cell_padding_left' => :'cell_padding_left',
    :'cell_padding_right' => :'cell_padding_right',
    :'cell_padding_top' => :'cell_padding_top',
    :'cell_vertical_align' => :'cell_vertical_align',
    :'cell_vertical_border_color' => :'cell_vertical_border_color',
    :'cell_vertical_border_style' => :'cell_vertical_border_style',
    :'cell_vertical_border_width' => :'cell_vertical_border_width',
    :'header_background_color' => :'header_background_color',
    :'header_font_color' => :'header_font_color',
    :'header_font_family' => :'header_font_family',
    :'header_font_size' => :'header_font_size',
    :'header_font_style' => :'header_font_style',
    :'header_font_weight' => :'header_font_weight',
    :'header_letter_spacing' => :'header_letter_spacing',
    :'header_line_height' => :'header_line_height',
    :'header_padding_bottom' => :'header_padding_bottom',
    :'header_padding_left' => :'header_padding_left',
    :'header_padding_right' => :'header_padding_right',
    :'header_padding_top' => :'header_padding_top',
    :'header_text_decoration' => :'header_text_decoration',
    :'table_background_color' => :'table_background_color',
    :'table_font_color' => :'table_font_color',
    :'table_font_family' => :'table_font_family',
    :'table_font_size' => :'table_font_size',
    :'table_text_align' => :'table_text_align',
    :'use_legacy_mobile_padding' => :'use_legacy_mobile_padding'
  }
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



571
572
573
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 571

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



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
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 215

def self.openapi_nullable
  Set.new([
    :'block_background_color',
    :'block_border_color',
    :'block_border_style',
    :'block_border_width',
    :'block_padding_bottom',
    :'block_padding_left',
    :'block_padding_right',
    :'block_padding_top',
    :'cell_horizontal_border_color',
    :'cell_horizontal_border_style',
    :'cell_horizontal_border_width',
    :'cell_padding_bottom',
    :'cell_padding_left',
    :'cell_padding_right',
    :'cell_padding_top',
    :'cell_vertical_align',
    :'cell_vertical_border_color',
    :'cell_vertical_border_style',
    :'cell_vertical_border_width',
    :'header_background_color',
    :'header_font_color',
    :'header_font_family',
    :'header_font_size',
    :'header_font_style',
    :'header_font_weight',
    :'header_letter_spacing',
    :'header_line_height',
    :'header_padding_bottom',
    :'header_padding_left',
    :'header_padding_right',
    :'header_padding_top',
    :'header_text_decoration',
    :'table_background_color',
    :'table_font_color',
    :'table_font_family',
    :'table_font_size',
    :'table_text_align',
    :'use_legacy_mobile_padding'
  ])
end

.openapi_typesObject

Attribute type mapping.



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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 171

def self.openapi_types
  {
    :'block_background_color' => :'String',
    :'block_border_color' => :'String',
    :'block_border_style' => :'String',
    :'block_border_width' => :'Integer',
    :'block_padding_bottom' => :'Integer',
    :'block_padding_left' => :'Integer',
    :'block_padding_right' => :'Integer',
    :'block_padding_top' => :'Integer',
    :'cell_horizontal_border_color' => :'String',
    :'cell_horizontal_border_style' => :'String',
    :'cell_horizontal_border_width' => :'Integer',
    :'cell_padding_bottom' => :'Integer',
    :'cell_padding_left' => :'Integer',
    :'cell_padding_right' => :'Integer',
    :'cell_padding_top' => :'Integer',
    :'cell_vertical_align' => :'String',
    :'cell_vertical_border_color' => :'String',
    :'cell_vertical_border_style' => :'String',
    :'cell_vertical_border_width' => :'Integer',
    :'header_background_color' => :'String',
    :'header_font_color' => :'String',
    :'header_font_family' => :'String',
    :'header_font_size' => :'Integer',
    :'header_font_style' => :'String',
    :'header_font_weight' => :'String',
    :'header_letter_spacing' => :'Integer',
    :'header_line_height' => :'Float',
    :'header_padding_bottom' => :'Integer',
    :'header_padding_left' => :'Integer',
    :'header_padding_right' => :'Integer',
    :'header_padding_top' => :'Integer',
    :'header_text_decoration' => :'String',
    :'table_background_color' => :'String',
    :'table_font_color' => :'String',
    :'table_font_family' => :'String',
    :'table_font_size' => :'Integer',
    :'table_text_align' => :'String',
    :'use_legacy_mobile_padding' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 513

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      block_background_color == o.block_background_color &&
      block_border_color == o.block_border_color &&
      block_border_style == o.block_border_style &&
      block_border_width == o.block_border_width &&
      block_padding_bottom == o.block_padding_bottom &&
      block_padding_left == o.block_padding_left &&
      block_padding_right == o.block_padding_right &&
      block_padding_top == o.block_padding_top &&
      cell_horizontal_border_color == o.cell_horizontal_border_color &&
      cell_horizontal_border_style == o.cell_horizontal_border_style &&
      cell_horizontal_border_width == o.cell_horizontal_border_width &&
      cell_padding_bottom == o.cell_padding_bottom &&
      cell_padding_left == o.cell_padding_left &&
      cell_padding_right == o.cell_padding_right &&
      cell_padding_top == o.cell_padding_top &&
      cell_vertical_align == o.cell_vertical_align &&
      cell_vertical_border_color == o.cell_vertical_border_color &&
      cell_vertical_border_style == o.cell_vertical_border_style &&
      cell_vertical_border_width == o.cell_vertical_border_width &&
      header_background_color == o.header_background_color &&
      header_font_color == o.header_font_color &&
      header_font_family == o.header_font_family &&
      header_font_size == o.header_font_size &&
      header_font_style == o.header_font_style &&
      header_font_weight == o.header_font_weight &&
      header_letter_spacing == o.header_letter_spacing &&
      header_line_height == o.header_line_height &&
      header_padding_bottom == o.header_padding_bottom &&
      header_padding_left == o.header_padding_left &&
      header_padding_right == o.header_padding_right &&
      header_padding_top == o.header_padding_top &&
      header_text_decoration == o.header_text_decoration &&
      table_background_color == o.table_background_color &&
      table_font_color == o.table_font_color &&
      table_font_family == o.table_font_family &&
      table_font_size == o.table_font_size &&
      table_text_align == o.table_text_align &&
      use_legacy_mobile_padding == o.use_legacy_mobile_padding
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



602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 602

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.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
    # models (e.g. Pet) or oneOf
    klass = KlaviyoAPI.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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



673
674
675
676
677
678
679
680
681
682
683
684
685
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 673

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



578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 578

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that 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
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


558
559
560
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 558

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



564
565
566
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 564

def hash
  [block_background_color, block_border_color, block_border_style, block_border_width, block_padding_bottom, block_padding_left, block_padding_right, block_padding_top, cell_horizontal_border_color, cell_horizontal_border_style, cell_horizontal_border_width, cell_padding_bottom, cell_padding_left, cell_padding_right, cell_padding_top, cell_vertical_align, cell_vertical_border_color, cell_vertical_border_style, cell_vertical_border_width, header_background_color, header_font_color, header_font_family, header_font_size, header_font_style, header_font_weight, header_letter_spacing, header_line_height, header_padding_bottom, header_padding_left, header_padding_right, header_padding_top, header_text_decoration, table_background_color, table_font_color, table_font_family, table_font_size, table_text_align, use_legacy_mobile_padding].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



428
429
430
431
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 428

def list_invalid_properties
  invalid_properties = Array.new
  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



649
650
651
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 649

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



655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 655

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



643
644
645
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 643

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



435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/klaviyo-api-sdk/models/table_block_styles.rb', line 435

def valid?
  block_border_style_validator = EnumAttributeValidator.new('String', ["dashed", "dotted", "groove", "inset", "none", "outset", "ridge", "solid"])
  return false unless block_border_style_validator.valid?(@block_border_style)
  cell_horizontal_border_style_validator = EnumAttributeValidator.new('String', ["dashed", "dotted", "groove", "inset", "none", "outset", "ridge", "solid"])
  return false unless cell_horizontal_border_style_validator.valid?(@cell_horizontal_border_style)
  cell_vertical_align_validator = EnumAttributeValidator.new('String', ["baseline", "bottom", "middle", "top"])
  return false unless cell_vertical_align_validator.valid?(@cell_vertical_align)
  cell_vertical_border_style_validator = EnumAttributeValidator.new('String', ["dashed", "dotted", "groove", "inset", "none", "outset", "ridge", "solid"])
  return false unless cell_vertical_border_style_validator.valid?(@cell_vertical_border_style)
  header_font_style_validator = EnumAttributeValidator.new('String', ["italic", "normal"])
  return false unless header_font_style_validator.valid?(@header_font_style)
  table_text_align_validator = EnumAttributeValidator.new('String', ["center", "left", "right"])
  return false unless table_text_align_validator.valid?(@table_text_align)
  true
end