=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 DistributionCenter # Address line 1 of the distribution center attr_accessor :address1 # Address line 2 of the distribution center attr_accessor :address2 # City of the distribution center attr_accessor :city # Unique code for this distribution center attr_accessor :code # Country code of the distribution center attr_accessor :country_code # True if this is the default distribution center on the account attr_accessor :default_center # True if this distribution center handles all new items by default attr_accessor :default_handles_all_items # Distribution center object identifier attr_accessor :distribution_center_oid # DUNS number assigned to this distribution center (EDI) attr_accessor :duns # Estimate shipments for this distribution center as if they came from the other distribution center attr_accessor :estimate_from_distribution_center_oid # Password associated with the virtual FTP attr_accessor :ftp_password # The number of minutes to hold a shipment attr_accessor :hold_before_shipment_minutes # True if the shipment should be held before transmission and require a manual release attr_accessor :hold_before_transmission attr_accessor :hold_auto_order_before_shipment_minutes # Latitude where the distribution center is located attr_accessor :latitude # Longitude where the distribution center is located attr_accessor :longitude # Name of this distribution center attr_accessor :name # True if this distribution center does not handle customer direct shipments attr_accessor :no_customer_direct_shipments # True if this distribution center is not allowed to participate in a split shipment. attr_accessor :no_split_shipment # Postal code of the distribution center attr_accessor :postal_code # The number of processing days required before an order ships attr_accessor :process_days # The time (EST) after which inventory updates will be processed attr_accessor :process_inventory_start_time # The time (EST) before which inventory updates will be processed attr_accessor :process_inventory_stop_time # True if ASNs are required for this distribution center (EDI) attr_accessor :require_asn # True if we should send the kit instead of the components attr_accessor :send_kit_instead_of_components # The time (EST) after which shipments will not be processed on Friday attr_accessor :shipment_cutoff_time_friday # The time (EST) after which shipments will not be processed on Monday attr_accessor :shipment_cutoff_time_monday # The time (EST) after which shipments will not be processed on Saturday attr_accessor :shipment_cutoff_time_saturday # The time (EST) after which shipments will not be processed on Sunday attr_accessor :shipment_cutoff_time_sunday # The time (EST) after which shipments will not be processed on Thursday attr_accessor :shipment_cutoff_time_thursday # The time (EST) after which shipments will not be processed on Tuesday attr_accessor :shipment_cutoff_time_tuesday # The time (EST) after which shipments will not be processed on Wednesday attr_accessor :shipment_cutoff_time_wednesday # State of the distribution center attr_accessor :state # True if monetary amounts should be zeroed before transmission attr_accessor :transmit_blank_costs # Transport mechanism for this distribution center attr_accessor :transport # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'address1' => :'address1', :'address2' => :'address2', :'city' => :'city', :'code' => :'code', :'country_code' => :'country_code', :'default_center' => :'default_center', :'default_handles_all_items' => :'default_handles_all_items', :'distribution_center_oid' => :'distribution_center_oid', :'duns' => :'duns', :'estimate_from_distribution_center_oid' => :'estimate_from_distribution_center_oid', :'ftp_password' => :'ftp_password', :'hold_before_shipment_minutes' => :'hold_before_shipment_minutes', :'hold_before_transmission' => :'hold_before_transmission', :'hold_auto_order_before_shipment_minutes' => :'holdAutoOrderBeforeShipmentMinutes', :'latitude' => :'latitude', :'longitude' => :'longitude', :'name' => :'name', :'no_customer_direct_shipments' => :'no_customer_direct_shipments', :'no_split_shipment' => :'no_split_shipment', :'postal_code' => :'postal_code', :'process_days' => :'process_days', :'process_inventory_start_time' => :'process_inventory_start_time', :'process_inventory_stop_time' => :'process_inventory_stop_time', :'require_asn' => :'require_asn', :'send_kit_instead_of_components' => :'send_kit_instead_of_components', :'shipment_cutoff_time_friday' => :'shipment_cutoff_time_friday', :'shipment_cutoff_time_monday' => :'shipment_cutoff_time_monday', :'shipment_cutoff_time_saturday' => :'shipment_cutoff_time_saturday', :'shipment_cutoff_time_sunday' => :'shipment_cutoff_time_sunday', :'shipment_cutoff_time_thursday' => :'shipment_cutoff_time_thursday', :'shipment_cutoff_time_tuesday' => :'shipment_cutoff_time_tuesday', :'shipment_cutoff_time_wednesday' => :'shipment_cutoff_time_wednesday', :'state' => :'state', :'transmit_blank_costs' => :'transmit_blank_costs', :'transport' => :'transport' } 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 { :'address1' => :'String', :'address2' => :'String', :'city' => :'String', :'code' => :'String', :'country_code' => :'String', :'default_center' => :'Boolean', :'default_handles_all_items' => :'Boolean', :'distribution_center_oid' => :'Integer', :'duns' => :'String', :'estimate_from_distribution_center_oid' => :'Integer', :'ftp_password' => :'String', :'hold_before_shipment_minutes' => :'Integer', :'hold_before_transmission' => :'Boolean', :'hold_auto_order_before_shipment_minutes' => :'Integer', :'latitude' => :'Float', :'longitude' => :'Float', :'name' => :'String', :'no_customer_direct_shipments' => :'Boolean', :'no_split_shipment' => :'Boolean', :'postal_code' => :'String', :'process_days' => :'Integer', :'process_inventory_start_time' => :'String', :'process_inventory_stop_time' => :'String', :'require_asn' => :'Boolean', :'send_kit_instead_of_components' => :'Boolean', :'shipment_cutoff_time_friday' => :'String', :'shipment_cutoff_time_monday' => :'String', :'shipment_cutoff_time_saturday' => :'String', :'shipment_cutoff_time_sunday' => :'String', :'shipment_cutoff_time_thursday' => :'String', :'shipment_cutoff_time_tuesday' => :'String', :'shipment_cutoff_time_wednesday' => :'String', :'state' => :'String', :'transmit_blank_costs' => :'Boolean', :'transport' => :'String' } 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::DistributionCenter` 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::DistributionCenter`. 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?(:'address1') self.address1 = attributes[:'address1'] end if attributes.key?(:'address2') self.address2 = attributes[:'address2'] end if attributes.key?(:'city') self.city = attributes[:'city'] end if attributes.key?(:'code') self.code = attributes[:'code'] end if attributes.key?(:'country_code') self.country_code = attributes[:'country_code'] end if attributes.key?(:'default_center') self.default_center = attributes[:'default_center'] end if attributes.key?(:'default_handles_all_items') self.default_handles_all_items = attributes[:'default_handles_all_items'] end if attributes.key?(:'distribution_center_oid') self.distribution_center_oid = attributes[:'distribution_center_oid'] end if attributes.key?(:'duns') self.duns = attributes[:'duns'] end if attributes.key?(:'estimate_from_distribution_center_oid') self.estimate_from_distribution_center_oid = attributes[:'estimate_from_distribution_center_oid'] end if attributes.key?(:'ftp_password') self.ftp_password = attributes[:'ftp_password'] end if attributes.key?(:'hold_before_shipment_minutes') self.hold_before_shipment_minutes = attributes[:'hold_before_shipment_minutes'] end if attributes.key?(:'hold_before_transmission') self.hold_before_transmission = attributes[:'hold_before_transmission'] end if attributes.key?(:'hold_auto_order_before_shipment_minutes') self.hold_auto_order_before_shipment_minutes = attributes[:'hold_auto_order_before_shipment_minutes'] end if attributes.key?(:'latitude') self.latitude = attributes[:'latitude'] end if attributes.key?(:'longitude') self.longitude = attributes[:'longitude'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'no_customer_direct_shipments') self.no_customer_direct_shipments = attributes[:'no_customer_direct_shipments'] end if attributes.key?(:'no_split_shipment') self.no_split_shipment = attributes[:'no_split_shipment'] end if attributes.key?(:'postal_code') self.postal_code = attributes[:'postal_code'] end if attributes.key?(:'process_days') self.process_days = attributes[:'process_days'] end if attributes.key?(:'process_inventory_start_time') self.process_inventory_start_time = attributes[:'process_inventory_start_time'] end if attributes.key?(:'process_inventory_stop_time') self.process_inventory_stop_time = attributes[:'process_inventory_stop_time'] end if attributes.key?(:'require_asn') self.require_asn = attributes[:'require_asn'] end if attributes.key?(:'send_kit_instead_of_components') self.send_kit_instead_of_components = attributes[:'send_kit_instead_of_components'] end if attributes.key?(:'shipment_cutoff_time_friday') self.shipment_cutoff_time_friday = attributes[:'shipment_cutoff_time_friday'] end if attributes.key?(:'shipment_cutoff_time_monday') self.shipment_cutoff_time_monday = attributes[:'shipment_cutoff_time_monday'] end if attributes.key?(:'shipment_cutoff_time_saturday') self.shipment_cutoff_time_saturday = attributes[:'shipment_cutoff_time_saturday'] end if attributes.key?(:'shipment_cutoff_time_sunday') self.shipment_cutoff_time_sunday = attributes[:'shipment_cutoff_time_sunday'] end if attributes.key?(:'shipment_cutoff_time_thursday') self.shipment_cutoff_time_thursday = attributes[:'shipment_cutoff_time_thursday'] end if attributes.key?(:'shipment_cutoff_time_tuesday') self.shipment_cutoff_time_tuesday = attributes[:'shipment_cutoff_time_tuesday'] end if attributes.key?(:'shipment_cutoff_time_wednesday') self.shipment_cutoff_time_wednesday = attributes[:'shipment_cutoff_time_wednesday'] end if attributes.key?(:'state') self.state = attributes[:'state'] end if attributes.key?(:'transmit_blank_costs') self.transmit_blank_costs = attributes[:'transmit_blank_costs'] end if attributes.key?(:'transport') self.transport = attributes[:'transport'] 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 && address1 == o.address1 && address2 == o.address2 && city == o.city && code == o.code && country_code == o.country_code && default_center == o.default_center && default_handles_all_items == o.default_handles_all_items && distribution_center_oid == o.distribution_center_oid && duns == o.duns && estimate_from_distribution_center_oid == o.estimate_from_distribution_center_oid && ftp_password == o.ftp_password && hold_before_shipment_minutes == o.hold_before_shipment_minutes && hold_before_transmission == o.hold_before_transmission && hold_auto_order_before_shipment_minutes == o.hold_auto_order_before_shipment_minutes && latitude == o.latitude && longitude == o.longitude && name == o.name && no_customer_direct_shipments == o.no_customer_direct_shipments && no_split_shipment == o.no_split_shipment && postal_code == o.postal_code && process_days == o.process_days && process_inventory_start_time == o.process_inventory_start_time && process_inventory_stop_time == o.process_inventory_stop_time && require_asn == o.require_asn && send_kit_instead_of_components == o.send_kit_instead_of_components && shipment_cutoff_time_friday == o.shipment_cutoff_time_friday && shipment_cutoff_time_monday == o.shipment_cutoff_time_monday && shipment_cutoff_time_saturday == o.shipment_cutoff_time_saturday && shipment_cutoff_time_sunday == o.shipment_cutoff_time_sunday && shipment_cutoff_time_thursday == o.shipment_cutoff_time_thursday && shipment_cutoff_time_tuesday == o.shipment_cutoff_time_tuesday && shipment_cutoff_time_wednesday == o.shipment_cutoff_time_wednesday && state == o.state && transmit_blank_costs == o.transmit_blank_costs && transport == o.transport 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 [address1, address2, city, code, country_code, default_center, default_handles_all_items, distribution_center_oid, duns, estimate_from_distribution_center_oid, ftp_password, hold_before_shipment_minutes, hold_before_transmission, hold_auto_order_before_shipment_minutes, latitude, longitude, name, no_customer_direct_shipments, no_split_shipment, postal_code, process_days, process_inventory_start_time, process_inventory_stop_time, require_asn, send_kit_instead_of_components, shipment_cutoff_time_friday, shipment_cutoff_time_monday, shipment_cutoff_time_saturday, shipment_cutoff_time_sunday, shipment_cutoff_time_thursday, shipment_cutoff_time_tuesday, shipment_cutoff_time_wednesday, state, transmit_blank_costs, transport].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