=begin #UltraCart Rest API V2 #UltraCart REST API Version 2 OpenAPI spec version: 2.0.0 Contact: support@ultracart.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.15-SNAPSHOT =end require 'date' module UltracartClient class ItemGoogleProductSearch # Adwords grouping attr_accessor :adwords_grouping # Adwords label 1 attr_accessor :adwords_label1 # Adwords label 2 attr_accessor :adwords_label2 # Adwords label 3 attr_accessor :adwords_label3 # Adwords label 4 attr_accessor :adwords_label4 # Adwords label 5 attr_accessor :adwords_label5 # Age group attr_accessor :age_group # Available at physical store attr_accessor :available_at_physical_store # Book - author attr_accessor :book_author # Book - format attr_accessor :book_format # Bood - ISBN attr_accessor :book_isbn # Book - publisher attr_accessor :book_publisher # Category description attr_accessor :category_description # Color attr_accessor :color # Condition attr_accessor :condition # Custom label 0 attr_accessor :custom_label0 # Custom label 1 attr_accessor :custom_label1 # Custom label 2 attr_accessor :custom_label2 # Custom label 3 attr_accessor :custom_label3 # Custom label 4 attr_accessor :custom_label4 # Gender attr_accessor :gender # Google product category attr_accessor :google_product_category # Music - artist attr_accessor :music_artist # Music - format attr_accessor :music_format # Music - release date attr_accessor :music_release_date # Omit from feed attr_accessor :omit_from_feed # Product type attr_accessor :product_type # Promotion ID 1 attr_accessor :promotion_id1 # Promotion ID 10 attr_accessor :promotion_id10 # Promotion ID 2 attr_accessor :promotion_id2 # Promotion ID 3 attr_accessor :promotion_id3 # Promotion ID 4 attr_accessor :promotion_id4 # Promotion ID 5 attr_accessor :promotion_id5 # Promotion ID 6 attr_accessor :promotion_id6 # Promotion ID 7 attr_accessor :promotion_id7 # Promotion ID 8 attr_accessor :promotion_id8 # Promotion ID 9 attr_accessor :promotion_id9 # Search date/time attr_accessor :search_dts # Search lowest price attr_accessor :search_lowest_price # Search lowest URL attr_accessor :search_lowest_url # Search position attr_accessor :search_position attr_accessor :shipping_label # Size attr_accessor :size # Video - director attr_accessor :video_director # Video - format attr_accessor :video_format # Video - rating attr_accessor :video_rating # Video - release date attr_accessor :video_release_date # Video - starring attr_accessor :video_starring # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'adwords_grouping' => :'adwords_grouping', :'adwords_label1' => :'adwords_label1', :'adwords_label2' => :'adwords_label2', :'adwords_label3' => :'adwords_label3', :'adwords_label4' => :'adwords_label4', :'adwords_label5' => :'adwords_label5', :'age_group' => :'age_group', :'available_at_physical_store' => :'available_at_physical_store', :'book_author' => :'book_author', :'book_format' => :'book_format', :'book_isbn' => :'book_isbn', :'book_publisher' => :'book_publisher', :'category_description' => :'category_description', :'color' => :'color', :'condition' => :'condition', :'custom_label0' => :'custom_label0', :'custom_label1' => :'custom_label1', :'custom_label2' => :'custom_label2', :'custom_label3' => :'custom_label3', :'custom_label4' => :'custom_label4', :'gender' => :'gender', :'google_product_category' => :'google_product_category', :'music_artist' => :'music_artist', :'music_format' => :'music_format', :'music_release_date' => :'music_release_date', :'omit_from_feed' => :'omit_from_feed', :'product_type' => :'product_type', :'promotion_id1' => :'promotion_id1', :'promotion_id10' => :'promotion_id10', :'promotion_id2' => :'promotion_id2', :'promotion_id3' => :'promotion_id3', :'promotion_id4' => :'promotion_id4', :'promotion_id5' => :'promotion_id5', :'promotion_id6' => :'promotion_id6', :'promotion_id7' => :'promotion_id7', :'promotion_id8' => :'promotion_id8', :'promotion_id9' => :'promotion_id9', :'search_dts' => :'search_dts', :'search_lowest_price' => :'search_lowest_price', :'search_lowest_url' => :'search_lowest_url', :'search_position' => :'search_position', :'shipping_label' => :'shippingLabel', :'size' => :'size', :'video_director' => :'video_director', :'video_format' => :'video_format', :'video_rating' => :'video_rating', :'video_release_date' => :'video_release_date', :'video_starring' => :'video_starring' } end # Attribute type mapping. def self.swagger_types { :'adwords_grouping' => :'String', :'adwords_label1' => :'String', :'adwords_label2' => :'String', :'adwords_label3' => :'String', :'adwords_label4' => :'String', :'adwords_label5' => :'String', :'age_group' => :'String', :'available_at_physical_store' => :'BOOLEAN', :'book_author' => :'String', :'book_format' => :'String', :'book_isbn' => :'String', :'book_publisher' => :'String', :'category_description' => :'String', :'color' => :'String', :'condition' => :'String', :'custom_label0' => :'String', :'custom_label1' => :'String', :'custom_label2' => :'String', :'custom_label3' => :'String', :'custom_label4' => :'String', :'gender' => :'String', :'google_product_category' => :'String', :'music_artist' => :'String', :'music_format' => :'String', :'music_release_date' => :'String', :'omit_from_feed' => :'BOOLEAN', :'product_type' => :'String', :'promotion_id1' => :'String', :'promotion_id10' => :'String', :'promotion_id2' => :'String', :'promotion_id3' => :'String', :'promotion_id4' => :'String', :'promotion_id5' => :'String', :'promotion_id6' => :'String', :'promotion_id7' => :'String', :'promotion_id8' => :'String', :'promotion_id9' => :'String', :'search_dts' => :'String', :'search_lowest_price' => :'Float', :'search_lowest_url' => :'String', :'search_position' => :'Integer', :'shipping_label' => :'String', :'size' => :'String', :'video_director' => :'String', :'video_format' => :'String', :'video_rating' => :'String', :'video_release_date' => :'String', :'video_starring' => :'String' } end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'adwords_grouping') self.adwords_grouping = attributes[:'adwords_grouping'] end if attributes.has_key?(:'adwords_label1') self.adwords_label1 = attributes[:'adwords_label1'] end if attributes.has_key?(:'adwords_label2') self.adwords_label2 = attributes[:'adwords_label2'] end if attributes.has_key?(:'adwords_label3') self.adwords_label3 = attributes[:'adwords_label3'] end if attributes.has_key?(:'adwords_label4') self.adwords_label4 = attributes[:'adwords_label4'] end if attributes.has_key?(:'adwords_label5') self.adwords_label5 = attributes[:'adwords_label5'] end if attributes.has_key?(:'age_group') self.age_group = attributes[:'age_group'] end if attributes.has_key?(:'available_at_physical_store') self.available_at_physical_store = attributes[:'available_at_physical_store'] end if attributes.has_key?(:'book_author') self.book_author = attributes[:'book_author'] end if attributes.has_key?(:'book_format') self.book_format = attributes[:'book_format'] end if attributes.has_key?(:'book_isbn') self.book_isbn = attributes[:'book_isbn'] end if attributes.has_key?(:'book_publisher') self.book_publisher = attributes[:'book_publisher'] end if attributes.has_key?(:'category_description') self.category_description = attributes[:'category_description'] end if attributes.has_key?(:'color') self.color = attributes[:'color'] end if attributes.has_key?(:'condition') self.condition = attributes[:'condition'] end if attributes.has_key?(:'custom_label0') self.custom_label0 = attributes[:'custom_label0'] end if attributes.has_key?(:'custom_label1') self.custom_label1 = attributes[:'custom_label1'] end if attributes.has_key?(:'custom_label2') self.custom_label2 = attributes[:'custom_label2'] end if attributes.has_key?(:'custom_label3') self.custom_label3 = attributes[:'custom_label3'] end if attributes.has_key?(:'custom_label4') self.custom_label4 = attributes[:'custom_label4'] end if attributes.has_key?(:'gender') self.gender = attributes[:'gender'] end if attributes.has_key?(:'google_product_category') self.google_product_category = attributes[:'google_product_category'] end if attributes.has_key?(:'music_artist') self.music_artist = attributes[:'music_artist'] end if attributes.has_key?(:'music_format') self.music_format = attributes[:'music_format'] end if attributes.has_key?(:'music_release_date') self.music_release_date = attributes[:'music_release_date'] end if attributes.has_key?(:'omit_from_feed') self.omit_from_feed = attributes[:'omit_from_feed'] end if attributes.has_key?(:'product_type') self.product_type = attributes[:'product_type'] end if attributes.has_key?(:'promotion_id1') self.promotion_id1 = attributes[:'promotion_id1'] end if attributes.has_key?(:'promotion_id10') self.promotion_id10 = attributes[:'promotion_id10'] end if attributes.has_key?(:'promotion_id2') self.promotion_id2 = attributes[:'promotion_id2'] end if attributes.has_key?(:'promotion_id3') self.promotion_id3 = attributes[:'promotion_id3'] end if attributes.has_key?(:'promotion_id4') self.promotion_id4 = attributes[:'promotion_id4'] end if attributes.has_key?(:'promotion_id5') self.promotion_id5 = attributes[:'promotion_id5'] end if attributes.has_key?(:'promotion_id6') self.promotion_id6 = attributes[:'promotion_id6'] end if attributes.has_key?(:'promotion_id7') self.promotion_id7 = attributes[:'promotion_id7'] end if attributes.has_key?(:'promotion_id8') self.promotion_id8 = attributes[:'promotion_id8'] end if attributes.has_key?(:'promotion_id9') self.promotion_id9 = attributes[:'promotion_id9'] end if attributes.has_key?(:'search_dts') self.search_dts = attributes[:'search_dts'] end if attributes.has_key?(:'search_lowest_price') self.search_lowest_price = attributes[:'search_lowest_price'] end if attributes.has_key?(:'search_lowest_url') self.search_lowest_url = attributes[:'search_lowest_url'] end if attributes.has_key?(:'search_position') self.search_position = attributes[:'search_position'] end if attributes.has_key?(:'shippingLabel') self.shipping_label = attributes[:'shippingLabel'] end if attributes.has_key?(:'size') self.size = attributes[:'size'] end if attributes.has_key?(:'video_director') self.video_director = attributes[:'video_director'] end if attributes.has_key?(:'video_format') self.video_format = attributes[:'video_format'] end if attributes.has_key?(:'video_rating') self.video_rating = attributes[:'video_rating'] end if attributes.has_key?(:'video_release_date') self.video_release_date = attributes[:'video_release_date'] end if attributes.has_key?(:'video_starring') self.video_starring = attributes[:'video_starring'] end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new if !@adwords_grouping.nil? && @adwords_grouping.to_s.length > 50 invalid_properties.push('invalid value for "adwords_grouping", the character length must be smaller than or equal to 50.') end if !@adwords_label1.nil? && @adwords_label1.to_s.length > 50 invalid_properties.push('invalid value for "adwords_label1", the character length must be smaller than or equal to 50.') end if !@adwords_label2.nil? && @adwords_label2.to_s.length > 50 invalid_properties.push('invalid value for "adwords_label2", the character length must be smaller than or equal to 50.') end if !@adwords_label3.nil? && @adwords_label3.to_s.length > 50 invalid_properties.push('invalid value for "adwords_label3", the character length must be smaller than or equal to 50.') end if !@adwords_label4.nil? && @adwords_label4.to_s.length > 50 invalid_properties.push('invalid value for "adwords_label4", the character length must be smaller than or equal to 50.') end if !@adwords_label5.nil? && @adwords_label5.to_s.length > 50 invalid_properties.push('invalid value for "adwords_label5", the character length must be smaller than or equal to 50.') end if !@age_group.nil? && @age_group.to_s.length > 5 invalid_properties.push('invalid value for "age_group", the character length must be smaller than or equal to 5.') end if !@book_author.nil? && @book_author.to_s.length > 50 invalid_properties.push('invalid value for "book_author", the character length must be smaller than or equal to 50.') end if !@book_format.nil? && @book_format.to_s.length > 50 invalid_properties.push('invalid value for "book_format", the character length must be smaller than or equal to 50.') end if !@book_isbn.nil? && @book_isbn.to_s.length > 20 invalid_properties.push('invalid value for "book_isbn", the character length must be smaller than or equal to 20.') end if !@book_publisher.nil? && @book_publisher.to_s.length > 50 invalid_properties.push('invalid value for "book_publisher", the character length must be smaller than or equal to 50.') end if !@category_description.nil? && @category_description.to_s.length > 1000 invalid_properties.push('invalid value for "category_description", the character length must be smaller than or equal to 1000.') end if !@color.nil? && @color.to_s.length > 100 invalid_properties.push('invalid value for "color", the character length must be smaller than or equal to 100.') end if !@condition.nil? && @condition.to_s.length > 15 invalid_properties.push('invalid value for "condition", the character length must be smaller than or equal to 15.') end if !@custom_label0.nil? && @custom_label0.to_s.length > 50 invalid_properties.push('invalid value for "custom_label0", the character length must be smaller than or equal to 50.') end if !@custom_label1.nil? && @custom_label1.to_s.length > 50 invalid_properties.push('invalid value for "custom_label1", the character length must be smaller than or equal to 50.') end if !@custom_label2.nil? && @custom_label2.to_s.length > 50 invalid_properties.push('invalid value for "custom_label2", the character length must be smaller than or equal to 50.') end if !@custom_label3.nil? && @custom_label3.to_s.length > 50 invalid_properties.push('invalid value for "custom_label3", the character length must be smaller than or equal to 50.') end if !@custom_label4.nil? && @custom_label4.to_s.length > 50 invalid_properties.push('invalid value for "custom_label4", the character length must be smaller than or equal to 50.') end if !@gender.nil? && @gender.to_s.length > 6 invalid_properties.push('invalid value for "gender", the character length must be smaller than or equal to 6.') 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 !@music_artist.nil? && @music_artist.to_s.length > 50 invalid_properties.push('invalid value for "music_artist", the character length must be smaller than or equal to 50.') end if !@music_format.nil? && @music_format.to_s.length > 5 invalid_properties.push('invalid value for "music_format", the character length must be smaller than or equal to 5.') end if !@product_type.nil? && @product_type.to_s.length > 10 invalid_properties.push('invalid value for "product_type", the character length must be smaller than or equal to 10.') end if !@promotion_id1.nil? && @promotion_id1.to_s.length > 30 invalid_properties.push('invalid value for "promotion_id1", the character length must be smaller than or equal to 30.') end if !@promotion_id10.nil? && @promotion_id10.to_s.length > 30 invalid_properties.push('invalid value for "promotion_id10", the character length must be smaller than or equal to 30.') end if !@promotion_id2.nil? && @promotion_id2.to_s.length > 30 invalid_properties.push('invalid value for "promotion_id2", the character length must be smaller than or equal to 30.') end if !@promotion_id3.nil? && @promotion_id3.to_s.length > 30 invalid_properties.push('invalid value for "promotion_id3", the character length must be smaller than or equal to 30.') end if !@promotion_id4.nil? && @promotion_id4.to_s.length > 30 invalid_properties.push('invalid value for "promotion_id4", the character length must be smaller than or equal to 30.') end if !@promotion_id5.nil? && @promotion_id5.to_s.length > 30 invalid_properties.push('invalid value for "promotion_id5", the character length must be smaller than or equal to 30.') end if !@promotion_id6.nil? && @promotion_id6.to_s.length > 30 invalid_properties.push('invalid value for "promotion_id6", the character length must be smaller than or equal to 30.') end if !@promotion_id7.nil? && @promotion_id7.to_s.length > 30 invalid_properties.push('invalid value for "promotion_id7", the character length must be smaller than or equal to 30.') end if !@promotion_id8.nil? && @promotion_id8.to_s.length > 30 invalid_properties.push('invalid value for "promotion_id8", the character length must be smaller than or equal to 30.') end if !@promotion_id9.nil? && @promotion_id9.to_s.length > 30 invalid_properties.push('invalid value for "promotion_id9", the character length must be smaller than or equal to 30.') end if !@search_lowest_url.nil? && @search_lowest_url.to_s.length > 250 invalid_properties.push('invalid value for "search_lowest_url", the character length must be smaller than or equal to 250.') end if !@size.nil? && @size.to_s.length > 20 invalid_properties.push('invalid value for "size", the character length must be smaller than or equal to 20.') end if !@video_director.nil? && @video_director.to_s.length > 50 invalid_properties.push('invalid value for "video_director", the character length must be smaller than or equal to 50.') end if !@video_format.nil? && @video_format.to_s.length > 5 invalid_properties.push('invalid value for "video_format", the character length must be smaller than or equal to 5.') end if !@video_rating.nil? && @video_rating.to_s.length > 5 invalid_properties.push('invalid value for "video_rating", the character length must be smaller than or equal to 5.') end if !@video_starring.nil? && @video_starring.to_s.length > 150 invalid_properties.push('invalid value for "video_starring", the character length must be smaller than or equal to 150.') end invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? return false if !@adwords_grouping.nil? && @adwords_grouping.to_s.length > 50 return false if !@adwords_label1.nil? && @adwords_label1.to_s.length > 50 return false if !@adwords_label2.nil? && @adwords_label2.to_s.length > 50 return false if !@adwords_label3.nil? && @adwords_label3.to_s.length > 50 return false if !@adwords_label4.nil? && @adwords_label4.to_s.length > 50 return false if !@adwords_label5.nil? && @adwords_label5.to_s.length > 50 return false if !@age_group.nil? && @age_group.to_s.length > 5 return false if !@book_author.nil? && @book_author.to_s.length > 50 return false if !@book_format.nil? && @book_format.to_s.length > 50 return false if !@book_isbn.nil? && @book_isbn.to_s.length > 20 return false if !@book_publisher.nil? && @book_publisher.to_s.length > 50 return false if !@category_description.nil? && @category_description.to_s.length > 1000 return false if !@color.nil? && @color.to_s.length > 100 return false if !@condition.nil? && @condition.to_s.length > 15 return false if !@custom_label0.nil? && @custom_label0.to_s.length > 50 return false if !@custom_label1.nil? && @custom_label1.to_s.length > 50 return false if !@custom_label2.nil? && @custom_label2.to_s.length > 50 return false if !@custom_label3.nil? && @custom_label3.to_s.length > 50 return false if !@custom_label4.nil? && @custom_label4.to_s.length > 50 return false if !@gender.nil? && @gender.to_s.length > 6 return false if !@google_product_category.nil? && @google_product_category.to_s.length > 250 return false if !@music_artist.nil? && @music_artist.to_s.length > 50 return false if !@music_format.nil? && @music_format.to_s.length > 5 return false if !@product_type.nil? && @product_type.to_s.length > 10 return false if !@promotion_id1.nil? && @promotion_id1.to_s.length > 30 return false if !@promotion_id10.nil? && @promotion_id10.to_s.length > 30 return false if !@promotion_id2.nil? && @promotion_id2.to_s.length > 30 return false if !@promotion_id3.nil? && @promotion_id3.to_s.length > 30 return false if !@promotion_id4.nil? && @promotion_id4.to_s.length > 30 return false if !@promotion_id5.nil? && @promotion_id5.to_s.length > 30 return false if !@promotion_id6.nil? && @promotion_id6.to_s.length > 30 return false if !@promotion_id7.nil? && @promotion_id7.to_s.length > 30 return false if !@promotion_id8.nil? && @promotion_id8.to_s.length > 30 return false if !@promotion_id9.nil? && @promotion_id9.to_s.length > 30 return false if !@search_lowest_url.nil? && @search_lowest_url.to_s.length > 250 return false if !@size.nil? && @size.to_s.length > 20 return false if !@video_director.nil? && @video_director.to_s.length > 50 return false if !@video_format.nil? && @video_format.to_s.length > 5 return false if !@video_rating.nil? && @video_rating.to_s.length > 5 return false if !@video_starring.nil? && @video_starring.to_s.length > 150 true end # Custom attribute writer method with validation # @param [Object] adwords_grouping Value to be assigned def adwords_grouping=(adwords_grouping) if !adwords_grouping.nil? && adwords_grouping.to_s.length > 50 fail ArgumentError, 'invalid value for "adwords_grouping", the character length must be smaller than or equal to 50.' end @adwords_grouping = adwords_grouping end # Custom attribute writer method with validation # @param [Object] adwords_label1 Value to be assigned def adwords_label1=(adwords_label1) if !adwords_label1.nil? && adwords_label1.to_s.length > 50 fail ArgumentError, 'invalid value for "adwords_label1", the character length must be smaller than or equal to 50.' end @adwords_label1 = adwords_label1 end # Custom attribute writer method with validation # @param [Object] adwords_label2 Value to be assigned def adwords_label2=(adwords_label2) if !adwords_label2.nil? && adwords_label2.to_s.length > 50 fail ArgumentError, 'invalid value for "adwords_label2", the character length must be smaller than or equal to 50.' end @adwords_label2 = adwords_label2 end # Custom attribute writer method with validation # @param [Object] adwords_label3 Value to be assigned def adwords_label3=(adwords_label3) if !adwords_label3.nil? && adwords_label3.to_s.length > 50 fail ArgumentError, 'invalid value for "adwords_label3", the character length must be smaller than or equal to 50.' end @adwords_label3 = adwords_label3 end # Custom attribute writer method with validation # @param [Object] adwords_label4 Value to be assigned def adwords_label4=(adwords_label4) if !adwords_label4.nil? && adwords_label4.to_s.length > 50 fail ArgumentError, 'invalid value for "adwords_label4", the character length must be smaller than or equal to 50.' end @adwords_label4 = adwords_label4 end # Custom attribute writer method with validation # @param [Object] adwords_label5 Value to be assigned def adwords_label5=(adwords_label5) if !adwords_label5.nil? && adwords_label5.to_s.length > 50 fail ArgumentError, 'invalid value for "adwords_label5", the character length must be smaller than or equal to 50.' end @adwords_label5 = adwords_label5 end # Custom attribute writer method with validation # @param [Object] age_group Value to be assigned def age_group=(age_group) if !age_group.nil? && age_group.to_s.length > 5 fail ArgumentError, 'invalid value for "age_group", the character length must be smaller than or equal to 5.' end @age_group = age_group end # Custom attribute writer method with validation # @param [Object] book_author Value to be assigned def book_author=(book_author) if !book_author.nil? && book_author.to_s.length > 50 fail ArgumentError, 'invalid value for "book_author", the character length must be smaller than or equal to 50.' end @book_author = book_author end # Custom attribute writer method with validation # @param [Object] book_format Value to be assigned def book_format=(book_format) if !book_format.nil? && book_format.to_s.length > 50 fail ArgumentError, 'invalid value for "book_format", the character length must be smaller than or equal to 50.' end @book_format = book_format end # Custom attribute writer method with validation # @param [Object] book_isbn Value to be assigned def book_isbn=(book_isbn) if !book_isbn.nil? && book_isbn.to_s.length > 20 fail ArgumentError, 'invalid value for "book_isbn", the character length must be smaller than or equal to 20.' end @book_isbn = book_isbn end # Custom attribute writer method with validation # @param [Object] book_publisher Value to be assigned def book_publisher=(book_publisher) if !book_publisher.nil? && book_publisher.to_s.length > 50 fail ArgumentError, 'invalid value for "book_publisher", the character length must be smaller than or equal to 50.' end @book_publisher = book_publisher end # Custom attribute writer method with validation # @param [Object] category_description Value to be assigned def category_description=(category_description) if !category_description.nil? && category_description.to_s.length > 1000 fail ArgumentError, 'invalid value for "category_description", the character length must be smaller than or equal to 1000.' end @category_description = category_description end # Custom attribute writer method with validation # @param [Object] color Value to be assigned def color=(color) if !color.nil? && color.to_s.length > 100 fail ArgumentError, 'invalid value for "color", the character length must be smaller than or equal to 100.' end @color = color end # Custom attribute writer method with validation # @param [Object] condition Value to be assigned def condition=(condition) if !condition.nil? && condition.to_s.length > 15 fail ArgumentError, 'invalid value for "condition", the character length must be smaller than or equal to 15.' end @condition = condition end # Custom attribute writer method with validation # @param [Object] custom_label0 Value to be assigned def custom_label0=(custom_label0) if !custom_label0.nil? && custom_label0.to_s.length > 50 fail ArgumentError, 'invalid value for "custom_label0", the character length must be smaller than or equal to 50.' end @custom_label0 = custom_label0 end # Custom attribute writer method with validation # @param [Object] custom_label1 Value to be assigned def custom_label1=(custom_label1) if !custom_label1.nil? && custom_label1.to_s.length > 50 fail ArgumentError, 'invalid value for "custom_label1", the character length must be smaller than or equal to 50.' end @custom_label1 = custom_label1 end # Custom attribute writer method with validation # @param [Object] custom_label2 Value to be assigned def custom_label2=(custom_label2) if !custom_label2.nil? && custom_label2.to_s.length > 50 fail ArgumentError, 'invalid value for "custom_label2", the character length must be smaller than or equal to 50.' end @custom_label2 = custom_label2 end # Custom attribute writer method with validation # @param [Object] custom_label3 Value to be assigned def custom_label3=(custom_label3) if !custom_label3.nil? && custom_label3.to_s.length > 50 fail ArgumentError, 'invalid value for "custom_label3", the character length must be smaller than or equal to 50.' end @custom_label3 = custom_label3 end # Custom attribute writer method with validation # @param [Object] custom_label4 Value to be assigned def custom_label4=(custom_label4) if !custom_label4.nil? && custom_label4.to_s.length > 50 fail ArgumentError, 'invalid value for "custom_label4", the character length must be smaller than or equal to 50.' end @custom_label4 = custom_label4 end # Custom attribute writer method with validation # @param [Object] gender Value to be assigned def gender=(gender) if !gender.nil? && gender.to_s.length > 6 fail ArgumentError, 'invalid value for "gender", the character length must be smaller than or equal to 6.' end @gender = gender end # Custom attribute writer method with validation # @param [Object] google_product_category Value to be assigned def google_product_category=(google_product_category) if !google_product_category.nil? && google_product_category.to_s.length > 250 fail ArgumentError, 'invalid value for "google_product_category", the character length must be smaller than or equal to 250.' end @google_product_category = google_product_category end # Custom attribute writer method with validation # @param [Object] music_artist Value to be assigned def music_artist=(music_artist) if !music_artist.nil? && music_artist.to_s.length > 50 fail ArgumentError, 'invalid value for "music_artist", the character length must be smaller than or equal to 50.' end @music_artist = music_artist end # Custom attribute writer method with validation # @param [Object] music_format Value to be assigned def music_format=(music_format) if !music_format.nil? && music_format.to_s.length > 5 fail ArgumentError, 'invalid value for "music_format", the character length must be smaller than or equal to 5.' end @music_format = music_format end # Custom attribute writer method with validation # @param [Object] product_type Value to be assigned def product_type=(product_type) if !product_type.nil? && product_type.to_s.length > 10 fail ArgumentError, 'invalid value for "product_type", the character length must be smaller than or equal to 10.' end @product_type = product_type end # Custom attribute writer method with validation # @param [Object] promotion_id1 Value to be assigned def promotion_id1=(promotion_id1) if !promotion_id1.nil? && promotion_id1.to_s.length > 30 fail ArgumentError, 'invalid value for "promotion_id1", the character length must be smaller than or equal to 30.' end @promotion_id1 = promotion_id1 end # Custom attribute writer method with validation # @param [Object] promotion_id10 Value to be assigned def promotion_id10=(promotion_id10) if !promotion_id10.nil? && promotion_id10.to_s.length > 30 fail ArgumentError, 'invalid value for "promotion_id10", the character length must be smaller than or equal to 30.' end @promotion_id10 = promotion_id10 end # Custom attribute writer method with validation # @param [Object] promotion_id2 Value to be assigned def promotion_id2=(promotion_id2) if !promotion_id2.nil? && promotion_id2.to_s.length > 30 fail ArgumentError, 'invalid value for "promotion_id2", the character length must be smaller than or equal to 30.' end @promotion_id2 = promotion_id2 end # Custom attribute writer method with validation # @param [Object] promotion_id3 Value to be assigned def promotion_id3=(promotion_id3) if !promotion_id3.nil? && promotion_id3.to_s.length > 30 fail ArgumentError, 'invalid value for "promotion_id3", the character length must be smaller than or equal to 30.' end @promotion_id3 = promotion_id3 end # Custom attribute writer method with validation # @param [Object] promotion_id4 Value to be assigned def promotion_id4=(promotion_id4) if !promotion_id4.nil? && promotion_id4.to_s.length > 30 fail ArgumentError, 'invalid value for "promotion_id4", the character length must be smaller than or equal to 30.' end @promotion_id4 = promotion_id4 end # Custom attribute writer method with validation # @param [Object] promotion_id5 Value to be assigned def promotion_id5=(promotion_id5) if !promotion_id5.nil? && promotion_id5.to_s.length > 30 fail ArgumentError, 'invalid value for "promotion_id5", the character length must be smaller than or equal to 30.' end @promotion_id5 = promotion_id5 end # Custom attribute writer method with validation # @param [Object] promotion_id6 Value to be assigned def promotion_id6=(promotion_id6) if !promotion_id6.nil? && promotion_id6.to_s.length > 30 fail ArgumentError, 'invalid value for "promotion_id6", the character length must be smaller than or equal to 30.' end @promotion_id6 = promotion_id6 end # Custom attribute writer method with validation # @param [Object] promotion_id7 Value to be assigned def promotion_id7=(promotion_id7) if !promotion_id7.nil? && promotion_id7.to_s.length > 30 fail ArgumentError, 'invalid value for "promotion_id7", the character length must be smaller than or equal to 30.' end @promotion_id7 = promotion_id7 end # Custom attribute writer method with validation # @param [Object] promotion_id8 Value to be assigned def promotion_id8=(promotion_id8) if !promotion_id8.nil? && promotion_id8.to_s.length > 30 fail ArgumentError, 'invalid value for "promotion_id8", the character length must be smaller than or equal to 30.' end @promotion_id8 = promotion_id8 end # Custom attribute writer method with validation # @param [Object] promotion_id9 Value to be assigned def promotion_id9=(promotion_id9) if !promotion_id9.nil? && promotion_id9.to_s.length > 30 fail ArgumentError, 'invalid value for "promotion_id9", the character length must be smaller than or equal to 30.' end @promotion_id9 = promotion_id9 end # Custom attribute writer method with validation # @param [Object] search_lowest_url Value to be assigned def search_lowest_url=(search_lowest_url) if !search_lowest_url.nil? && search_lowest_url.to_s.length > 250 fail ArgumentError, 'invalid value for "search_lowest_url", the character length must be smaller than or equal to 250.' end @search_lowest_url = search_lowest_url end # Custom attribute writer method with validation # @param [Object] size Value to be assigned def size=(size) if !size.nil? && size.to_s.length > 20 fail ArgumentError, 'invalid value for "size", the character length must be smaller than or equal to 20.' end @size = size end # Custom attribute writer method with validation # @param [Object] video_director Value to be assigned def video_director=(video_director) if !video_director.nil? && video_director.to_s.length > 50 fail ArgumentError, 'invalid value for "video_director", the character length must be smaller than or equal to 50.' end @video_director = video_director end # Custom attribute writer method with validation # @param [Object] video_format Value to be assigned def video_format=(video_format) if !video_format.nil? && video_format.to_s.length > 5 fail ArgumentError, 'invalid value for "video_format", the character length must be smaller than or equal to 5.' end @video_format = video_format end # Custom attribute writer method with validation # @param [Object] video_rating Value to be assigned def video_rating=(video_rating) if !video_rating.nil? && video_rating.to_s.length > 5 fail ArgumentError, 'invalid value for "video_rating", the character length must be smaller than or equal to 5.' end @video_rating = video_rating end # Custom attribute writer method with validation # @param [Object] video_starring Value to be assigned def video_starring=(video_starring) if !video_starring.nil? && video_starring.to_s.length > 150 fail ArgumentError, 'invalid value for "video_starring", the character length must be smaller than or equal to 150.' end @video_starring = video_starring end # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) return true if self.equal?(o) self.class == o.class && adwords_grouping == o.adwords_grouping && adwords_label1 == o.adwords_label1 && adwords_label2 == o.adwords_label2 && adwords_label3 == o.adwords_label3 && adwords_label4 == o.adwords_label4 && adwords_label5 == o.adwords_label5 && age_group == o.age_group && available_at_physical_store == o.available_at_physical_store && book_author == o.book_author && book_format == o.book_format && book_isbn == o.book_isbn && book_publisher == o.book_publisher && category_description == o.category_description && color == o.color && condition == o.condition && 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 && gender == o.gender && google_product_category == o.google_product_category && music_artist == o.music_artist && music_format == o.music_format && music_release_date == o.music_release_date && omit_from_feed == o.omit_from_feed && product_type == o.product_type && promotion_id1 == o.promotion_id1 && promotion_id10 == o.promotion_id10 && promotion_id2 == o.promotion_id2 && promotion_id3 == o.promotion_id3 && promotion_id4 == o.promotion_id4 && promotion_id5 == o.promotion_id5 && promotion_id6 == o.promotion_id6 && promotion_id7 == o.promotion_id7 && promotion_id8 == o.promotion_id8 && promotion_id9 == o.promotion_id9 && search_dts == o.search_dts && search_lowest_price == o.search_lowest_price && search_lowest_url == o.search_lowest_url && search_position == o.search_position && shipping_label == o.shipping_label && size == o.size && video_director == o.video_director && video_format == o.video_format && video_rating == o.video_rating && video_release_date == o.video_release_date && video_starring == o.video_starring end # @see the `==` method # @param [Object] Object to be compared def eql?(o) self == o end # Calculates hash code according to all attributes. # @return [Fixnum] Hash code def hash [adwords_grouping, adwords_label1, adwords_label2, adwords_label3, adwords_label4, adwords_label5, age_group, available_at_physical_store, book_author, book_format, book_isbn, book_publisher, category_description, color, condition, custom_label0, custom_label1, custom_label2, custom_label3, custom_label4, gender, google_product_category, music_artist, music_format, music_release_date, omit_from_feed, product_type, promotion_id1, promotion_id10, promotion_id2, promotion_id3, promotion_id4, promotion_id5, promotion_id6, promotion_id7, promotion_id8, promotion_id9, search_dts, search_lowest_price, search_lowest_url, search_position, shipping_label, size, video_director, video_format, video_rating, video_release_date, video_starring].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?.+?), (?.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = UltracartClient.const_get(type).new temp_model.build_from_hash(value) end end # Returns the string representation of the object # @return [String] String presentation of the object def to_s to_hash.to_s end # to_body is an alias to to_hash (backward compatibility) # @return [Hash] Returns the object in the form of hash def to_body to_hash end # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end # Outputs non-array value in the form of hash # For object, use to_hash. Otherwise, just return the value # @param [Object] value Any valid value # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end end end