=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 ChannelPartnerOrder # advertising_source attr_accessor :advertising_source # Affiliate Id attr_accessor :affiliate_id # Affiliate Sub Id attr_accessor :affiliate_sub_id # Arbitrary shipping handling total attr_accessor :arbitrary_shipping_handling_total # Arbitrary tax for overriding calculated taxes attr_accessor :arbitrary_tax # Arbitrary tax rate attr_accessor :arbitrary_tax_rate # Arbitrary taxable subtotal attr_accessor :arbitrary_taxable_subtotal # If true any matching customer profile based on email is associated with this order attr_accessor :associate_with_customer_profile_if_present # If true any purchase orders are automatically approved attr_accessor :auto_approve_purchase_order # Billing Address line 1 attr_accessor :billto_address1 # Billing Address line 2 attr_accessor :billto_address2 # Billing City attr_accessor :billto_city # Billing Company attr_accessor :billto_company # Billing ISO-3166 two letter country code attr_accessor :billto_country_code # Billing Day phone attr_accessor :billto_day_phone # Billing Evening phone attr_accessor :billto_evening_phone # Billing First name attr_accessor :billto_first_name # Billing Last name attr_accessor :billto_last_name # Billing Postal code attr_accessor :billto_postal_code # Billing State for United States otherwise region or province for other countries attr_accessor :billto_state_region # Billing Title attr_accessor :billto_title # CC email. attr_accessor :cc_email # The id for this order within the channel partner system. attr_accessor :channel_partner_order_id # If true this order is marked as an auto order (recurring) attr_accessor :consider_recurring # Array of coupon codes attr_accessor :coupons # The amount authorized externally attr_accessor :credit_card_authorization_amount # Date/Time of credit card authorization in ISO8601 format attr_accessor :credit_card_authorization_dts # The reference number provided by an externally processed transaction attr_accessor :credit_card_authorization_number # Credit card expiration month attr_accessor :credit_card_expiration_month # Credit card expiration year attr_accessor :credit_card_expiration_year # Credit card type attr_accessor :credit_card_type # Custom field 1 attr_accessor :custom_field1 # Custom field 2 attr_accessor :custom_field2 # Custom field 3 attr_accessor :custom_field3 # Custom field 4 attr_accessor :custom_field4 # Custom field 5 attr_accessor :custom_field5 # Custom field 6 attr_accessor :custom_field6 # Custom field 7 attr_accessor :custom_field7 # Date the customer is requesting delivery on. Typically used for perishable product delivery. attr_accessor :delivery_date # Email attr_accessor :email # True if this order is a gift attr_accessor :gift # Email address of the gift recipient attr_accessor :gift_email # Message to the gift recipient attr_accessor :gift_message # The token provided by UltraCart hosted fields when a credit card number is uploaded into the system. This is the only way to provide a credit card number. attr_accessor :hosted_fields_card_token # The token provided by UltraCart hosted fields when a credit card cvv is uploaded into the system. This is the only way to provide a cvv number. attr_accessor :hosted_fields_cvv_token # Insurance application id attr_accessor :insurance_application_id # Insurance claim id attr_accessor :insurance_claim_id # IP Address of the customer attr_accessor :ip_address # Items attr_accessor :items # If true the least expensive shipping method is automatically chosen during the order import attr_accessor :least_cost_route # An optional array of shipping methods to restict choices if least_cost_route is true attr_accessor :least_cost_route_shipping_methods # If true the customer is subscribed to any configured mailing lists attr_accessor :mailing_list_opt_in # If true no payment processing is done and the order is placed into Accounts Receivable attr_accessor :no_realtime_payment_processing # Payment method attr_accessor :payment_method # Purchase order number attr_accessor :purchase_order_number # The rotating transaction gateway code for the gateway used to charge this order attr_accessor :rotating_transaction_gateway_code # Screen branding theme code attr_accessor :screen_branding_theme_code # Date the customer is requesting that the order ship on. Typically used for perishable product delivery. attr_accessor :ship_on_date # True if the shipping adress is residential. Effects the methods that are available to the customer as well as the price of the shipping method. attr_accessor :ship_to_residential # Shipping method attr_accessor :shipping_method # Shipping Address line 1 attr_accessor :shipto_address1 # Shipping Address line 2 attr_accessor :shipto_address2 # Shipping City attr_accessor :shipto_city # Shipping Company attr_accessor :shipto_company # Shipping ISO-3166 two letter country code attr_accessor :shipto_country_code # Shipping Day phone attr_accessor :shipto_day_phone # Shipping Evening phone attr_accessor :shipto_evening_phone # Shipping First name attr_accessor :shipto_first_name # Shipping Last name attr_accessor :shipto_last_name # Shipping Postal code attr_accessor :shipto_postal_code # Shipping State for United States otherwise region or province for other countries attr_accessor :shipto_state_region # Shipping Title attr_accessor :shipto_title # If true the order is placed directly into the shipping department attr_accessor :skip_payment_processing # Special instructions from the customer regarding shipping attr_accessor :special_instructions # If true the order bypasses shipping and is marked completed attr_accessor :store_completed # If true any failed payments are placed into Accounts Receivable. If false any failed payments result in a rejected order resulting in errors thrown during the insert routine attr_accessor :store_if_payment_declines # The optional shipping county used to determine exact taxes attr_accessor :tax_county # If true this order is marked as being tax exempt attr_accessor :tax_exempt attr_accessor :transaction # If true all warnings are considered errors, this is true by default attr_accessor :treat_warnings_as_errors class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values def initialize(datatype, allowable_values) @allowable_values = allowable_values.map do |value| case datatype.to_s when /Integer/i value.to_i when /Float/i value.to_f else value end end end def valid?(value) !value || allowable_values.include?(value) end end # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'advertising_source' => :'advertisingSource', :'affiliate_id' => :'affiliate_id', :'affiliate_sub_id' => :'affiliate_sub_id', :'arbitrary_shipping_handling_total' => :'arbitrary_shipping_handling_total', :'arbitrary_tax' => :'arbitrary_tax', :'arbitrary_tax_rate' => :'arbitrary_tax_rate', :'arbitrary_taxable_subtotal' => :'arbitrary_taxable_subtotal', :'associate_with_customer_profile_if_present' => :'associate_with_customer_profile_if_present', :'auto_approve_purchase_order' => :'auto_approve_purchase_order', :'billto_address1' => :'billto_address1', :'billto_address2' => :'billto_address2', :'billto_city' => :'billto_city', :'billto_company' => :'billto_company', :'billto_country_code' => :'billto_country_code', :'billto_day_phone' => :'billto_day_phone', :'billto_evening_phone' => :'billto_evening_phone', :'billto_first_name' => :'billto_first_name', :'billto_last_name' => :'billto_last_name', :'billto_postal_code' => :'billto_postal_code', :'billto_state_region' => :'billto_state_region', :'billto_title' => :'billto_title', :'cc_email' => :'cc_email', :'channel_partner_order_id' => :'channel_partner_order_id', :'consider_recurring' => :'consider_recurring', :'coupons' => :'coupons', :'credit_card_authorization_amount' => :'credit_card_authorization_amount', :'credit_card_authorization_dts' => :'credit_card_authorization_dts', :'credit_card_authorization_number' => :'credit_card_authorization_number', :'credit_card_expiration_month' => :'credit_card_expiration_month', :'credit_card_expiration_year' => :'credit_card_expiration_year', :'credit_card_type' => :'credit_card_type', :'custom_field1' => :'custom_field1', :'custom_field2' => :'custom_field2', :'custom_field3' => :'custom_field3', :'custom_field4' => :'custom_field4', :'custom_field5' => :'custom_field5', :'custom_field6' => :'custom_field6', :'custom_field7' => :'custom_field7', :'delivery_date' => :'delivery_date', :'email' => :'email', :'gift' => :'gift', :'gift_email' => :'gift_email', :'gift_message' => :'gift_message', :'hosted_fields_card_token' => :'hosted_fields_card_token', :'hosted_fields_cvv_token' => :'hosted_fields_cvv_token', :'insurance_application_id' => :'insurance_application_id', :'insurance_claim_id' => :'insurance_claim_id', :'ip_address' => :'ip_address', :'items' => :'items', :'least_cost_route' => :'least_cost_route', :'least_cost_route_shipping_methods' => :'least_cost_route_shipping_methods', :'mailing_list_opt_in' => :'mailing_list_opt_in', :'no_realtime_payment_processing' => :'no_realtime_payment_processing', :'payment_method' => :'payment_method', :'purchase_order_number' => :'purchase_order_number', :'rotating_transaction_gateway_code' => :'rotating_transaction_gateway_code', :'screen_branding_theme_code' => :'screen_branding_theme_code', :'ship_on_date' => :'ship_on_date', :'ship_to_residential' => :'ship_to_residential', :'shipping_method' => :'shipping_method', :'shipto_address1' => :'shipto_address1', :'shipto_address2' => :'shipto_address2', :'shipto_city' => :'shipto_city', :'shipto_company' => :'shipto_company', :'shipto_country_code' => :'shipto_country_code', :'shipto_day_phone' => :'shipto_day_phone', :'shipto_evening_phone' => :'shipto_evening_phone', :'shipto_first_name' => :'shipto_first_name', :'shipto_last_name' => :'shipto_last_name', :'shipto_postal_code' => :'shipto_postal_code', :'shipto_state_region' => :'shipto_state_region', :'shipto_title' => :'shipto_title', :'skip_payment_processing' => :'skip_payment_processing', :'special_instructions' => :'special_instructions', :'store_completed' => :'store_completed', :'store_if_payment_declines' => :'store_if_payment_declines', :'tax_county' => :'tax_county', :'tax_exempt' => :'tax_exempt', :'transaction' => :'transaction', :'treat_warnings_as_errors' => :'treat_warnings_as_errors' } 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 { :'advertising_source' => :'String', :'affiliate_id' => :'String', :'affiliate_sub_id' => :'String', :'arbitrary_shipping_handling_total' => :'Float', :'arbitrary_tax' => :'Float', :'arbitrary_tax_rate' => :'Float', :'arbitrary_taxable_subtotal' => :'Float', :'associate_with_customer_profile_if_present' => :'Boolean', :'auto_approve_purchase_order' => :'Boolean', :'billto_address1' => :'String', :'billto_address2' => :'String', :'billto_city' => :'String', :'billto_company' => :'String', :'billto_country_code' => :'String', :'billto_day_phone' => :'String', :'billto_evening_phone' => :'String', :'billto_first_name' => :'String', :'billto_last_name' => :'String', :'billto_postal_code' => :'String', :'billto_state_region' => :'String', :'billto_title' => :'String', :'cc_email' => :'String', :'channel_partner_order_id' => :'String', :'consider_recurring' => :'Boolean', :'coupons' => :'Array', :'credit_card_authorization_amount' => :'Float', :'credit_card_authorization_dts' => :'String', :'credit_card_authorization_number' => :'String', :'credit_card_expiration_month' => :'Integer', :'credit_card_expiration_year' => :'Integer', :'credit_card_type' => :'String', :'custom_field1' => :'String', :'custom_field2' => :'String', :'custom_field3' => :'String', :'custom_field4' => :'String', :'custom_field5' => :'String', :'custom_field6' => :'String', :'custom_field7' => :'String', :'delivery_date' => :'String', :'email' => :'String', :'gift' => :'Boolean', :'gift_email' => :'String', :'gift_message' => :'String', :'hosted_fields_card_token' => :'String', :'hosted_fields_cvv_token' => :'String', :'insurance_application_id' => :'String', :'insurance_claim_id' => :'String', :'ip_address' => :'String', :'items' => :'Array', :'least_cost_route' => :'Boolean', :'least_cost_route_shipping_methods' => :'Array', :'mailing_list_opt_in' => :'Boolean', :'no_realtime_payment_processing' => :'Boolean', :'payment_method' => :'String', :'purchase_order_number' => :'String', :'rotating_transaction_gateway_code' => :'String', :'screen_branding_theme_code' => :'String', :'ship_on_date' => :'String', :'ship_to_residential' => :'Boolean', :'shipping_method' => :'String', :'shipto_address1' => :'String', :'shipto_address2' => :'String', :'shipto_city' => :'String', :'shipto_company' => :'String', :'shipto_country_code' => :'String', :'shipto_day_phone' => :'String', :'shipto_evening_phone' => :'String', :'shipto_first_name' => :'String', :'shipto_last_name' => :'String', :'shipto_postal_code' => :'String', :'shipto_state_region' => :'String', :'shipto_title' => :'String', :'skip_payment_processing' => :'Boolean', :'special_instructions' => :'String', :'store_completed' => :'Boolean', :'store_if_payment_declines' => :'Boolean', :'tax_county' => :'String', :'tax_exempt' => :'Boolean', :'transaction' => :'ChannelPartnerOrderTransaction', :'treat_warnings_as_errors' => :'Boolean' } 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::ChannelPartnerOrder` 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::ChannelPartnerOrder`. 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?(:'advertising_source') self.advertising_source = attributes[:'advertising_source'] end if attributes.key?(:'affiliate_id') self.affiliate_id = attributes[:'affiliate_id'] end if attributes.key?(:'affiliate_sub_id') self.affiliate_sub_id = attributes[:'affiliate_sub_id'] end if attributes.key?(:'arbitrary_shipping_handling_total') self.arbitrary_shipping_handling_total = attributes[:'arbitrary_shipping_handling_total'] end if attributes.key?(:'arbitrary_tax') self.arbitrary_tax = attributes[:'arbitrary_tax'] end if attributes.key?(:'arbitrary_tax_rate') self.arbitrary_tax_rate = attributes[:'arbitrary_tax_rate'] end if attributes.key?(:'arbitrary_taxable_subtotal') self.arbitrary_taxable_subtotal = attributes[:'arbitrary_taxable_subtotal'] end if attributes.key?(:'associate_with_customer_profile_if_present') self.associate_with_customer_profile_if_present = attributes[:'associate_with_customer_profile_if_present'] end if attributes.key?(:'auto_approve_purchase_order') self.auto_approve_purchase_order = attributes[:'auto_approve_purchase_order'] end if attributes.key?(:'billto_address1') self.billto_address1 = attributes[:'billto_address1'] end if attributes.key?(:'billto_address2') self.billto_address2 = attributes[:'billto_address2'] end if attributes.key?(:'billto_city') self.billto_city = attributes[:'billto_city'] end if attributes.key?(:'billto_company') self.billto_company = attributes[:'billto_company'] end if attributes.key?(:'billto_country_code') self.billto_country_code = attributes[:'billto_country_code'] end if attributes.key?(:'billto_day_phone') self.billto_day_phone = attributes[:'billto_day_phone'] end if attributes.key?(:'billto_evening_phone') self.billto_evening_phone = attributes[:'billto_evening_phone'] end if attributes.key?(:'billto_first_name') self.billto_first_name = attributes[:'billto_first_name'] end if attributes.key?(:'billto_last_name') self.billto_last_name = attributes[:'billto_last_name'] end if attributes.key?(:'billto_postal_code') self.billto_postal_code = attributes[:'billto_postal_code'] end if attributes.key?(:'billto_state_region') self.billto_state_region = attributes[:'billto_state_region'] end if attributes.key?(:'billto_title') self.billto_title = attributes[:'billto_title'] end if attributes.key?(:'cc_email') self.cc_email = attributes[:'cc_email'] end if attributes.key?(:'channel_partner_order_id') self.channel_partner_order_id = attributes[:'channel_partner_order_id'] end if attributes.key?(:'consider_recurring') self.consider_recurring = attributes[:'consider_recurring'] end if attributes.key?(:'coupons') if (value = attributes[:'coupons']).is_a?(Array) self.coupons = value end end if attributes.key?(:'credit_card_authorization_amount') self.credit_card_authorization_amount = attributes[:'credit_card_authorization_amount'] end if attributes.key?(:'credit_card_authorization_dts') self.credit_card_authorization_dts = attributes[:'credit_card_authorization_dts'] end if attributes.key?(:'credit_card_authorization_number') self.credit_card_authorization_number = attributes[:'credit_card_authorization_number'] end if attributes.key?(:'credit_card_expiration_month') self.credit_card_expiration_month = attributes[:'credit_card_expiration_month'] end if attributes.key?(:'credit_card_expiration_year') self.credit_card_expiration_year = attributes[:'credit_card_expiration_year'] end if attributes.key?(:'credit_card_type') self.credit_card_type = attributes[:'credit_card_type'] end if attributes.key?(:'custom_field1') self.custom_field1 = attributes[:'custom_field1'] end if attributes.key?(:'custom_field2') self.custom_field2 = attributes[:'custom_field2'] end if attributes.key?(:'custom_field3') self.custom_field3 = attributes[:'custom_field3'] end if attributes.key?(:'custom_field4') self.custom_field4 = attributes[:'custom_field4'] end if attributes.key?(:'custom_field5') self.custom_field5 = attributes[:'custom_field5'] end if attributes.key?(:'custom_field6') self.custom_field6 = attributes[:'custom_field6'] end if attributes.key?(:'custom_field7') self.custom_field7 = attributes[:'custom_field7'] end if attributes.key?(:'delivery_date') self.delivery_date = attributes[:'delivery_date'] end if attributes.key?(:'email') self.email = attributes[:'email'] end if attributes.key?(:'gift') self.gift = attributes[:'gift'] end if attributes.key?(:'gift_email') self.gift_email = attributes[:'gift_email'] end if attributes.key?(:'gift_message') self.gift_message = attributes[:'gift_message'] end if attributes.key?(:'hosted_fields_card_token') self.hosted_fields_card_token = attributes[:'hosted_fields_card_token'] end if attributes.key?(:'hosted_fields_cvv_token') self.hosted_fields_cvv_token = attributes[:'hosted_fields_cvv_token'] end if attributes.key?(:'insurance_application_id') self.insurance_application_id = attributes[:'insurance_application_id'] end if attributes.key?(:'insurance_claim_id') self.insurance_claim_id = attributes[:'insurance_claim_id'] end if attributes.key?(:'ip_address') self.ip_address = attributes[:'ip_address'] end if attributes.key?(:'items') if (value = attributes[:'items']).is_a?(Array) self.items = value end end if attributes.key?(:'least_cost_route') self.least_cost_route = attributes[:'least_cost_route'] end if attributes.key?(:'least_cost_route_shipping_methods') if (value = attributes[:'least_cost_route_shipping_methods']).is_a?(Array) self.least_cost_route_shipping_methods = value end end if attributes.key?(:'mailing_list_opt_in') self.mailing_list_opt_in = attributes[:'mailing_list_opt_in'] end if attributes.key?(:'no_realtime_payment_processing') self.no_realtime_payment_processing = attributes[:'no_realtime_payment_processing'] end if attributes.key?(:'payment_method') self.payment_method = attributes[:'payment_method'] end if attributes.key?(:'purchase_order_number') self.purchase_order_number = attributes[:'purchase_order_number'] end if attributes.key?(:'rotating_transaction_gateway_code') self.rotating_transaction_gateway_code = attributes[:'rotating_transaction_gateway_code'] end if attributes.key?(:'screen_branding_theme_code') self.screen_branding_theme_code = attributes[:'screen_branding_theme_code'] end if attributes.key?(:'ship_on_date') self.ship_on_date = attributes[:'ship_on_date'] end if attributes.key?(:'ship_to_residential') self.ship_to_residential = attributes[:'ship_to_residential'] end if attributes.key?(:'shipping_method') self.shipping_method = attributes[:'shipping_method'] end if attributes.key?(:'shipto_address1') self.shipto_address1 = attributes[:'shipto_address1'] end if attributes.key?(:'shipto_address2') self.shipto_address2 = attributes[:'shipto_address2'] end if attributes.key?(:'shipto_city') self.shipto_city = attributes[:'shipto_city'] end if attributes.key?(:'shipto_company') self.shipto_company = attributes[:'shipto_company'] end if attributes.key?(:'shipto_country_code') self.shipto_country_code = attributes[:'shipto_country_code'] end if attributes.key?(:'shipto_day_phone') self.shipto_day_phone = attributes[:'shipto_day_phone'] end if attributes.key?(:'shipto_evening_phone') self.shipto_evening_phone = attributes[:'shipto_evening_phone'] end if attributes.key?(:'shipto_first_name') self.shipto_first_name = attributes[:'shipto_first_name'] end if attributes.key?(:'shipto_last_name') self.shipto_last_name = attributes[:'shipto_last_name'] end if attributes.key?(:'shipto_postal_code') self.shipto_postal_code = attributes[:'shipto_postal_code'] end if attributes.key?(:'shipto_state_region') self.shipto_state_region = attributes[:'shipto_state_region'] end if attributes.key?(:'shipto_title') self.shipto_title = attributes[:'shipto_title'] end if attributes.key?(:'skip_payment_processing') self.skip_payment_processing = attributes[:'skip_payment_processing'] end if attributes.key?(:'special_instructions') self.special_instructions = attributes[:'special_instructions'] end if attributes.key?(:'store_completed') self.store_completed = attributes[:'store_completed'] end if attributes.key?(:'store_if_payment_declines') self.store_if_payment_declines = attributes[:'store_if_payment_declines'] end if attributes.key?(:'tax_county') self.tax_county = attributes[:'tax_county'] end if attributes.key?(:'tax_exempt') self.tax_exempt = attributes[:'tax_exempt'] end if attributes.key?(:'transaction') self.transaction = attributes[:'transaction'] end if attributes.key?(:'treat_warnings_as_errors') self.treat_warnings_as_errors = attributes[:'treat_warnings_as_errors'] 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 !@billto_address1.nil? && @billto_address1.to_s.length > 50 invalid_properties.push('invalid value for "billto_address1", the character length must be smaller than or equal to 50.') end if !@billto_address2.nil? && @billto_address2.to_s.length > 50 invalid_properties.push('invalid value for "billto_address2", the character length must be smaller than or equal to 50.') end if !@billto_city.nil? && @billto_city.to_s.length > 32 invalid_properties.push('invalid value for "billto_city", the character length must be smaller than or equal to 32.') end if !@billto_company.nil? && @billto_company.to_s.length > 50 invalid_properties.push('invalid value for "billto_company", the character length must be smaller than or equal to 50.') end if !@billto_country_code.nil? && @billto_country_code.to_s.length > 2 invalid_properties.push('invalid value for "billto_country_code", the character length must be smaller than or equal to 2.') end if !@billto_day_phone.nil? && @billto_day_phone.to_s.length > 25 invalid_properties.push('invalid value for "billto_day_phone", the character length must be smaller than or equal to 25.') end if !@billto_evening_phone.nil? && @billto_evening_phone.to_s.length > 25 invalid_properties.push('invalid value for "billto_evening_phone", the character length must be smaller than or equal to 25.') end if !@billto_first_name.nil? && @billto_first_name.to_s.length > 30 invalid_properties.push('invalid value for "billto_first_name", the character length must be smaller than or equal to 30.') end if !@billto_last_name.nil? && @billto_last_name.to_s.length > 30 invalid_properties.push('invalid value for "billto_last_name", the character length must be smaller than or equal to 30.') end if !@billto_postal_code.nil? && @billto_postal_code.to_s.length > 20 invalid_properties.push('invalid value for "billto_postal_code", the character length must be smaller than or equal to 20.') end if !@billto_state_region.nil? && @billto_state_region.to_s.length > 32 invalid_properties.push('invalid value for "billto_state_region", the character length must be smaller than or equal to 32.') end if !@billto_title.nil? && @billto_title.to_s.length > 50 invalid_properties.push('invalid value for "billto_title", the character length must be smaller than or equal to 50.') end if !@cc_email.nil? && @cc_email.to_s.length > 100 invalid_properties.push('invalid value for "cc_email", the character length must be smaller than or equal to 100.') end if !@custom_field1.nil? && @custom_field1.to_s.length > 50 invalid_properties.push('invalid value for "custom_field1", the character length must be smaller than or equal to 50.') end if !@custom_field2.nil? && @custom_field2.to_s.length > 50 invalid_properties.push('invalid value for "custom_field2", the character length must be smaller than or equal to 50.') end if !@custom_field3.nil? && @custom_field3.to_s.length > 50 invalid_properties.push('invalid value for "custom_field3", the character length must be smaller than or equal to 50.') end if !@custom_field4.nil? && @custom_field4.to_s.length > 50 invalid_properties.push('invalid value for "custom_field4", the character length must be smaller than or equal to 50.') end if !@custom_field5.nil? && @custom_field5.to_s.length > 75 invalid_properties.push('invalid value for "custom_field5", the character length must be smaller than or equal to 75.') end if !@custom_field6.nil? && @custom_field6.to_s.length > 50 invalid_properties.push('invalid value for "custom_field6", the character length must be smaller than or equal to 50.') end if !@custom_field7.nil? && @custom_field7.to_s.length > 50 invalid_properties.push('invalid value for "custom_field7", the character length must be smaller than or equal to 50.') end if !@email.nil? && @email.to_s.length > 100 invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 100.') end if !@gift_email.nil? && @gift_email.to_s.length > 100 invalid_properties.push('invalid value for "gift_email", the character length must be smaller than or equal to 100.') end if !@gift_message.nil? && @gift_message.to_s.length > 10000 invalid_properties.push('invalid value for "gift_message", the character length must be smaller than or equal to 10000.') end if !@screen_branding_theme_code.nil? && @screen_branding_theme_code.to_s.length > 10 invalid_properties.push('invalid value for "screen_branding_theme_code", the character length must be smaller than or equal to 10.') end if !@shipto_address1.nil? && @shipto_address1.to_s.length > 50 invalid_properties.push('invalid value for "shipto_address1", the character length must be smaller than or equal to 50.') end if !@shipto_address2.nil? && @shipto_address2.to_s.length > 50 invalid_properties.push('invalid value for "shipto_address2", the character length must be smaller than or equal to 50.') end if !@shipto_city.nil? && @shipto_city.to_s.length > 32 invalid_properties.push('invalid value for "shipto_city", the character length must be smaller than or equal to 32.') end if !@shipto_company.nil? && @shipto_company.to_s.length > 50 invalid_properties.push('invalid value for "shipto_company", the character length must be smaller than or equal to 50.') end if !@shipto_country_code.nil? && @shipto_country_code.to_s.length > 2 invalid_properties.push('invalid value for "shipto_country_code", the character length must be smaller than or equal to 2.') end if !@shipto_day_phone.nil? && @shipto_day_phone.to_s.length > 25 invalid_properties.push('invalid value for "shipto_day_phone", the character length must be smaller than or equal to 25.') end if !@shipto_evening_phone.nil? && @shipto_evening_phone.to_s.length > 25 invalid_properties.push('invalid value for "shipto_evening_phone", the character length must be smaller than or equal to 25.') end if !@shipto_first_name.nil? && @shipto_first_name.to_s.length > 30 invalid_properties.push('invalid value for "shipto_first_name", the character length must be smaller than or equal to 30.') end if !@shipto_last_name.nil? && @shipto_last_name.to_s.length > 30 invalid_properties.push('invalid value for "shipto_last_name", the character length must be smaller than or equal to 30.') end if !@shipto_postal_code.nil? && @shipto_postal_code.to_s.length > 20 invalid_properties.push('invalid value for "shipto_postal_code", the character length must be smaller than or equal to 20.') end if !@shipto_state_region.nil? && @shipto_state_region.to_s.length > 32 invalid_properties.push('invalid value for "shipto_state_region", the character length must be smaller than or equal to 32.') end if !@shipto_title.nil? && @shipto_title.to_s.length > 50 invalid_properties.push('invalid value for "shipto_title", the character length must be smaller than or equal to 50.') end if !@special_instructions.nil? && @special_instructions.to_s.length > 10000 invalid_properties.push('invalid value for "special_instructions", the character length must be smaller than or equal to 10000.') 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 !@billto_address1.nil? && @billto_address1.to_s.length > 50 return false if !@billto_address2.nil? && @billto_address2.to_s.length > 50 return false if !@billto_city.nil? && @billto_city.to_s.length > 32 return false if !@billto_company.nil? && @billto_company.to_s.length > 50 return false if !@billto_country_code.nil? && @billto_country_code.to_s.length > 2 return false if !@billto_day_phone.nil? && @billto_day_phone.to_s.length > 25 return false if !@billto_evening_phone.nil? && @billto_evening_phone.to_s.length > 25 return false if !@billto_first_name.nil? && @billto_first_name.to_s.length > 30 return false if !@billto_last_name.nil? && @billto_last_name.to_s.length > 30 return false if !@billto_postal_code.nil? && @billto_postal_code.to_s.length > 20 return false if !@billto_state_region.nil? && @billto_state_region.to_s.length > 32 return false if !@billto_title.nil? && @billto_title.to_s.length > 50 return false if !@cc_email.nil? && @cc_email.to_s.length > 100 return false if !@custom_field1.nil? && @custom_field1.to_s.length > 50 return false if !@custom_field2.nil? && @custom_field2.to_s.length > 50 return false if !@custom_field3.nil? && @custom_field3.to_s.length > 50 return false if !@custom_field4.nil? && @custom_field4.to_s.length > 50 return false if !@custom_field5.nil? && @custom_field5.to_s.length > 75 return false if !@custom_field6.nil? && @custom_field6.to_s.length > 50 return false if !@custom_field7.nil? && @custom_field7.to_s.length > 50 return false if !@email.nil? && @email.to_s.length > 100 return false if !@gift_email.nil? && @gift_email.to_s.length > 100 return false if !@gift_message.nil? && @gift_message.to_s.length > 10000 payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Check", "COD", "Credit Card", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Wire Transfer"]) return false unless payment_method_validator.valid?(@payment_method) return false if !@screen_branding_theme_code.nil? && @screen_branding_theme_code.to_s.length > 10 return false if !@shipto_address1.nil? && @shipto_address1.to_s.length > 50 return false if !@shipto_address2.nil? && @shipto_address2.to_s.length > 50 return false if !@shipto_city.nil? && @shipto_city.to_s.length > 32 return false if !@shipto_company.nil? && @shipto_company.to_s.length > 50 return false if !@shipto_country_code.nil? && @shipto_country_code.to_s.length > 2 return false if !@shipto_day_phone.nil? && @shipto_day_phone.to_s.length > 25 return false if !@shipto_evening_phone.nil? && @shipto_evening_phone.to_s.length > 25 return false if !@shipto_first_name.nil? && @shipto_first_name.to_s.length > 30 return false if !@shipto_last_name.nil? && @shipto_last_name.to_s.length > 30 return false if !@shipto_postal_code.nil? && @shipto_postal_code.to_s.length > 20 return false if !@shipto_state_region.nil? && @shipto_state_region.to_s.length > 32 return false if !@shipto_title.nil? && @shipto_title.to_s.length > 50 return false if !@special_instructions.nil? && @special_instructions.to_s.length > 10000 true end # Custom attribute writer method with validation # @param [Object] billto_address1 Value to be assigned def billto_address1=(billto_address1) if !billto_address1.nil? && billto_address1.to_s.length > 50 fail ArgumentError, 'invalid value for "billto_address1", the character length must be smaller than or equal to 50.' end @billto_address1 = billto_address1 end # Custom attribute writer method with validation # @param [Object] billto_address2 Value to be assigned def billto_address2=(billto_address2) if !billto_address2.nil? && billto_address2.to_s.length > 50 fail ArgumentError, 'invalid value for "billto_address2", the character length must be smaller than or equal to 50.' end @billto_address2 = billto_address2 end # Custom attribute writer method with validation # @param [Object] billto_city Value to be assigned def billto_city=(billto_city) if !billto_city.nil? && billto_city.to_s.length > 32 fail ArgumentError, 'invalid value for "billto_city", the character length must be smaller than or equal to 32.' end @billto_city = billto_city end # Custom attribute writer method with validation # @param [Object] billto_company Value to be assigned def billto_company=(billto_company) if !billto_company.nil? && billto_company.to_s.length > 50 fail ArgumentError, 'invalid value for "billto_company", the character length must be smaller than or equal to 50.' end @billto_company = billto_company end # Custom attribute writer method with validation # @param [Object] billto_country_code Value to be assigned def billto_country_code=(billto_country_code) if !billto_country_code.nil? && billto_country_code.to_s.length > 2 fail ArgumentError, 'invalid value for "billto_country_code", the character length must be smaller than or equal to 2.' end @billto_country_code = billto_country_code end # Custom attribute writer method with validation # @param [Object] billto_day_phone Value to be assigned def billto_day_phone=(billto_day_phone) if !billto_day_phone.nil? && billto_day_phone.to_s.length > 25 fail ArgumentError, 'invalid value for "billto_day_phone", the character length must be smaller than or equal to 25.' end @billto_day_phone = billto_day_phone end # Custom attribute writer method with validation # @param [Object] billto_evening_phone Value to be assigned def billto_evening_phone=(billto_evening_phone) if !billto_evening_phone.nil? && billto_evening_phone.to_s.length > 25 fail ArgumentError, 'invalid value for "billto_evening_phone", the character length must be smaller than or equal to 25.' end @billto_evening_phone = billto_evening_phone end # Custom attribute writer method with validation # @param [Object] billto_first_name Value to be assigned def billto_first_name=(billto_first_name) if !billto_first_name.nil? && billto_first_name.to_s.length > 30 fail ArgumentError, 'invalid value for "billto_first_name", the character length must be smaller than or equal to 30.' end @billto_first_name = billto_first_name end # Custom attribute writer method with validation # @param [Object] billto_last_name Value to be assigned def billto_last_name=(billto_last_name) if !billto_last_name.nil? && billto_last_name.to_s.length > 30 fail ArgumentError, 'invalid value for "billto_last_name", the character length must be smaller than or equal to 30.' end @billto_last_name = billto_last_name end # Custom attribute writer method with validation # @param [Object] billto_postal_code Value to be assigned def billto_postal_code=(billto_postal_code) if !billto_postal_code.nil? && billto_postal_code.to_s.length > 20 fail ArgumentError, 'invalid value for "billto_postal_code", the character length must be smaller than or equal to 20.' end @billto_postal_code = billto_postal_code end # Custom attribute writer method with validation # @param [Object] billto_state_region Value to be assigned def billto_state_region=(billto_state_region) if !billto_state_region.nil? && billto_state_region.to_s.length > 32 fail ArgumentError, 'invalid value for "billto_state_region", the character length must be smaller than or equal to 32.' end @billto_state_region = billto_state_region end # Custom attribute writer method with validation # @param [Object] billto_title Value to be assigned def billto_title=(billto_title) if !billto_title.nil? && billto_title.to_s.length > 50 fail ArgumentError, 'invalid value for "billto_title", the character length must be smaller than or equal to 50.' end @billto_title = billto_title end # Custom attribute writer method with validation # @param [Object] cc_email Value to be assigned def cc_email=(cc_email) if !cc_email.nil? && cc_email.to_s.length > 100 fail ArgumentError, 'invalid value for "cc_email", the character length must be smaller than or equal to 100.' end @cc_email = cc_email end # Custom attribute writer method with validation # @param [Object] custom_field1 Value to be assigned def custom_field1=(custom_field1) if !custom_field1.nil? && custom_field1.to_s.length > 50 fail ArgumentError, 'invalid value for "custom_field1", the character length must be smaller than or equal to 50.' end @custom_field1 = custom_field1 end # Custom attribute writer method with validation # @param [Object] custom_field2 Value to be assigned def custom_field2=(custom_field2) if !custom_field2.nil? && custom_field2.to_s.length > 50 fail ArgumentError, 'invalid value for "custom_field2", the character length must be smaller than or equal to 50.' end @custom_field2 = custom_field2 end # Custom attribute writer method with validation # @param [Object] custom_field3 Value to be assigned def custom_field3=(custom_field3) if !custom_field3.nil? && custom_field3.to_s.length > 50 fail ArgumentError, 'invalid value for "custom_field3", the character length must be smaller than or equal to 50.' end @custom_field3 = custom_field3 end # Custom attribute writer method with validation # @param [Object] custom_field4 Value to be assigned def custom_field4=(custom_field4) if !custom_field4.nil? && custom_field4.to_s.length > 50 fail ArgumentError, 'invalid value for "custom_field4", the character length must be smaller than or equal to 50.' end @custom_field4 = custom_field4 end # Custom attribute writer method with validation # @param [Object] custom_field5 Value to be assigned def custom_field5=(custom_field5) if !custom_field5.nil? && custom_field5.to_s.length > 75 fail ArgumentError, 'invalid value for "custom_field5", the character length must be smaller than or equal to 75.' end @custom_field5 = custom_field5 end # Custom attribute writer method with validation # @param [Object] custom_field6 Value to be assigned def custom_field6=(custom_field6) if !custom_field6.nil? && custom_field6.to_s.length > 50 fail ArgumentError, 'invalid value for "custom_field6", the character length must be smaller than or equal to 50.' end @custom_field6 = custom_field6 end # Custom attribute writer method with validation # @param [Object] custom_field7 Value to be assigned def custom_field7=(custom_field7) if !custom_field7.nil? && custom_field7.to_s.length > 50 fail ArgumentError, 'invalid value for "custom_field7", the character length must be smaller than or equal to 50.' end @custom_field7 = custom_field7 end # Custom attribute writer method with validation # @param [Object] email Value to be assigned def email=(email) if !email.nil? && email.to_s.length > 100 fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 100.' end @email = email end # Custom attribute writer method with validation # @param [Object] gift_email Value to be assigned def gift_email=(gift_email) if !gift_email.nil? && gift_email.to_s.length > 100 fail ArgumentError, 'invalid value for "gift_email", the character length must be smaller than or equal to 100.' end @gift_email = gift_email end # Custom attribute writer method with validation # @param [Object] gift_message Value to be assigned def gift_message=(gift_message) if !gift_message.nil? && gift_message.to_s.length > 10000 fail ArgumentError, 'invalid value for "gift_message", the character length must be smaller than or equal to 10000.' end @gift_message = gift_message end # Custom attribute writer method checking allowed values (enum). # @param [Object] payment_method Object to be assigned def payment_method=(payment_method) validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Check", "COD", "Credit Card", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Wire Transfer"]) unless validator.valid?(payment_method) fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}." end @payment_method = payment_method end # Custom attribute writer method with validation # @param [Object] screen_branding_theme_code Value to be assigned def screen_branding_theme_code=(screen_branding_theme_code) if !screen_branding_theme_code.nil? && screen_branding_theme_code.to_s.length > 10 fail ArgumentError, 'invalid value for "screen_branding_theme_code", the character length must be smaller than or equal to 10.' end @screen_branding_theme_code = screen_branding_theme_code end # Custom attribute writer method with validation # @param [Object] shipto_address1 Value to be assigned def shipto_address1=(shipto_address1) if !shipto_address1.nil? && shipto_address1.to_s.length > 50 fail ArgumentError, 'invalid value for "shipto_address1", the character length must be smaller than or equal to 50.' end @shipto_address1 = shipto_address1 end # Custom attribute writer method with validation # @param [Object] shipto_address2 Value to be assigned def shipto_address2=(shipto_address2) if !shipto_address2.nil? && shipto_address2.to_s.length > 50 fail ArgumentError, 'invalid value for "shipto_address2", the character length must be smaller than or equal to 50.' end @shipto_address2 = shipto_address2 end # Custom attribute writer method with validation # @param [Object] shipto_city Value to be assigned def shipto_city=(shipto_city) if !shipto_city.nil? && shipto_city.to_s.length > 32 fail ArgumentError, 'invalid value for "shipto_city", the character length must be smaller than or equal to 32.' end @shipto_city = shipto_city end # Custom attribute writer method with validation # @param [Object] shipto_company Value to be assigned def shipto_company=(shipto_company) if !shipto_company.nil? && shipto_company.to_s.length > 50 fail ArgumentError, 'invalid value for "shipto_company", the character length must be smaller than or equal to 50.' end @shipto_company = shipto_company end # Custom attribute writer method with validation # @param [Object] shipto_country_code Value to be assigned def shipto_country_code=(shipto_country_code) if !shipto_country_code.nil? && shipto_country_code.to_s.length > 2 fail ArgumentError, 'invalid value for "shipto_country_code", the character length must be smaller than or equal to 2.' end @shipto_country_code = shipto_country_code end # Custom attribute writer method with validation # @param [Object] shipto_day_phone Value to be assigned def shipto_day_phone=(shipto_day_phone) if !shipto_day_phone.nil? && shipto_day_phone.to_s.length > 25 fail ArgumentError, 'invalid value for "shipto_day_phone", the character length must be smaller than or equal to 25.' end @shipto_day_phone = shipto_day_phone end # Custom attribute writer method with validation # @param [Object] shipto_evening_phone Value to be assigned def shipto_evening_phone=(shipto_evening_phone) if !shipto_evening_phone.nil? && shipto_evening_phone.to_s.length > 25 fail ArgumentError, 'invalid value for "shipto_evening_phone", the character length must be smaller than or equal to 25.' end @shipto_evening_phone = shipto_evening_phone end # Custom attribute writer method with validation # @param [Object] shipto_first_name Value to be assigned def shipto_first_name=(shipto_first_name) if !shipto_first_name.nil? && shipto_first_name.to_s.length > 30 fail ArgumentError, 'invalid value for "shipto_first_name", the character length must be smaller than or equal to 30.' end @shipto_first_name = shipto_first_name end # Custom attribute writer method with validation # @param [Object] shipto_last_name Value to be assigned def shipto_last_name=(shipto_last_name) if !shipto_last_name.nil? && shipto_last_name.to_s.length > 30 fail ArgumentError, 'invalid value for "shipto_last_name", the character length must be smaller than or equal to 30.' end @shipto_last_name = shipto_last_name end # Custom attribute writer method with validation # @param [Object] shipto_postal_code Value to be assigned def shipto_postal_code=(shipto_postal_code) if !shipto_postal_code.nil? && shipto_postal_code.to_s.length > 20 fail ArgumentError, 'invalid value for "shipto_postal_code", the character length must be smaller than or equal to 20.' end @shipto_postal_code = shipto_postal_code end # Custom attribute writer method with validation # @param [Object] shipto_state_region Value to be assigned def shipto_state_region=(shipto_state_region) if !shipto_state_region.nil? && shipto_state_region.to_s.length > 32 fail ArgumentError, 'invalid value for "shipto_state_region", the character length must be smaller than or equal to 32.' end @shipto_state_region = shipto_state_region end # Custom attribute writer method with validation # @param [Object] shipto_title Value to be assigned def shipto_title=(shipto_title) if !shipto_title.nil? && shipto_title.to_s.length > 50 fail ArgumentError, 'invalid value for "shipto_title", the character length must be smaller than or equal to 50.' end @shipto_title = shipto_title end # Custom attribute writer method with validation # @param [Object] special_instructions Value to be assigned def special_instructions=(special_instructions) if !special_instructions.nil? && special_instructions.to_s.length > 10000 fail ArgumentError, 'invalid value for "special_instructions", the character length must be smaller than or equal to 10000.' end @special_instructions = special_instructions 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 && advertising_source == o.advertising_source && affiliate_id == o.affiliate_id && affiliate_sub_id == o.affiliate_sub_id && arbitrary_shipping_handling_total == o.arbitrary_shipping_handling_total && arbitrary_tax == o.arbitrary_tax && arbitrary_tax_rate == o.arbitrary_tax_rate && arbitrary_taxable_subtotal == o.arbitrary_taxable_subtotal && associate_with_customer_profile_if_present == o.associate_with_customer_profile_if_present && auto_approve_purchase_order == o.auto_approve_purchase_order && billto_address1 == o.billto_address1 && billto_address2 == o.billto_address2 && billto_city == o.billto_city && billto_company == o.billto_company && billto_country_code == o.billto_country_code && billto_day_phone == o.billto_day_phone && billto_evening_phone == o.billto_evening_phone && billto_first_name == o.billto_first_name && billto_last_name == o.billto_last_name && billto_postal_code == o.billto_postal_code && billto_state_region == o.billto_state_region && billto_title == o.billto_title && cc_email == o.cc_email && channel_partner_order_id == o.channel_partner_order_id && consider_recurring == o.consider_recurring && coupons == o.coupons && credit_card_authorization_amount == o.credit_card_authorization_amount && credit_card_authorization_dts == o.credit_card_authorization_dts && credit_card_authorization_number == o.credit_card_authorization_number && credit_card_expiration_month == o.credit_card_expiration_month && credit_card_expiration_year == o.credit_card_expiration_year && credit_card_type == o.credit_card_type && custom_field1 == o.custom_field1 && custom_field2 == o.custom_field2 && custom_field3 == o.custom_field3 && custom_field4 == o.custom_field4 && custom_field5 == o.custom_field5 && custom_field6 == o.custom_field6 && custom_field7 == o.custom_field7 && delivery_date == o.delivery_date && email == o.email && gift == o.gift && gift_email == o.gift_email && gift_message == o.gift_message && hosted_fields_card_token == o.hosted_fields_card_token && hosted_fields_cvv_token == o.hosted_fields_cvv_token && insurance_application_id == o.insurance_application_id && insurance_claim_id == o.insurance_claim_id && ip_address == o.ip_address && items == o.items && least_cost_route == o.least_cost_route && least_cost_route_shipping_methods == o.least_cost_route_shipping_methods && mailing_list_opt_in == o.mailing_list_opt_in && no_realtime_payment_processing == o.no_realtime_payment_processing && payment_method == o.payment_method && purchase_order_number == o.purchase_order_number && rotating_transaction_gateway_code == o.rotating_transaction_gateway_code && screen_branding_theme_code == o.screen_branding_theme_code && ship_on_date == o.ship_on_date && ship_to_residential == o.ship_to_residential && shipping_method == o.shipping_method && shipto_address1 == o.shipto_address1 && shipto_address2 == o.shipto_address2 && shipto_city == o.shipto_city && shipto_company == o.shipto_company && shipto_country_code == o.shipto_country_code && shipto_day_phone == o.shipto_day_phone && shipto_evening_phone == o.shipto_evening_phone && shipto_first_name == o.shipto_first_name && shipto_last_name == o.shipto_last_name && shipto_postal_code == o.shipto_postal_code && shipto_state_region == o.shipto_state_region && shipto_title == o.shipto_title && skip_payment_processing == o.skip_payment_processing && special_instructions == o.special_instructions && store_completed == o.store_completed && store_if_payment_declines == o.store_if_payment_declines && tax_county == o.tax_county && tax_exempt == o.tax_exempt && transaction == o.transaction && treat_warnings_as_errors == o.treat_warnings_as_errors 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 [advertising_source, affiliate_id, affiliate_sub_id, arbitrary_shipping_handling_total, arbitrary_tax, arbitrary_tax_rate, arbitrary_taxable_subtotal, associate_with_customer_profile_if_present, auto_approve_purchase_order, billto_address1, billto_address2, billto_city, billto_company, billto_country_code, billto_day_phone, billto_evening_phone, billto_first_name, billto_last_name, billto_postal_code, billto_state_region, billto_title, cc_email, channel_partner_order_id, consider_recurring, coupons, credit_card_authorization_amount, credit_card_authorization_dts, credit_card_authorization_number, credit_card_expiration_month, credit_card_expiration_year, credit_card_type, custom_field1, custom_field2, custom_field3, custom_field4, custom_field5, custom_field6, custom_field7, delivery_date, email, gift, gift_email, gift_message, hosted_fields_card_token, hosted_fields_cvv_token, insurance_application_id, insurance_claim_id, ip_address, items, least_cost_route, least_cost_route_shipping_methods, mailing_list_opt_in, no_realtime_payment_processing, payment_method, purchase_order_number, rotating_transaction_gateway_code, screen_branding_theme_code, ship_on_date, ship_to_residential, shipping_method, shipto_address1, shipto_address2, shipto_city, shipto_company, shipto_country_code, shipto_day_phone, shipto_evening_phone, shipto_first_name, shipto_last_name, shipto_postal_code, shipto_state_region, shipto_title, skip_payment_processing, special_instructions, store_completed, store_if_payment_declines, tax_county, tax_exempt, transaction, treat_warnings_as_errors].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