=begin #UltraCart Rest API V2 #UltraCart REST API Version 2 The version of the OpenAPI document: 2.0.0 Contact: support@ultracart.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.1-SNAPSHOT =end require 'date' require 'time' module UltracartClient class ItemEbay # True if the item is active for listing attr_accessor :active # e-Bay category ID attr_accessor :category_id # Answers to category specific questions attr_accessor :category_specifics # Description of the condition (e-Bay constant) attr_accessor :condition_description # Numerical ID of the condition (e-Bay constant) attr_accessor :condition_id # Number of consecutive failures trying to list this item attr_accessor :consecutive_failures # e-Bay Store category 1 attr_accessor :custom_category1 # e-Bay Store category 2 attr_accessor :custom_category2 # Maximum number of days it will take to ship the item attr_accessor :dispatch_time_max # Domestic 1 method additional item cost attr_accessor :domestic_1_additional_cost # Domestic 1 method first item cost attr_accessor :domestic_1_first_cost # Domestic 2 method additional item cost attr_accessor :domestic_2_additional_cost # Domestic 2 method first item cost attr_accessor :domestic_2_first_cost # Domestic 3 method additional item cost attr_accessor :domestic_3_additional_cost # Domestic 3 method first item cost attr_accessor :domestic_3_first_cost # Domestic 4 method additional item cost attr_accessor :domestic_4_additional_cost # Domestic 4 method first item cost attr_accessor :domestic_4_first_cost # If listed, this is the e-Bay auction id attr_accessor :ebay_auction_id # e-Bay specific inventory attr_accessor :ebay_specific_inventory # The template name to use hwen rendering the e-Bay listing attr_accessor :ebay_template_name # The template object identifier to use when rendering the e-Bay listing attr_accessor :ebay_template_oid # Date/time of the auction end attr_accessor :end_time # True if item receives free shipping attr_accessor :free_shipping # The method that is free for free shipping attr_accessor :free_shipping_method # International 1 method additional item cost attr_accessor :international_1_additional_cost # International 1 method first item cost attr_accessor :international_1_first_cost # International 2 method additional item cost attr_accessor :international_2_additional_cost # International 2 method first item cost attr_accessor :international_2_first_cost # International 3 method additional item cost attr_accessor :international_3_additional_cost # International 3 method first item cost attr_accessor :international_3_first_cost # International 4 method additional item cost attr_accessor :international_4_additional_cost # International 4 method first item cost attr_accessor :international_4_first_cost # Date/time of the last status check attr_accessor :last_status_dts # Current listing dispatch time maximum attr_accessor :listed_dispatch_time_max # The template object identifier used for the listing attr_accessor :listed_ebay_template_oid # Date/time of the listing attr_accessor :listing_dts # The duration of the listing attr_accessor :listing_duration # Price to list the item at attr_accessor :listing_price # The price to list the item at if different than the regular UltraCart item price attr_accessor :listing_price_override # The type of e-Bay listing attr_accessor :listing_type attr_accessor :marketplace_analysis # True if marketplace analysis should be performed attr_accessor :marketplace_analysis_perform # Marketplace FVF percentage attr_accessor :marketplace_final_value_fee_percentage # Date/time of the marketplace analysis last check attr_accessor :marketplace_last_check_dts # True if we are the lowest offer in the marketplace attr_accessor :marketplace_lowest # True if another seller is violating MAP attr_accessor :marketplace_map_violation # Marketplace multiplier attr_accessor :marketplace_multiplier # Marketplace other price attr_accessor :marketplace_other_price # Marketplace other seller attr_accessor :marketplace_other_seller # Marketplace other shipping attr_accessor :marketplace_other_shipping # Marketplace other total attr_accessor :marketplace_other_total # Marketplace our additional profit potential attr_accessor :marketplace_our_additional_profit_potential # Marketplace our price attr_accessor :marketplace_our_price # Marketplace our profit attr_accessor :marketplace_our_profit # Marketplace our shipping attr_accessor :marketplace_our_shipping # Marketplace our total attr_accessor :marketplace_our_total # Marketplace overhead attr_accessor :marketplace_overhead # True if our listing is profitable to sell attr_accessor :marketplace_profitable # Date/time for the next attempt to list attr_accessor :next_attempt_dts # The next listing duration to use when the current listing ends. attr_accessor :next_listing_duration # True if the item should not qualify for promotional shipping attr_accessor :no_promotional_shipping # Packaging and handling costs attr_accessor :packaging_handling_costs # Previous e-Bay auction id attr_accessor :previous_ebay_auction_id # Quantity available of the item attr_accessor :quantity # Reserve price attr_accessor :reserve_price # How to send the item dimensions and weights to e-Bay attr_accessor :send_dimensions_and_weight # Date/time of the auction start attr_accessor :start_time # Status of the item's listing attr_accessor :status # Typical number of days it will take to ship the item attr_accessor :target_dispatch_time_max # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'active' => :'active', :'category_id' => :'category_id', :'category_specifics' => :'category_specifics', :'condition_description' => :'condition_description', :'condition_id' => :'condition_id', :'consecutive_failures' => :'consecutive_failures', :'custom_category1' => :'custom_category1', :'custom_category2' => :'custom_category2', :'dispatch_time_max' => :'dispatch_time_max', :'domestic_1_additional_cost' => :'domestic_1_additional_cost', :'domestic_1_first_cost' => :'domestic_1_first_cost', :'domestic_2_additional_cost' => :'domestic_2_additional_cost', :'domestic_2_first_cost' => :'domestic_2_first_cost', :'domestic_3_additional_cost' => :'domestic_3_additional_cost', :'domestic_3_first_cost' => :'domestic_3_first_cost', :'domestic_4_additional_cost' => :'domestic_4_additional_cost', :'domestic_4_first_cost' => :'domestic_4_first_cost', :'ebay_auction_id' => :'ebay_auction_id', :'ebay_specific_inventory' => :'ebay_specific_inventory', :'ebay_template_name' => :'ebay_template_name', :'ebay_template_oid' => :'ebay_template_oid', :'end_time' => :'end_time', :'free_shipping' => :'free_shipping', :'free_shipping_method' => :'free_shipping_method', :'international_1_additional_cost' => :'international_1_additional_cost', :'international_1_first_cost' => :'international_1_first_cost', :'international_2_additional_cost' => :'international_2_additional_cost', :'international_2_first_cost' => :'international_2_first_cost', :'international_3_additional_cost' => :'international_3_additional_cost', :'international_3_first_cost' => :'international_3_first_cost', :'international_4_additional_cost' => :'international_4_additional_cost', :'international_4_first_cost' => :'international_4_first_cost', :'last_status_dts' => :'last_status_dts', :'listed_dispatch_time_max' => :'listed_dispatch_time_max', :'listed_ebay_template_oid' => :'listed_ebay_template_oid', :'listing_dts' => :'listing_dts', :'listing_duration' => :'listing_duration', :'listing_price' => :'listing_price', :'listing_price_override' => :'listing_price_override', :'listing_type' => :'listing_type', :'marketplace_analysis' => :'marketplace_analysis', :'marketplace_analysis_perform' => :'marketplace_analysis_perform', :'marketplace_final_value_fee_percentage' => :'marketplace_final_value_fee_percentage', :'marketplace_last_check_dts' => :'marketplace_last_check_dts', :'marketplace_lowest' => :'marketplace_lowest', :'marketplace_map_violation' => :'marketplace_map_violation', :'marketplace_multiplier' => :'marketplace_multiplier', :'marketplace_other_price' => :'marketplace_other_price', :'marketplace_other_seller' => :'marketplace_other_seller', :'marketplace_other_shipping' => :'marketplace_other_shipping', :'marketplace_other_total' => :'marketplace_other_total', :'marketplace_our_additional_profit_potential' => :'marketplace_our_additional_profit_potential', :'marketplace_our_price' => :'marketplace_our_price', :'marketplace_our_profit' => :'marketplace_our_profit', :'marketplace_our_shipping' => :'marketplace_our_shipping', :'marketplace_our_total' => :'marketplace_our_total', :'marketplace_overhead' => :'marketplace_overhead', :'marketplace_profitable' => :'marketplace_profitable', :'next_attempt_dts' => :'next_attempt_dts', :'next_listing_duration' => :'next_listing_duration', :'no_promotional_shipping' => :'no_promotional_shipping', :'packaging_handling_costs' => :'packaging_handling_costs', :'previous_ebay_auction_id' => :'previous_ebay_auction_id', :'quantity' => :'quantity', :'reserve_price' => :'reserve_price', :'send_dimensions_and_weight' => :'send_dimensions_and_weight', :'start_time' => :'start_time', :'status' => :'status', :'target_dispatch_time_max' => :'target_dispatch_time_max' } 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 { :'active' => :'Boolean', :'category_id' => :'Integer', :'category_specifics' => :'Array', :'condition_description' => :'String', :'condition_id' => :'Integer', :'consecutive_failures' => :'Integer', :'custom_category1' => :'Integer', :'custom_category2' => :'Integer', :'dispatch_time_max' => :'Integer', :'domestic_1_additional_cost' => :'Float', :'domestic_1_first_cost' => :'Float', :'domestic_2_additional_cost' => :'Float', :'domestic_2_first_cost' => :'Float', :'domestic_3_additional_cost' => :'Float', :'domestic_3_first_cost' => :'Float', :'domestic_4_additional_cost' => :'Float', :'domestic_4_first_cost' => :'Float', :'ebay_auction_id' => :'String', :'ebay_specific_inventory' => :'Integer', :'ebay_template_name' => :'String', :'ebay_template_oid' => :'Integer', :'end_time' => :'String', :'free_shipping' => :'Boolean', :'free_shipping_method' => :'String', :'international_1_additional_cost' => :'Float', :'international_1_first_cost' => :'Float', :'international_2_additional_cost' => :'Float', :'international_2_first_cost' => :'Float', :'international_3_additional_cost' => :'Float', :'international_3_first_cost' => :'Float', :'international_4_additional_cost' => :'Float', :'international_4_first_cost' => :'Float', :'last_status_dts' => :'String', :'listed_dispatch_time_max' => :'Integer', :'listed_ebay_template_oid' => :'Integer', :'listing_dts' => :'String', :'listing_duration' => :'String', :'listing_price' => :'Float', :'listing_price_override' => :'Float', :'listing_type' => :'String', :'marketplace_analysis' => :'ItemEbayMarketPlaceAnalysis', :'marketplace_analysis_perform' => :'Boolean', :'marketplace_final_value_fee_percentage' => :'Float', :'marketplace_last_check_dts' => :'String', :'marketplace_lowest' => :'Boolean', :'marketplace_map_violation' => :'Boolean', :'marketplace_multiplier' => :'Float', :'marketplace_other_price' => :'Float', :'marketplace_other_seller' => :'String', :'marketplace_other_shipping' => :'Float', :'marketplace_other_total' => :'Float', :'marketplace_our_additional_profit_potential' => :'Float', :'marketplace_our_price' => :'Float', :'marketplace_our_profit' => :'Float', :'marketplace_our_shipping' => :'Float', :'marketplace_our_total' => :'Float', :'marketplace_overhead' => :'Float', :'marketplace_profitable' => :'Boolean', :'next_attempt_dts' => :'String', :'next_listing_duration' => :'String', :'no_promotional_shipping' => :'Boolean', :'packaging_handling_costs' => :'Float', :'previous_ebay_auction_id' => :'String', :'quantity' => :'Integer', :'reserve_price' => :'Float', :'send_dimensions_and_weight' => :'String', :'start_time' => :'String', :'status' => :'String', :'target_dispatch_time_max' => :'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 `UltracartClient::ItemEbay` 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 `UltracartClient::ItemEbay`. 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?(:'active') self.active = attributes[:'active'] end if attributes.key?(:'category_id') self.category_id = attributes[:'category_id'] end if attributes.key?(:'category_specifics') if (value = attributes[:'category_specifics']).is_a?(Array) self.category_specifics = value end end if attributes.key?(:'condition_description') self.condition_description = attributes[:'condition_description'] end if attributes.key?(:'condition_id') self.condition_id = attributes[:'condition_id'] end if attributes.key?(:'consecutive_failures') self.consecutive_failures = attributes[:'consecutive_failures'] end if attributes.key?(:'custom_category1') self.custom_category1 = attributes[:'custom_category1'] end if attributes.key?(:'custom_category2') self.custom_category2 = attributes[:'custom_category2'] end if attributes.key?(:'dispatch_time_max') self.dispatch_time_max = attributes[:'dispatch_time_max'] end if attributes.key?(:'domestic_1_additional_cost') self.domestic_1_additional_cost = attributes[:'domestic_1_additional_cost'] end if attributes.key?(:'domestic_1_first_cost') self.domestic_1_first_cost = attributes[:'domestic_1_first_cost'] end if attributes.key?(:'domestic_2_additional_cost') self.domestic_2_additional_cost = attributes[:'domestic_2_additional_cost'] end if attributes.key?(:'domestic_2_first_cost') self.domestic_2_first_cost = attributes[:'domestic_2_first_cost'] end if attributes.key?(:'domestic_3_additional_cost') self.domestic_3_additional_cost = attributes[:'domestic_3_additional_cost'] end if attributes.key?(:'domestic_3_first_cost') self.domestic_3_first_cost = attributes[:'domestic_3_first_cost'] end if attributes.key?(:'domestic_4_additional_cost') self.domestic_4_additional_cost = attributes[:'domestic_4_additional_cost'] end if attributes.key?(:'domestic_4_first_cost') self.domestic_4_first_cost = attributes[:'domestic_4_first_cost'] end if attributes.key?(:'ebay_auction_id') self.ebay_auction_id = attributes[:'ebay_auction_id'] end if attributes.key?(:'ebay_specific_inventory') self.ebay_specific_inventory = attributes[:'ebay_specific_inventory'] end if attributes.key?(:'ebay_template_name') self.ebay_template_name = attributes[:'ebay_template_name'] end if attributes.key?(:'ebay_template_oid') self.ebay_template_oid = attributes[:'ebay_template_oid'] end if attributes.key?(:'end_time') self.end_time = attributes[:'end_time'] end if attributes.key?(:'free_shipping') self.free_shipping = attributes[:'free_shipping'] end if attributes.key?(:'free_shipping_method') self.free_shipping_method = attributes[:'free_shipping_method'] end if attributes.key?(:'international_1_additional_cost') self.international_1_additional_cost = attributes[:'international_1_additional_cost'] end if attributes.key?(:'international_1_first_cost') self.international_1_first_cost = attributes[:'international_1_first_cost'] end if attributes.key?(:'international_2_additional_cost') self.international_2_additional_cost = attributes[:'international_2_additional_cost'] end if attributes.key?(:'international_2_first_cost') self.international_2_first_cost = attributes[:'international_2_first_cost'] end if attributes.key?(:'international_3_additional_cost') self.international_3_additional_cost = attributes[:'international_3_additional_cost'] end if attributes.key?(:'international_3_first_cost') self.international_3_first_cost = attributes[:'international_3_first_cost'] end if attributes.key?(:'international_4_additional_cost') self.international_4_additional_cost = attributes[:'international_4_additional_cost'] end if attributes.key?(:'international_4_first_cost') self.international_4_first_cost = attributes[:'international_4_first_cost'] end if attributes.key?(:'last_status_dts') self.last_status_dts = attributes[:'last_status_dts'] end if attributes.key?(:'listed_dispatch_time_max') self.listed_dispatch_time_max = attributes[:'listed_dispatch_time_max'] end if attributes.key?(:'listed_ebay_template_oid') self.listed_ebay_template_oid = attributes[:'listed_ebay_template_oid'] end if attributes.key?(:'listing_dts') self.listing_dts = attributes[:'listing_dts'] end if attributes.key?(:'listing_duration') self.listing_duration = attributes[:'listing_duration'] end if attributes.key?(:'listing_price') self.listing_price = attributes[:'listing_price'] end if attributes.key?(:'listing_price_override') self.listing_price_override = attributes[:'listing_price_override'] end if attributes.key?(:'listing_type') self.listing_type = attributes[:'listing_type'] end if attributes.key?(:'marketplace_analysis') self.marketplace_analysis = attributes[:'marketplace_analysis'] end if attributes.key?(:'marketplace_analysis_perform') self.marketplace_analysis_perform = attributes[:'marketplace_analysis_perform'] end if attributes.key?(:'marketplace_final_value_fee_percentage') self.marketplace_final_value_fee_percentage = attributes[:'marketplace_final_value_fee_percentage'] end if attributes.key?(:'marketplace_last_check_dts') self.marketplace_last_check_dts = attributes[:'marketplace_last_check_dts'] end if attributes.key?(:'marketplace_lowest') self.marketplace_lowest = attributes[:'marketplace_lowest'] end if attributes.key?(:'marketplace_map_violation') self.marketplace_map_violation = attributes[:'marketplace_map_violation'] end if attributes.key?(:'marketplace_multiplier') self.marketplace_multiplier = attributes[:'marketplace_multiplier'] end if attributes.key?(:'marketplace_other_price') self.marketplace_other_price = attributes[:'marketplace_other_price'] end if attributes.key?(:'marketplace_other_seller') self.marketplace_other_seller = attributes[:'marketplace_other_seller'] end if attributes.key?(:'marketplace_other_shipping') self.marketplace_other_shipping = attributes[:'marketplace_other_shipping'] end if attributes.key?(:'marketplace_other_total') self.marketplace_other_total = attributes[:'marketplace_other_total'] end if attributes.key?(:'marketplace_our_additional_profit_potential') self.marketplace_our_additional_profit_potential = attributes[:'marketplace_our_additional_profit_potential'] end if attributes.key?(:'marketplace_our_price') self.marketplace_our_price = attributes[:'marketplace_our_price'] end if attributes.key?(:'marketplace_our_profit') self.marketplace_our_profit = attributes[:'marketplace_our_profit'] end if attributes.key?(:'marketplace_our_shipping') self.marketplace_our_shipping = attributes[:'marketplace_our_shipping'] end if attributes.key?(:'marketplace_our_total') self.marketplace_our_total = attributes[:'marketplace_our_total'] end if attributes.key?(:'marketplace_overhead') self.marketplace_overhead = attributes[:'marketplace_overhead'] end if attributes.key?(:'marketplace_profitable') self.marketplace_profitable = attributes[:'marketplace_profitable'] end if attributes.key?(:'next_attempt_dts') self.next_attempt_dts = attributes[:'next_attempt_dts'] end if attributes.key?(:'next_listing_duration') self.next_listing_duration = attributes[:'next_listing_duration'] end if attributes.key?(:'no_promotional_shipping') self.no_promotional_shipping = attributes[:'no_promotional_shipping'] end if attributes.key?(:'packaging_handling_costs') self.packaging_handling_costs = attributes[:'packaging_handling_costs'] end if attributes.key?(:'previous_ebay_auction_id') self.previous_ebay_auction_id = attributes[:'previous_ebay_auction_id'] end if attributes.key?(:'quantity') self.quantity = attributes[:'quantity'] end if attributes.key?(:'reserve_price') self.reserve_price = attributes[:'reserve_price'] end if attributes.key?(:'send_dimensions_and_weight') self.send_dimensions_and_weight = attributes[:'send_dimensions_and_weight'] end if attributes.key?(:'start_time') self.start_time = attributes[:'start_time'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'target_dispatch_time_max') self.target_dispatch_time_max = attributes[:'target_dispatch_time_max'] 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 && active == o.active && category_id == o.category_id && category_specifics == o.category_specifics && condition_description == o.condition_description && condition_id == o.condition_id && consecutive_failures == o.consecutive_failures && custom_category1 == o.custom_category1 && custom_category2 == o.custom_category2 && dispatch_time_max == o.dispatch_time_max && domestic_1_additional_cost == o.domestic_1_additional_cost && domestic_1_first_cost == o.domestic_1_first_cost && domestic_2_additional_cost == o.domestic_2_additional_cost && domestic_2_first_cost == o.domestic_2_first_cost && domestic_3_additional_cost == o.domestic_3_additional_cost && domestic_3_first_cost == o.domestic_3_first_cost && domestic_4_additional_cost == o.domestic_4_additional_cost && domestic_4_first_cost == o.domestic_4_first_cost && ebay_auction_id == o.ebay_auction_id && ebay_specific_inventory == o.ebay_specific_inventory && ebay_template_name == o.ebay_template_name && ebay_template_oid == o.ebay_template_oid && end_time == o.end_time && free_shipping == o.free_shipping && free_shipping_method == o.free_shipping_method && international_1_additional_cost == o.international_1_additional_cost && international_1_first_cost == o.international_1_first_cost && international_2_additional_cost == o.international_2_additional_cost && international_2_first_cost == o.international_2_first_cost && international_3_additional_cost == o.international_3_additional_cost && international_3_first_cost == o.international_3_first_cost && international_4_additional_cost == o.international_4_additional_cost && international_4_first_cost == o.international_4_first_cost && last_status_dts == o.last_status_dts && listed_dispatch_time_max == o.listed_dispatch_time_max && listed_ebay_template_oid == o.listed_ebay_template_oid && listing_dts == o.listing_dts && listing_duration == o.listing_duration && listing_price == o.listing_price && listing_price_override == o.listing_price_override && listing_type == o.listing_type && marketplace_analysis == o.marketplace_analysis && marketplace_analysis_perform == o.marketplace_analysis_perform && marketplace_final_value_fee_percentage == o.marketplace_final_value_fee_percentage && marketplace_last_check_dts == o.marketplace_last_check_dts && marketplace_lowest == o.marketplace_lowest && marketplace_map_violation == o.marketplace_map_violation && marketplace_multiplier == o.marketplace_multiplier && marketplace_other_price == o.marketplace_other_price && marketplace_other_seller == o.marketplace_other_seller && marketplace_other_shipping == o.marketplace_other_shipping && marketplace_other_total == o.marketplace_other_total && marketplace_our_additional_profit_potential == o.marketplace_our_additional_profit_potential && marketplace_our_price == o.marketplace_our_price && marketplace_our_profit == o.marketplace_our_profit && marketplace_our_shipping == o.marketplace_our_shipping && marketplace_our_total == o.marketplace_our_total && marketplace_overhead == o.marketplace_overhead && marketplace_profitable == o.marketplace_profitable && next_attempt_dts == o.next_attempt_dts && next_listing_duration == o.next_listing_duration && no_promotional_shipping == o.no_promotional_shipping && packaging_handling_costs == o.packaging_handling_costs && previous_ebay_auction_id == o.previous_ebay_auction_id && quantity == o.quantity && reserve_price == o.reserve_price && send_dimensions_and_weight == o.send_dimensions_and_weight && start_time == o.start_time && status == o.status && target_dispatch_time_max == o.target_dispatch_time_max 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 [active, category_id, category_specifics, condition_description, condition_id, consecutive_failures, custom_category1, custom_category2, dispatch_time_max, domestic_1_additional_cost, domestic_1_first_cost, domestic_2_additional_cost, domestic_2_first_cost, domestic_3_additional_cost, domestic_3_first_cost, domestic_4_additional_cost, domestic_4_first_cost, ebay_auction_id, ebay_specific_inventory, ebay_template_name, ebay_template_oid, end_time, free_shipping, free_shipping_method, international_1_additional_cost, international_1_first_cost, international_2_additional_cost, international_2_first_cost, international_3_additional_cost, international_3_first_cost, international_4_additional_cost, international_4_first_cost, last_status_dts, listed_dispatch_time_max, listed_ebay_template_oid, listing_dts, listing_duration, listing_price, listing_price_override, listing_type, marketplace_analysis, marketplace_analysis_perform, marketplace_final_value_fee_percentage, marketplace_last_check_dts, marketplace_lowest, marketplace_map_violation, marketplace_multiplier, marketplace_other_price, marketplace_other_seller, marketplace_other_shipping, marketplace_other_total, marketplace_our_additional_profit_potential, marketplace_our_price, marketplace_our_profit, marketplace_our_shipping, marketplace_our_total, marketplace_overhead, marketplace_profitable, next_attempt_dts, next_listing_duration, no_promotional_shipping, packaging_handling_costs, previous_ebay_auction_id, quantity, reserve_price, send_dimensions_and_weight, start_time, status, target_dispatch_time_max].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) attributes = attributes.transform_keys(&:to_sym) 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 = UltracartClient.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