=begin #Pinterest REST API #Pinterest's REST API The version of the OpenAPI document: 5.3.0 Contact: blah@cliffano.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.4.0 =end require 'date' require 'time' module PinterestSdkClient class CatalogsFeedValidationWarnings attr_accessor :title_length_too_long attr_accessor :description_length_too_long attr_accessor :gender_invalid attr_accessor :age_group_invalid attr_accessor :size_type_invalid attr_accessor :link_format_warning attr_accessor :duplicate_products attr_accessor :duplicate_links attr_accessor :sales_price_invalid attr_accessor :product_category_depth_warning attr_accessor :adwords_same_as_link attr_accessor :duplicate_headers attr_accessor :fetch_same_signature attr_accessor :adwords_format_warning attr_accessor :additional_image_link_warning attr_accessor :image_link_warning attr_accessor :shipping_invalid attr_accessor :tax_invalid attr_accessor :shipping_weight_invalid attr_accessor :expiration_date_invalid attr_accessor :availability_date_invalid attr_accessor :sale_date_invalid attr_accessor :weight_unit_invalid attr_accessor :is_bundle_invalid attr_accessor :updated_time_invalid attr_accessor :custom_label_length_too_long attr_accessor :product_type_length_too_long attr_accessor :too_many_additional_image_links attr_accessor :multipack_invalid attr_accessor :indexed_product_count_large_delta attr_accessor :item_additional_image_download_failure attr_accessor :optional_product_category_missing attr_accessor :optional_product_category_invalid attr_accessor :optional_condition_missing attr_accessor :optional_condition_invalid attr_accessor :ios_deep_link_invalid attr_accessor :android_deep_link_invalid attr_accessor :availability_normalized attr_accessor :condition_normalized attr_accessor :gender_normalized attr_accessor :size_type_normalized attr_accessor :age_group_normalized attr_accessor :utm_source_auto_corrected attr_accessor :country_does_not_map_to_currency attr_accessor :min_ad_price_invalid # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'title_length_too_long' => :'title_length_too_long', :'description_length_too_long' => :'description_length_too_long', :'gender_invalid' => :'gender_invalid', :'age_group_invalid' => :'age_group_invalid', :'size_type_invalid' => :'size_type_invalid', :'link_format_warning' => :'link_format_warning', :'duplicate_products' => :'duplicate_products', :'duplicate_links' => :'duplicate_links', :'sales_price_invalid' => :'sales_price_invalid', :'product_category_depth_warning' => :'product_category_depth_warning', :'adwords_same_as_link' => :'adwords_same_as_link', :'duplicate_headers' => :'duplicate_headers', :'fetch_same_signature' => :'fetch_same_signature', :'adwords_format_warning' => :'adwords_format_warning', :'additional_image_link_warning' => :'additional_image_link_warning', :'image_link_warning' => :'image_link_warning', :'shipping_invalid' => :'shipping_invalid', :'tax_invalid' => :'tax_invalid', :'shipping_weight_invalid' => :'shipping_weight_invalid', :'expiration_date_invalid' => :'expiration_date_invalid', :'availability_date_invalid' => :'availability_date_invalid', :'sale_date_invalid' => :'sale_date_invalid', :'weight_unit_invalid' => :'weight_unit_invalid', :'is_bundle_invalid' => :'is_bundle_invalid', :'updated_time_invalid' => :'updated_time_invalid', :'custom_label_length_too_long' => :'custom_label_length_too_long', :'product_type_length_too_long' => :'product_type_length_too_long', :'too_many_additional_image_links' => :'too_many_additional_image_links', :'multipack_invalid' => :'multipack_invalid', :'indexed_product_count_large_delta' => :'indexed_product_count_large_delta', :'item_additional_image_download_failure' => :'item_additional_image_download_failure', :'optional_product_category_missing' => :'optional_product_category_missing', :'optional_product_category_invalid' => :'optional_product_category_invalid', :'optional_condition_missing' => :'optional_condition_missing', :'optional_condition_invalid' => :'optional_condition_invalid', :'ios_deep_link_invalid' => :'ios_deep_link_invalid', :'android_deep_link_invalid' => :'android_deep_link_invalid', :'availability_normalized' => :'availability_normalized', :'condition_normalized' => :'condition_normalized', :'gender_normalized' => :'gender_normalized', :'size_type_normalized' => :'size_type_normalized', :'age_group_normalized' => :'age_group_normalized', :'utm_source_auto_corrected' => :'utm_source_auto_corrected', :'country_does_not_map_to_currency' => :'country_does_not_map_to_currency', :'min_ad_price_invalid' => :'min_ad_price_invalid' } end # Returns all the JSON keys this model knows about def self.acceptable_attributes attribute_map.values end # Attribute type mapping. def self.openapi_types { :'title_length_too_long' => :'Integer', :'description_length_too_long' => :'Integer', :'gender_invalid' => :'Integer', :'age_group_invalid' => :'Integer', :'size_type_invalid' => :'Integer', :'link_format_warning' => :'Integer', :'duplicate_products' => :'Integer', :'duplicate_links' => :'Integer', :'sales_price_invalid' => :'Integer', :'product_category_depth_warning' => :'Integer', :'adwords_same_as_link' => :'Integer', :'duplicate_headers' => :'Integer', :'fetch_same_signature' => :'Integer', :'adwords_format_warning' => :'Integer', :'additional_image_link_warning' => :'Integer', :'image_link_warning' => :'Integer', :'shipping_invalid' => :'Integer', :'tax_invalid' => :'Integer', :'shipping_weight_invalid' => :'Integer', :'expiration_date_invalid' => :'Integer', :'availability_date_invalid' => :'Integer', :'sale_date_invalid' => :'Integer', :'weight_unit_invalid' => :'Integer', :'is_bundle_invalid' => :'Integer', :'updated_time_invalid' => :'Integer', :'custom_label_length_too_long' => :'Integer', :'product_type_length_too_long' => :'Integer', :'too_many_additional_image_links' => :'Integer', :'multipack_invalid' => :'Integer', :'indexed_product_count_large_delta' => :'Integer', :'item_additional_image_download_failure' => :'Integer', :'optional_product_category_missing' => :'Integer', :'optional_product_category_invalid' => :'Integer', :'optional_condition_missing' => :'Integer', :'optional_condition_invalid' => :'Integer', :'ios_deep_link_invalid' => :'Integer', :'android_deep_link_invalid' => :'Integer', :'availability_normalized' => :'Integer', :'condition_normalized' => :'Integer', :'gender_normalized' => :'Integer', :'size_type_normalized' => :'Integer', :'age_group_normalized' => :'Integer', :'utm_source_auto_corrected' => :'Integer', :'country_does_not_map_to_currency' => :'Integer', :'min_ad_price_invalid' => :'Integer' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ ]) end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `PinterestSdkClient::CatalogsFeedValidationWarnings` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `PinterestSdkClient::CatalogsFeedValidationWarnings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'title_length_too_long') self.title_length_too_long = attributes[:'title_length_too_long'] end if attributes.key?(:'description_length_too_long') self.description_length_too_long = attributes[:'description_length_too_long'] end if attributes.key?(:'gender_invalid') self.gender_invalid = attributes[:'gender_invalid'] end if attributes.key?(:'age_group_invalid') self.age_group_invalid = attributes[:'age_group_invalid'] end if attributes.key?(:'size_type_invalid') self.size_type_invalid = attributes[:'size_type_invalid'] end if attributes.key?(:'link_format_warning') self.link_format_warning = attributes[:'link_format_warning'] end if attributes.key?(:'duplicate_products') self.duplicate_products = attributes[:'duplicate_products'] end if attributes.key?(:'duplicate_links') self.duplicate_links = attributes[:'duplicate_links'] end if attributes.key?(:'sales_price_invalid') self.sales_price_invalid = attributes[:'sales_price_invalid'] end if attributes.key?(:'product_category_depth_warning') self.product_category_depth_warning = attributes[:'product_category_depth_warning'] end if attributes.key?(:'adwords_same_as_link') self.adwords_same_as_link = attributes[:'adwords_same_as_link'] end if attributes.key?(:'duplicate_headers') self.duplicate_headers = attributes[:'duplicate_headers'] end if attributes.key?(:'fetch_same_signature') self.fetch_same_signature = attributes[:'fetch_same_signature'] end if attributes.key?(:'adwords_format_warning') self.adwords_format_warning = attributes[:'adwords_format_warning'] end if attributes.key?(:'additional_image_link_warning') self.additional_image_link_warning = attributes[:'additional_image_link_warning'] end if attributes.key?(:'image_link_warning') self.image_link_warning = attributes[:'image_link_warning'] end if attributes.key?(:'shipping_invalid') self.shipping_invalid = attributes[:'shipping_invalid'] end if attributes.key?(:'tax_invalid') self.tax_invalid = attributes[:'tax_invalid'] end if attributes.key?(:'shipping_weight_invalid') self.shipping_weight_invalid = attributes[:'shipping_weight_invalid'] end if attributes.key?(:'expiration_date_invalid') self.expiration_date_invalid = attributes[:'expiration_date_invalid'] end if attributes.key?(:'availability_date_invalid') self.availability_date_invalid = attributes[:'availability_date_invalid'] end if attributes.key?(:'sale_date_invalid') self.sale_date_invalid = attributes[:'sale_date_invalid'] end if attributes.key?(:'weight_unit_invalid') self.weight_unit_invalid = attributes[:'weight_unit_invalid'] end if attributes.key?(:'is_bundle_invalid') self.is_bundle_invalid = attributes[:'is_bundle_invalid'] end if attributes.key?(:'updated_time_invalid') self.updated_time_invalid = attributes[:'updated_time_invalid'] end if attributes.key?(:'custom_label_length_too_long') self.custom_label_length_too_long = attributes[:'custom_label_length_too_long'] end if attributes.key?(:'product_type_length_too_long') self.product_type_length_too_long = attributes[:'product_type_length_too_long'] end if attributes.key?(:'too_many_additional_image_links') self.too_many_additional_image_links = attributes[:'too_many_additional_image_links'] end if attributes.key?(:'multipack_invalid') self.multipack_invalid = attributes[:'multipack_invalid'] end if attributes.key?(:'indexed_product_count_large_delta') self.indexed_product_count_large_delta = attributes[:'indexed_product_count_large_delta'] end if attributes.key?(:'item_additional_image_download_failure') self.item_additional_image_download_failure = attributes[:'item_additional_image_download_failure'] end if attributes.key?(:'optional_product_category_missing') self.optional_product_category_missing = attributes[:'optional_product_category_missing'] end if attributes.key?(:'optional_product_category_invalid') self.optional_product_category_invalid = attributes[:'optional_product_category_invalid'] end if attributes.key?(:'optional_condition_missing') self.optional_condition_missing = attributes[:'optional_condition_missing'] end if attributes.key?(:'optional_condition_invalid') self.optional_condition_invalid = attributes[:'optional_condition_invalid'] end if attributes.key?(:'ios_deep_link_invalid') self.ios_deep_link_invalid = attributes[:'ios_deep_link_invalid'] end if attributes.key?(:'android_deep_link_invalid') self.android_deep_link_invalid = attributes[:'android_deep_link_invalid'] end if attributes.key?(:'availability_normalized') self.availability_normalized = attributes[:'availability_normalized'] end if attributes.key?(:'condition_normalized') self.condition_normalized = attributes[:'condition_normalized'] end if attributes.key?(:'gender_normalized') self.gender_normalized = attributes[:'gender_normalized'] end if attributes.key?(:'size_type_normalized') self.size_type_normalized = attributes[:'size_type_normalized'] end if attributes.key?(:'age_group_normalized') self.age_group_normalized = attributes[:'age_group_normalized'] end if attributes.key?(:'utm_source_auto_corrected') self.utm_source_auto_corrected = attributes[:'utm_source_auto_corrected'] end if attributes.key?(:'country_does_not_map_to_currency') self.country_does_not_map_to_currency = attributes[:'country_does_not_map_to_currency'] end if attributes.key?(:'min_ad_price_invalid') self.min_ad_price_invalid = attributes[:'min_ad_price_invalid'] 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 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? true 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 && title_length_too_long == o.title_length_too_long && description_length_too_long == o.description_length_too_long && gender_invalid == o.gender_invalid && age_group_invalid == o.age_group_invalid && size_type_invalid == o.size_type_invalid && link_format_warning == o.link_format_warning && duplicate_products == o.duplicate_products && duplicate_links == o.duplicate_links && sales_price_invalid == o.sales_price_invalid && product_category_depth_warning == o.product_category_depth_warning && adwords_same_as_link == o.adwords_same_as_link && duplicate_headers == o.duplicate_headers && fetch_same_signature == o.fetch_same_signature && adwords_format_warning == o.adwords_format_warning && additional_image_link_warning == o.additional_image_link_warning && image_link_warning == o.image_link_warning && shipping_invalid == o.shipping_invalid && tax_invalid == o.tax_invalid && shipping_weight_invalid == o.shipping_weight_invalid && expiration_date_invalid == o.expiration_date_invalid && availability_date_invalid == o.availability_date_invalid && sale_date_invalid == o.sale_date_invalid && weight_unit_invalid == o.weight_unit_invalid && is_bundle_invalid == o.is_bundle_invalid && updated_time_invalid == o.updated_time_invalid && custom_label_length_too_long == o.custom_label_length_too_long && product_type_length_too_long == o.product_type_length_too_long && too_many_additional_image_links == o.too_many_additional_image_links && multipack_invalid == o.multipack_invalid && indexed_product_count_large_delta == o.indexed_product_count_large_delta && item_additional_image_download_failure == o.item_additional_image_download_failure && optional_product_category_missing == o.optional_product_category_missing && optional_product_category_invalid == o.optional_product_category_invalid && optional_condition_missing == o.optional_condition_missing && optional_condition_invalid == o.optional_condition_invalid && ios_deep_link_invalid == o.ios_deep_link_invalid && android_deep_link_invalid == o.android_deep_link_invalid && availability_normalized == o.availability_normalized && condition_normalized == o.condition_normalized && gender_normalized == o.gender_normalized && size_type_normalized == o.size_type_normalized && age_group_normalized == o.age_group_normalized && utm_source_auto_corrected == o.utm_source_auto_corrected && country_does_not_map_to_currency == o.country_does_not_map_to_currency && min_ad_price_invalid == o.min_ad_price_invalid end # @see the `==` method # @param [Object] Object to be compared def eql?(o) self == o end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash [title_length_too_long, description_length_too_long, gender_invalid, age_group_invalid, size_type_invalid, link_format_warning, duplicate_products, duplicate_links, sales_price_invalid, product_category_depth_warning, adwords_same_as_link, duplicate_headers, fetch_same_signature, adwords_format_warning, additional_image_link_warning, image_link_warning, shipping_invalid, tax_invalid, shipping_weight_invalid, expiration_date_invalid, availability_date_invalid, sale_date_invalid, weight_unit_invalid, is_bundle_invalid, updated_time_invalid, custom_label_length_too_long, product_type_length_too_long, too_many_additional_image_links, multipack_invalid, indexed_product_count_large_delta, item_additional_image_download_failure, optional_product_category_missing, optional_product_category_invalid, optional_condition_missing, optional_condition_invalid, ios_deep_link_invalid, android_deep_link_invalid, availability_normalized, condition_normalized, gender_normalized, size_type_normalized, age_group_normalized, utm_source_auto_corrected, country_does_not_map_to_currency, min_ad_price_invalid].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def self.build_from_hash(attributes) new.build_from_hash(attributes) 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.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{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[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 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 :Time Time.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 # models (e.g. Pet) or oneOf klass = PinterestSdkClient.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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) 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 # 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