Class: PinterestSdkClient::CatalogsItemValidationErrors

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

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 = {}) ⇒ CatalogsItemValidationErrors

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `PinterestSdkClient::CatalogsItemValidationErrors` 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::CatalogsItemValidationErrors`. 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?(:'adult_invalid')
    self.adult_invalid = attributes[:'adult_invalid']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#adult_invalidObject

Item has an invalid adult value.



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

def adult_invalid
  @adult_invalid
end

#adwords_format_invalidObject

Adword link contains too many characters.



22
23
24
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 22

def adwords_format_invalid
  @adwords_format_invalid
end

#availability_invalidObject

Item is missing availability value in its product metadata, this item will not be published.



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

def availability_invalid
  @availability_invalid
end

#blocklisted_image_signatureObject

Item will not be published because it doesn't meet Pinterest's Merchant Guidelines.



28
29
30
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 28

def blocklisted_image_signature
  @blocklisted_image_signature
end

#description_missingObject

Item is missing description in its product metadata, this item will not be published.



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

def description_missing
  @description_missing
end

#duplicate_productsObject

This product is duplicated. The duplicate entry will not be published.



34
35
36
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 34

def duplicate_products
  @duplicate_products
end

Image link is invalid.



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

def image_link_invalid
  @image_link_invalid
end

Item has image_link URL that contains too many characters, so the item will not be published.



40
41
42
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 40

def image_link_length_too_long
  @image_link_length_too_long
end

Item is missing an image link URL in its product metadata, this item will not be published.



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

def image_link_missing
  @image_link_missing
end

#invalid_domainObject

Product link value doesn't match the verified domain associated with this account.



46
47
48
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 46

def invalid_domain
  @invalid_domain
end

#item_main_image_download_failureObject

Main image can't be found.



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

def item_main_image_download_failure
  @item_main_image_download_failure
end

#itemid_missingObject

Item is missing item id in its product metadata, this item will not be published.



52
53
54
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 52

def itemid_missing
  @itemid_missing
end

Link is invalid.



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

def link_format_invalid
  @link_format_invalid
end

Product link contains too many characters, this item will not be published.



58
59
60
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 58

def link_length_too_long
  @link_length_too_long
end

#list_price_invalidObject

Item has a list price formatting error, this item will not be published.



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

def list_price_invalid
  @list_price_invalid
end

#max_items_per_item_group_exceededObject

Item exceed the maximum number of items per item group, this item will not be published.



64
65
66
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 64

def max_items_per_item_group_exceeded
  @max_items_per_item_group_exceeded
end

#parse_line_errorObject

Item contains formating errors.



67
68
69
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 67

def parse_line_error
  @parse_line_error
end

#pinjoin_content_unsafeObject

Item will not be published because it doesn't meet Pinterest's Merchant Guidelines.



70
71
72
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 70

def pinjoin_content_unsafe
  @pinjoin_content_unsafe
end

#price_cannot_be_determinedObject

Item price cannot be determined because the price, list price, and sale price are all different.



73
74
75
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 73

def price_cannot_be_determined
  @price_cannot_be_determined
end

#price_missingObject

Product is missing a price, this item will not be published.



76
77
78
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 76

def price_missing
  @price_missing
end

Item is missing a link URL in its product metadata, this item will not be published.



79
80
81
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 79

def product_link_missing
  @product_link_missing
end

#product_price_invalidObject

Item has a price formatting error in its product metadata, this item will not be published.



82
83
84
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 82

def product_price_invalid
  @product_price_invalid
end

#title_missingObject

Item is missing title in its product metadata, this item will not be published.



85
86
87
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 85

def title_missing
  @title_missing
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



117
118
119
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 117

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



122
123
124
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 122

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 88

def self.attribute_map
  {
    :'adult_invalid' => :'ADULT_INVALID',
    :'adwords_format_invalid' => :'ADWORDS_FORMAT_INVALID',
    :'availability_invalid' => :'AVAILABILITY_INVALID',
    :'blocklisted_image_signature' => :'BLOCKLISTED_IMAGE_SIGNATURE',
    :'description_missing' => :'DESCRIPTION_MISSING',
    :'duplicate_products' => :'DUPLICATE_PRODUCTS',
    :'image_link_invalid' => :'IMAGE_LINK_INVALID',
    :'image_link_length_too_long' => :'IMAGE_LINK_LENGTH_TOO_LONG',
    :'image_link_missing' => :'IMAGE_LINK_MISSING',
    :'invalid_domain' => :'INVALID_DOMAIN',
    :'item_main_image_download_failure' => :'ITEM_MAIN_IMAGE_DOWNLOAD_FAILURE',
    :'itemid_missing' => :'ITEMID_MISSING',
    :'link_format_invalid' => :'LINK_FORMAT_INVALID',
    :'link_length_too_long' => :'LINK_LENGTH_TOO_LONG',
    :'list_price_invalid' => :'LIST_PRICE_INVALID',
    :'max_items_per_item_group_exceeded' => :'MAX_ITEMS_PER_ITEM_GROUP_EXCEEDED',
    :'parse_line_error' => :'PARSE_LINE_ERROR',
    :'pinjoin_content_unsafe' => :'PINJOIN_CONTENT_UNSAFE',
    :'price_cannot_be_determined' => :'PRICE_CANNOT_BE_DETERMINED',
    :'price_missing' => :'PRICE_MISSING',
    :'product_link_missing' => :'PRODUCT_LINK_MISSING',
    :'product_price_invalid' => :'PRODUCT_PRICE_INVALID',
    :'title_missing' => :'TITLE_MISSING'
  }
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



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_item_validation_errors.rb', line 330

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



156
157
158
159
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 156

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

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'adult_invalid' => :'CatalogsItemValidationDetails',
    :'adwords_format_invalid' => :'CatalogsItemValidationDetails',
    :'availability_invalid' => :'CatalogsItemValidationDetails',
    :'blocklisted_image_signature' => :'CatalogsItemValidationDetails',
    :'description_missing' => :'CatalogsItemValidationDetails',
    :'duplicate_products' => :'CatalogsItemValidationDetails',
    :'image_link_invalid' => :'CatalogsItemValidationDetails',
    :'image_link_length_too_long' => :'CatalogsItemValidationDetails',
    :'image_link_missing' => :'CatalogsItemValidationDetails',
    :'invalid_domain' => :'CatalogsItemValidationDetails',
    :'item_main_image_download_failure' => :'CatalogsItemValidationDetails',
    :'itemid_missing' => :'CatalogsItemValidationDetails',
    :'link_format_invalid' => :'CatalogsItemValidationDetails',
    :'link_length_too_long' => :'CatalogsItemValidationDetails',
    :'list_price_invalid' => :'CatalogsItemValidationDetails',
    :'max_items_per_item_group_exceeded' => :'CatalogsItemValidationDetails',
    :'parse_line_error' => :'CatalogsItemValidationDetails',
    :'pinjoin_content_unsafe' => :'CatalogsItemValidationDetails',
    :'price_cannot_be_determined' => :'CatalogsItemValidationDetails',
    :'price_missing' => :'CatalogsItemValidationDetails',
    :'product_link_missing' => :'CatalogsItemValidationDetails',
    :'product_price_invalid' => :'CatalogsItemValidationDetails',
    :'title_missing' => :'CatalogsItemValidationDetails'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      adult_invalid == o.adult_invalid &&
      adwords_format_invalid == o.adwords_format_invalid &&
      availability_invalid == o.availability_invalid &&
      blocklisted_image_signature == o.blocklisted_image_signature &&
      description_missing == o.description_missing &&
      duplicate_products == o.duplicate_products &&
      image_link_invalid == o.image_link_invalid &&
      image_link_length_too_long == o.image_link_length_too_long &&
      image_link_missing == o.image_link_missing &&
      invalid_domain == o.invalid_domain &&
      item_main_image_download_failure == o.item_main_image_download_failure &&
      itemid_missing == o.itemid_missing &&
      link_format_invalid == o.link_format_invalid &&
      link_length_too_long == o.link_length_too_long &&
      list_price_invalid == o.list_price_invalid &&
      max_items_per_item_group_exceeded == o.max_items_per_item_group_exceeded &&
      parse_line_error == o.parse_line_error &&
      pinjoin_content_unsafe == o.pinjoin_content_unsafe &&
      price_cannot_be_determined == o.price_cannot_be_determined &&
      price_missing == o.price_missing &&
      product_link_missing == o.product_link_missing &&
      product_price_invalid == o.product_price_invalid &&
      title_missing == o.title_missing
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


317
318
319
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 317

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



323
324
325
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 323

def hash
  [adult_invalid, adwords_format_invalid, availability_invalid, blocklisted_image_signature, description_missing, duplicate_products, image_link_invalid, image_link_length_too_long, image_link_missing, invalid_domain, item_main_image_download_failure, itemid_missing, link_format_invalid, link_length_too_long, list_price_invalid, max_items_per_item_group_exceeded, parse_line_error, pinjoin_content_unsafe, price_cannot_be_determined, price_missing, product_link_missing, product_price_invalid, title_missing].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



272
273
274
275
276
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 272

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



352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 352

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



280
281
282
283
# File 'lib/pinterest_sdk/models/catalogs_item_validation_errors.rb', line 280

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