Class: PinterestSdkClient::CatalogsRetailFilterValuesMap

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb

Overview

A map of filter attributes to their available values.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ CatalogsRetailFilterValuesMap

Initializes the object

Parameters:

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

    Model attributes in the form of hash



145
146
147
148
149
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
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
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
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 145

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#ad_image_tagsObject

Returns the value of attribute ad_image_tags.



19
20
21
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 19

def ad_image_tags
  @ad_image_tags
end

#ad_video_tagsObject

Returns the value of attribute ad_video_tags.



21
22
23
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 21

def ad_video_tags
  @ad_video_tags
end

#availabilityObject

Returns the value of attribute availability.



23
24
25
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 23

def availability
  @availability
end

#brandObject

Returns the value of attribute brand.



25
26
27
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 25

def brand
  @brand
end

#conditionObject

Returns the value of attribute condition.



27
28
29
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 27

def condition
  @condition
end

#custom_label_0Object

Returns the value of attribute custom_label_0.



29
30
31
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 29

def custom_label_0
  @custom_label_0
end

#custom_label_1Object

Returns the value of attribute custom_label_1.



31
32
33
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 31

def custom_label_1
  @custom_label_1
end

#custom_label_2Object

Returns the value of attribute custom_label_2.



33
34
35
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 33

def custom_label_2
  @custom_label_2
end

#custom_label_3Object

Returns the value of attribute custom_label_3.



35
36
37
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 35

def custom_label_3
  @custom_label_3
end

#custom_label_4Object

Returns the value of attribute custom_label_4.



37
38
39
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 37

def custom_label_4
  @custom_label_4
end

#genderObject

Returns the value of attribute gender.



39
40
41
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 39

def gender
  @gender
end

#google_product_category_0Object

Returns the value of attribute google_product_category_0.



41
42
43
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 41

def google_product_category_0
  @google_product_category_0
end

#google_product_category_1Object

Returns the value of attribute google_product_category_1.



43
44
45
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 43

def google_product_category_1
  @google_product_category_1
end

#google_product_category_2Object

Returns the value of attribute google_product_category_2.



45
46
47
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 45

def google_product_category_2
  @google_product_category_2
end

#google_product_category_3Object

Returns the value of attribute google_product_category_3.



47
48
49
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 47

def google_product_category_3
  @google_product_category_3
end

#google_product_category_4Object

Returns the value of attribute google_product_category_4.



49
50
51
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 49

def google_product_category_4
  @google_product_category_4
end

#google_product_category_5Object

Returns the value of attribute google_product_category_5.



51
52
53
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 51

def google_product_category_5
  @google_product_category_5
end

#google_product_category_6Object

Returns the value of attribute google_product_category_6.



53
54
55
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 53

def google_product_category_6
  @google_product_category_6
end

#media_typeObject

Returns the value of attribute media_type.



55
56
57
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 55

def media_type
  @media_type
end

#product_type_0Object

Returns the value of attribute product_type_0.



57
58
59
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 57

def product_type_0
  @product_type_0
end

#product_type_1Object

Returns the value of attribute product_type_1.



59
60
61
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 59

def product_type_1
  @product_type_1
end

#product_type_2Object

Returns the value of attribute product_type_2.



61
62
63
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 61

def product_type_2
  @product_type_2
end

#product_type_3Object

Returns the value of attribute product_type_3.



63
64
65
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 63

def product_type_3
  @product_type_3
end

#product_type_4Object

Returns the value of attribute product_type_4.



65
66
67
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 65

def product_type_4
  @product_type_4
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



98
99
100
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 98

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



103
104
105
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 103

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 68

def self.attribute_map
  {
    :'ad_image_tags' => :'ad_image_tags',
    :'ad_video_tags' => :'ad_video_tags',
    :'availability' => :'availability',
    :'brand' => :'brand',
    :'condition' => :'condition',
    :'custom_label_0' => :'custom_label_0',
    :'custom_label_1' => :'custom_label_1',
    :'custom_label_2' => :'custom_label_2',
    :'custom_label_3' => :'custom_label_3',
    :'custom_label_4' => :'custom_label_4',
    :'gender' => :'gender',
    :'google_product_category_0' => :'google_product_category_0',
    :'google_product_category_1' => :'google_product_category_1',
    :'google_product_category_2' => :'google_product_category_2',
    :'google_product_category_3' => :'google_product_category_3',
    :'google_product_category_4' => :'google_product_category_4',
    :'google_product_category_5' => :'google_product_category_5',
    :'google_product_category_6' => :'google_product_category_6',
    :'media_type' => :'media_type',
    :'product_type_0' => :'product_type_0',
    :'product_type_1' => :'product_type_1',
    :'product_type_2' => :'product_type_2',
    :'product_type_3' => :'product_type_3',
    :'product_type_4' => :'product_type_4'
  }
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



365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 365

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{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[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



138
139
140
141
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 138

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 108

def self.openapi_types
  {
    :'ad_image_tags' => :'Array<String>',
    :'ad_video_tags' => :'Array<String>',
    :'availability' => :'Array<ProductAvailability>',
    :'brand' => :'Array<String>',
    :'condition' => :'Array<ProductCondition>',
    :'custom_label_0' => :'Array<String>',
    :'custom_label_1' => :'Array<String>',
    :'custom_label_2' => :'Array<String>',
    :'custom_label_3' => :'Array<String>',
    :'custom_label_4' => :'Array<String>',
    :'gender' => :'Array<Gender>',
    :'google_product_category_0' => :'Array<String>',
    :'google_product_category_1' => :'Array<String>',
    :'google_product_category_2' => :'Array<String>',
    :'google_product_category_3' => :'Array<String>',
    :'google_product_category_4' => :'Array<String>',
    :'google_product_category_5' => :'Array<String>',
    :'google_product_category_6' => :'Array<String>',
    :'media_type' => :'Array<MediaType>',
    :'product_type_0' => :'Array<String>',
    :'product_type_1' => :'Array<String>',
    :'product_type_2' => :'Array<String>',
    :'product_type_3' => :'Array<String>',
    :'product_type_4' => :'Array<String>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 321

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      ad_image_tags == o.ad_image_tags &&
      ad_video_tags == o.ad_video_tags &&
      availability == o.availability &&
      brand == o.brand &&
      condition == o.condition &&
      custom_label_0 == o.custom_label_0 &&
      custom_label_1 == o.custom_label_1 &&
      custom_label_2 == o.custom_label_2 &&
      custom_label_3 == o.custom_label_3 &&
      custom_label_4 == o.custom_label_4 &&
      gender == o.gender &&
      google_product_category_0 == o.google_product_category_0 &&
      google_product_category_1 == o.google_product_category_1 &&
      google_product_category_2 == o.google_product_category_2 &&
      google_product_category_3 == o.google_product_category_3 &&
      google_product_category_4 == o.google_product_category_4 &&
      google_product_category_5 == o.google_product_category_5 &&
      google_product_category_6 == o.google_product_category_6 &&
      media_type == o.media_type &&
      product_type_0 == o.product_type_0 &&
      product_type_1 == o.product_type_1 &&
      product_type_2 == o.product_type_2 &&
      product_type_3 == o.product_type_3 &&
      product_type_4 == o.product_type_4
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


352
353
354
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 352

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



358
359
360
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 358

def hash
  [ad_image_tags, ad_video_tags, availability, brand, condition, custom_label_0, custom_label_1, custom_label_2, custom_label_3, custom_label_4, gender, google_product_category_0, google_product_category_1, google_product_category_2, google_product_category_3, google_product_category_4, google_product_category_5, google_product_category_6, media_type, product_type_0, product_type_1, product_type_2, product_type_3, product_type_4].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



306
307
308
309
310
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 306

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



387
388
389
390
391
392
393
394
395
396
397
398
399
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 387

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

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



314
315
316
317
# File 'lib/pinterest_sdk/models/catalogs_retail_filter_values_map.rb', line 314

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end