Class: Zernio::MetaCatalogProductInput
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::MetaCatalogProductInput
- Defined in:
- lib/zernio-sdk/models/meta_catalog_product_input.rb
Overview
One product shape for single and bulk calls. Money is in major units (12.99); Zernio converts to what Meta wants.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#additional_image_urls ⇒ Object
Returns the value of attribute additional_image_urls.
-
#availability ⇒ Object
Returns the value of attribute availability.
-
#brand ⇒ Object
Returns the value of attribute brand.
-
#category ⇒ Object
Returns the value of attribute category.
-
#color ⇒ Object
Returns the value of attribute color.
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#currency ⇒ Object
ISO 4217, e.g.
-
#custom_label0 ⇒ Object
Returns the value of attribute custom_label0.
-
#custom_label1 ⇒ Object
Returns the value of attribute custom_label1.
-
#custom_label2 ⇒ Object
Returns the value of attribute custom_label2.
-
#custom_label3 ⇒ Object
Returns the value of attribute custom_label3.
-
#custom_label4 ⇒ Object
Returns the value of attribute custom_label4.
-
#description ⇒ Object
Returns the value of attribute description.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#google_product_category ⇒ Object
Returns the value of attribute google_product_category.
-
#gtin ⇒ Object
Returns the value of attribute gtin.
-
#image_url ⇒ Object
Returns the value of attribute image_url.
-
#inventory ⇒ Object
Returns the value of attribute inventory.
-
#material ⇒ Object
Returns the value of attribute material.
-
#mpn ⇒ Object
Returns the value of attribute mpn.
-
#name ⇒ Object
Returns the value of attribute name.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#price ⇒ Object
Major units, e.g.
-
#product_type ⇒ Object
Returns the value of attribute product_type.
-
#retailer_id ⇒ Object
Your SKU; unique inside the catalog.
-
#sale_price ⇒ Object
Returns the value of attribute sale_price.
-
#sale_price_end_date ⇒ Object
ISO 8601.
-
#sale_price_start_date ⇒ Object
ISO 8601.
-
#size ⇒ Object
Returns the value of attribute size.
-
#url ⇒ Object
Product page.
-
#visibility ⇒ Object
Returns the value of attribute visibility.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ MetaCatalogProductInput
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ MetaCatalogProductInput
Initializes the object
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 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 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 201 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::MetaCatalogProductInput` 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 `Zernio::MetaCatalogProductInput`. 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?(:'retailer_id') self.retailer_id = attributes[:'retailer_id'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'url') self.url = attributes[:'url'] end if attributes.key?(:'image_url') self.image_url = attributes[:'image_url'] end if attributes.key?(:'additional_image_urls') if (value = attributes[:'additional_image_urls']).is_a?(Array) self.additional_image_urls = value end end if attributes.key?(:'price') self.price = attributes[:'price'] end if attributes.key?(:'currency') self.currency = attributes[:'currency'] end if attributes.key?(:'sale_price') self.sale_price = attributes[:'sale_price'] end if attributes.key?(:'sale_price_start_date') self.sale_price_start_date = attributes[:'sale_price_start_date'] end if attributes.key?(:'sale_price_end_date') self.sale_price_end_date = attributes[:'sale_price_end_date'] end if attributes.key?(:'availability') self.availability = attributes[:'availability'] end if attributes.key?(:'condition') self.condition = attributes[:'condition'] end if attributes.key?(:'brand') self.brand = attributes[:'brand'] end if attributes.key?(:'category') self.category = attributes[:'category'] end if attributes.key?(:'google_product_category') self.google_product_category = attributes[:'google_product_category'] end if attributes.key?(:'product_type') self.product_type = attributes[:'product_type'] end if attributes.key?(:'gtin') self.gtin = attributes[:'gtin'] end if attributes.key?(:'mpn') self.mpn = attributes[:'mpn'] end if attributes.key?(:'inventory') self.inventory = attributes[:'inventory'] end if attributes.key?(:'visibility') self.visibility = attributes[:'visibility'] end if attributes.key?(:'color') self.color = attributes[:'color'] end if attributes.key?(:'size') self.size = attributes[:'size'] end if attributes.key?(:'gender') self.gender = attributes[:'gender'] end if attributes.key?(:'material') self.material = attributes[:'material'] end if attributes.key?(:'pattern') self.pattern = attributes[:'pattern'] end if attributes.key?(:'custom_label0') self.custom_label0 = attributes[:'custom_label0'] end if attributes.key?(:'custom_label1') self.custom_label1 = attributes[:'custom_label1'] end if attributes.key?(:'custom_label2') self.custom_label2 = attributes[:'custom_label2'] end if attributes.key?(:'custom_label3') self.custom_label3 = attributes[:'custom_label3'] end if attributes.key?(:'custom_label4') self.custom_label4 = attributes[:'custom_label4'] end end |
Instance Attribute Details
#additional_image_urls ⇒ Object
Returns the value of attribute additional_image_urls.
31 32 33 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 31 def additional_image_urls @additional_image_urls end |
#availability ⇒ Object
Returns the value of attribute availability.
47 48 49 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 47 def availability @availability end |
#brand ⇒ Object
Returns the value of attribute brand.
51 52 53 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 51 def brand @brand end |
#category ⇒ Object
Returns the value of attribute category.
53 54 55 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 53 def category @category end |
#color ⇒ Object
Returns the value of attribute color.
67 68 69 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 67 def color @color end |
#condition ⇒ Object
Returns the value of attribute condition.
49 50 51 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 49 def condition @condition end |
#currency ⇒ Object
ISO 4217, e.g. EUR
37 38 39 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 37 def currency @currency end |
#custom_label0 ⇒ Object
Returns the value of attribute custom_label0.
77 78 79 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 77 def custom_label0 @custom_label0 end |
#custom_label1 ⇒ Object
Returns the value of attribute custom_label1.
79 80 81 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 79 def custom_label1 @custom_label1 end |
#custom_label2 ⇒ Object
Returns the value of attribute custom_label2.
81 82 83 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 81 def custom_label2 @custom_label2 end |
#custom_label3 ⇒ Object
Returns the value of attribute custom_label3.
83 84 85 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 83 def custom_label3 @custom_label3 end |
#custom_label4 ⇒ Object
Returns the value of attribute custom_label4.
85 86 87 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 85 def custom_label4 @custom_label4 end |
#description ⇒ Object
Returns the value of attribute description.
24 25 26 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 24 def description @description end |
#gender ⇒ Object
Returns the value of attribute gender.
71 72 73 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 71 def gender @gender end |
#google_product_category ⇒ Object
Returns the value of attribute google_product_category.
55 56 57 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 55 def google_product_category @google_product_category end |
#gtin ⇒ Object
Returns the value of attribute gtin.
59 60 61 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 59 def gtin @gtin end |
#image_url ⇒ Object
Returns the value of attribute image_url.
29 30 31 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 29 def image_url @image_url end |
#inventory ⇒ Object
Returns the value of attribute inventory.
63 64 65 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 63 def inventory @inventory end |
#material ⇒ Object
Returns the value of attribute material.
73 74 75 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 73 def material @material end |
#mpn ⇒ Object
Returns the value of attribute mpn.
61 62 63 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 61 def mpn @mpn end |
#name ⇒ Object
Returns the value of attribute name.
22 23 24 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 22 def name @name end |
#pattern ⇒ Object
Returns the value of attribute pattern.
75 76 77 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 75 def pattern @pattern end |
#price ⇒ Object
Major units, e.g. 12.99
34 35 36 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 34 def price @price end |
#product_type ⇒ Object
Returns the value of attribute product_type.
57 58 59 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 57 def product_type @product_type end |
#retailer_id ⇒ Object
Your SKU; unique inside the catalog
20 21 22 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 20 def retailer_id @retailer_id end |
#sale_price ⇒ Object
Returns the value of attribute sale_price.
39 40 41 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 39 def sale_price @sale_price end |
#sale_price_end_date ⇒ Object
ISO 8601
45 46 47 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 45 def sale_price_end_date @sale_price_end_date end |
#sale_price_start_date ⇒ Object
ISO 8601
42 43 44 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 42 def sale_price_start_date @sale_price_start_date end |
#size ⇒ Object
Returns the value of attribute size.
69 70 71 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 69 def size @size end |
#url ⇒ Object
Product page
27 28 29 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 27 def url @url end |
#visibility ⇒ Object
Returns the value of attribute visibility.
65 66 67 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 65 def visibility @visibility end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
147 148 149 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 147 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
152 153 154 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 152 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 136 137 138 139 140 141 142 143 144 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 110 def self.attribute_map { :'retailer_id' => :'retailerId', :'name' => :'name', :'description' => :'description', :'url' => :'url', :'image_url' => :'imageUrl', :'additional_image_urls' => :'additionalImageUrls', :'price' => :'price', :'currency' => :'currency', :'sale_price' => :'salePrice', :'sale_price_start_date' => :'salePriceStartDate', :'sale_price_end_date' => :'salePriceEndDate', :'availability' => :'availability', :'condition' => :'condition', :'brand' => :'brand', :'category' => :'category', :'google_product_category' => :'googleProductCategory', :'product_type' => :'productType', :'gtin' => :'gtin', :'mpn' => :'mpn', :'inventory' => :'inventory', :'visibility' => :'visibility', :'color' => :'color', :'size' => :'size', :'gender' => :'gender', :'material' => :'material', :'pattern' => :'pattern', :'custom_label0' => :'customLabel0', :'custom_label1' => :'customLabel1', :'custom_label2' => :'customLabel2', :'custom_label3' => :'customLabel3', :'custom_label4' => :'customLabel4' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 838 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_nullable ⇒ Object
List of attributes with nullable: true
194 195 196 197 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 194 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 157 def self.openapi_types { :'retailer_id' => :'String', :'name' => :'String', :'description' => :'String', :'url' => :'String', :'image_url' => :'String', :'additional_image_urls' => :'Array<String>', :'price' => :'Float', :'currency' => :'String', :'sale_price' => :'Float', :'sale_price_start_date' => :'String', :'sale_price_end_date' => :'String', :'availability' => :'String', :'condition' => :'String', :'brand' => :'String', :'category' => :'String', :'google_product_category' => :'String', :'product_type' => :'String', :'gtin' => :'String', :'mpn' => :'String', :'inventory' => :'Integer', :'visibility' => :'String', :'color' => :'String', :'size' => :'String', :'gender' => :'String', :'material' => :'String', :'pattern' => :'String', :'custom_label0' => :'String', :'custom_label1' => :'String', :'custom_label2' => :'String', :'custom_label3' => :'String', :'custom_label4' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 787 def ==(o) return true if self.equal?(o) self.class == o.class && retailer_id == o.retailer_id && name == o.name && description == o.description && url == o.url && image_url == o.image_url && additional_image_urls == o.additional_image_urls && price == o.price && currency == o.currency && sale_price == o.sale_price && sale_price_start_date == o.sale_price_start_date && sale_price_end_date == o.sale_price_end_date && availability == o.availability && condition == o.condition && brand == o.brand && category == o.category && google_product_category == o.google_product_category && product_type == o.product_type && gtin == o.gtin && mpn == o.mpn && inventory == o.inventory && visibility == o.visibility && color == o.color && size == o.size && gender == o.gender && material == o.material && pattern == o.pattern && custom_label0 == o.custom_label0 && custom_label1 == o.custom_label1 && custom_label2 == o.custom_label2 && custom_label3 == o.custom_label3 && custom_label4 == o.custom_label4 end |
#eql?(o) ⇒ Boolean
825 826 827 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 825 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
831 832 833 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 831 def hash [retailer_id, name, description, url, image_url, additional_image_urls, price, currency, sale_price, sale_price_start_date, sale_price_end_date, availability, condition, brand, category, google_product_category, product_type, gtin, mpn, inventory, visibility, color, size, gender, material, pattern, custom_label0, custom_label1, custom_label2, custom_label3, custom_label4].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 425 426 427 428 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 344 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if !@retailer_id.nil? && @retailer_id.to_s.length > 100 invalid_properties.push('invalid value for "retailer_id", the character length must be smaller than or equal to 100.') end if !@name.nil? && @name.to_s.length > 200 invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 200.') end if !@description.nil? && @description.to_s.length > 9999 invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 9999.') end if !@additional_image_urls.nil? && @additional_image_urls.length > 20 invalid_properties.push('invalid value for "additional_image_urls", number of items must be less than or equal to 20.') end if !@brand.nil? && @brand.to_s.length > 100 invalid_properties.push('invalid value for "brand", the character length must be smaller than or equal to 100.') end if !@category.nil? && @category.to_s.length > 250 invalid_properties.push('invalid value for "category", the character length must be smaller than or equal to 250.') end if !@google_product_category.nil? && @google_product_category.to_s.length > 250 invalid_properties.push('invalid value for "google_product_category", the character length must be smaller than or equal to 250.') end if !@product_type.nil? && @product_type.to_s.length > 750 invalid_properties.push('invalid value for "product_type", the character length must be smaller than or equal to 750.') end if !@gtin.nil? && @gtin.to_s.length > 50 invalid_properties.push('invalid value for "gtin", the character length must be smaller than or equal to 50.') end if !@mpn.nil? && @mpn.to_s.length > 100 invalid_properties.push('invalid value for "mpn", the character length must be smaller than or equal to 100.') end if !@inventory.nil? && @inventory < 0 invalid_properties.push('invalid value for "inventory", must be greater than or equal to 0.') end if !@color.nil? && @color.to_s.length > 200 invalid_properties.push('invalid value for "color", the character length must be smaller than or equal to 200.') end if !@size.nil? && @size.to_s.length > 200 invalid_properties.push('invalid value for "size", the character length must be smaller than or equal to 200.') end if !@material.nil? && @material.to_s.length > 200 invalid_properties.push('invalid value for "material", the character length must be smaller than or equal to 200.') end if !@pattern.nil? && @pattern.to_s.length > 100 invalid_properties.push('invalid value for "pattern", the character length must be smaller than or equal to 100.') end if !@custom_label0.nil? && @custom_label0.to_s.length > 100 invalid_properties.push('invalid value for "custom_label0", the character length must be smaller than or equal to 100.') end if !@custom_label1.nil? && @custom_label1.to_s.length > 100 invalid_properties.push('invalid value for "custom_label1", the character length must be smaller than or equal to 100.') end if !@custom_label2.nil? && @custom_label2.to_s.length > 100 invalid_properties.push('invalid value for "custom_label2", the character length must be smaller than or equal to 100.') end if !@custom_label3.nil? && @custom_label3.to_s.length > 100 invalid_properties.push('invalid value for "custom_label3", the character length must be smaller than or equal to 100.') end if !@custom_label4.nil? && @custom_label4.to_s.length > 100 invalid_properties.push('invalid value for "custom_label4", the character length must be smaller than or equal to 100.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
860 861 862 863 864 865 866 867 868 869 870 871 872 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 860 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
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 |
# File 'lib/zernio-sdk/models/meta_catalog_product_input.rb', line 432 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if !@retailer_id.nil? && @retailer_id.to_s.length > 100 return false if !@name.nil? && @name.to_s.length > 200 return false if !@description.nil? && @description.to_s.length > 9999 return false if !@additional_image_urls.nil? && @additional_image_urls.length > 20 availability_validator = EnumAttributeValidator.new('String', ["in stock", "out of stock", "preorder", "available for order", "discontinued", "pending"]) return false unless availability_validator.valid?(@availability) condition_validator = EnumAttributeValidator.new('String', ["new", "refurbished", "used"]) return false unless condition_validator.valid?(@condition) return false if !@brand.nil? && @brand.to_s.length > 100 return false if !@category.nil? && @category.to_s.length > 250 return false if !@google_product_category.nil? && @google_product_category.to_s.length > 250 return false if !@product_type.nil? && @product_type.to_s.length > 750 return false if !@gtin.nil? && @gtin.to_s.length > 50 return false if !@mpn.nil? && @mpn.to_s.length > 100 return false if !@inventory.nil? && @inventory < 0 visibility_validator = EnumAttributeValidator.new('String', ["published", "staging"]) return false unless visibility_validator.valid?(@visibility) return false if !@color.nil? && @color.to_s.length > 200 return false if !@size.nil? && @size.to_s.length > 200 gender_validator = EnumAttributeValidator.new('String', ["female", "male", "unisex"]) return false unless gender_validator.valid?(@gender) return false if !@material.nil? && @material.to_s.length > 200 return false if !@pattern.nil? && @pattern.to_s.length > 100 return false if !@custom_label0.nil? && @custom_label0.to_s.length > 100 return false if !@custom_label1.nil? && @custom_label1.to_s.length > 100 return false if !@custom_label2.nil? && @custom_label2.to_s.length > 100 return false if !@custom_label3.nil? && @custom_label3.to_s.length > 100 return false if !@custom_label4.nil? && @custom_label4.to_s.length > 100 true end |