Class: Zernio::CreateAdCatalogProductRequestProduct
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::CreateAdCatalogProductRequestProduct
- Defined in:
- lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb
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_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3).
-
.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 = {}) ⇒ CreateAdCatalogProductRequestProduct
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 = {}) ⇒ CreateAdCatalogProductRequestProduct
Initializes the object
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 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 207 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateAdCatalogProductRequestProduct` 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::CreateAdCatalogProductRequestProduct`. 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'] else self.retailer_id = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'url') self.url = attributes[:'url'] else self.url = nil end if attributes.key?(:'image_url') self.image_url = attributes[:'image_url'] else self.image_url = nil 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'] else self.price = nil end if attributes.key?(:'currency') self.currency = attributes[:'currency'] else self.currency = nil 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.
30 31 32 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 30 def additional_image_urls @additional_image_urls end |
#availability ⇒ Object
Returns the value of attribute availability.
46 47 48 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 46 def availability @availability end |
#brand ⇒ Object
Returns the value of attribute brand.
50 51 52 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 50 def brand @brand end |
#category ⇒ Object
Returns the value of attribute category.
52 53 54 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 52 def category @category end |
#color ⇒ Object
Returns the value of attribute color.
66 67 68 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 66 def color @color end |
#condition ⇒ Object
Returns the value of attribute condition.
48 49 50 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 48 def condition @condition end |
#currency ⇒ Object
ISO 4217, e.g. EUR
36 37 38 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 36 def currency @currency end |
#custom_label0 ⇒ Object
Returns the value of attribute custom_label0.
76 77 78 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 76 def custom_label0 @custom_label0 end |
#custom_label1 ⇒ Object
Returns the value of attribute custom_label1.
78 79 80 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 78 def custom_label1 @custom_label1 end |
#custom_label2 ⇒ Object
Returns the value of attribute custom_label2.
80 81 82 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 80 def custom_label2 @custom_label2 end |
#custom_label3 ⇒ Object
Returns the value of attribute custom_label3.
82 83 84 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 82 def custom_label3 @custom_label3 end |
#custom_label4 ⇒ Object
Returns the value of attribute custom_label4.
84 85 86 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 84 def custom_label4 @custom_label4 end |
#description ⇒ Object
Returns the value of attribute description.
23 24 25 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 23 def description @description end |
#gender ⇒ Object
Returns the value of attribute gender.
70 71 72 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 70 def gender @gender end |
#google_product_category ⇒ Object
Returns the value of attribute google_product_category.
54 55 56 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 54 def google_product_category @google_product_category end |
#gtin ⇒ Object
Returns the value of attribute gtin.
58 59 60 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 58 def gtin @gtin end |
#image_url ⇒ Object
Returns the value of attribute image_url.
28 29 30 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 28 def image_url @image_url end |
#inventory ⇒ Object
Returns the value of attribute inventory.
62 63 64 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 62 def inventory @inventory end |
#material ⇒ Object
Returns the value of attribute material.
72 73 74 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 72 def material @material end |
#mpn ⇒ Object
Returns the value of attribute mpn.
60 61 62 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 60 def mpn @mpn end |
#name ⇒ Object
Returns the value of attribute name.
21 22 23 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 21 def name @name end |
#pattern ⇒ Object
Returns the value of attribute pattern.
74 75 76 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 74 def pattern @pattern end |
#price ⇒ Object
Major units, e.g. 12.99
33 34 35 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 33 def price @price end |
#product_type ⇒ Object
Returns the value of attribute product_type.
56 57 58 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 56 def product_type @product_type end |
#retailer_id ⇒ Object
Your SKU; unique inside the catalog
19 20 21 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 19 def retailer_id @retailer_id end |
#sale_price ⇒ Object
Returns the value of attribute sale_price.
38 39 40 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 38 def sale_price @sale_price end |
#sale_price_end_date ⇒ Object
ISO 8601
44 45 46 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 44 def sale_price_end_date @sale_price_end_date end |
#sale_price_start_date ⇒ Object
ISO 8601
41 42 43 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 41 def sale_price_start_date @sale_price_start_date end |
#size ⇒ Object
Returns the value of attribute size.
68 69 70 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 68 def size @size end |
#url ⇒ Object
Product page
26 27 28 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 26 def url @url end |
#visibility ⇒ Object
Returns the value of attribute visibility.
64 65 66 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 64 def visibility @visibility end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
146 147 148 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 146 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
151 152 153 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 151 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 136 137 138 139 140 141 142 143 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 109 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
926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 926 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_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
199 200 201 202 203 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 199 def self.openapi_all_of [ :'MetaCatalogProductInput' ] end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
193 194 195 196 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 193 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 156 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.
875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 875 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
913 914 915 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 913 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
919 920 921 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 919 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?
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 429 430 431 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 464 465 466 467 468 469 470 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 362 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @retailer_id.nil? invalid_properties.push('invalid value for "retailer_id", retailer_id cannot be nil.') end if @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? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @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 @url.nil? invalid_properties.push('invalid value for "url", url cannot be nil.') end if @image_url.nil? invalid_properties.push('invalid value for "image_url", image_url cannot be nil.') 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 @price.nil? invalid_properties.push('invalid value for "price", price cannot be nil.') end if @currency.nil? invalid_properties.push('invalid value for "currency", currency cannot be nil.') 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
948 949 950 951 952 953 954 955 956 957 958 959 960 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 948 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
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
# File 'lib/zernio-sdk/models/create_ad_catalog_product_request_product.rb', line 474 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @retailer_id.nil? return false if @retailer_id.to_s.length > 100 return false if @name.nil? return false if @name.to_s.length > 200 return false if !@description.nil? && @description.to_s.length > 9999 return false if @url.nil? return false if @image_url.nil? return false if !@additional_image_urls.nil? && @additional_image_urls.length > 20 return false if @price.nil? return false if @currency.nil? 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 |