=begin #UltraCart Rest API V2 #UltraCart REST API Version 2 OpenAPI spec version: 2.0.0 Contact: support@ultracart.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.15-SNAPSHOT =end require 'date' module UltracartClient class 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 # 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', :'transport' => :'transport' } end # Attribute type mapping. def self.swagger_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', :'transport' => :'String' } end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'address1') self.address1 = attributes[:'address1'] end if attributes.has_key?(:'address2') self.address2 = attributes[:'address2'] end if attributes.has_key?(:'city') self.city = attributes[:'city'] end if attributes.has_key?(:'code') self.code = attributes[:'code'] end if attributes.has_key?(:'country_code') self.country_code = attributes[:'country_code'] end if attributes.has_key?(:'default_center') self.default_center = attributes[:'default_center'] end if attributes.has_key?(:'default_handles_all_items') self.default_handles_all_items = attributes[:'default_handles_all_items'] end if attributes.has_key?(:'distribution_center_oid') self.distribution_center_oid = attributes[:'distribution_center_oid'] end if attributes.has_key?(:'duns') self.duns = attributes[:'duns'] end if attributes.has_key?(:'estimate_from_distribution_center_oid') self.estimate_from_distribution_center_oid = attributes[:'estimate_from_distribution_center_oid'] end if attributes.has_key?(:'ftp_password') self.ftp_password = attributes[:'ftp_password'] end if attributes.has_key?(:'hold_before_shipment_minutes') self.hold_before_shipment_minutes = attributes[:'hold_before_shipment_minutes'] end if attributes.has_key?(:'hold_before_transmission') self.hold_before_transmission = attributes[:'hold_before_transmission'] end if attributes.has_key?(:'holdAutoOrderBeforeShipmentMinutes') self.hold_auto_order_before_shipment_minutes = attributes[:'holdAutoOrderBeforeShipmentMinutes'] end if attributes.has_key?(:'latitude') self.latitude = attributes[:'latitude'] end if attributes.has_key?(:'longitude') self.longitude = attributes[:'longitude'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'no_customer_direct_shipments') self.no_customer_direct_shipments = attributes[:'no_customer_direct_shipments'] end if attributes.has_key?(:'no_split_shipment') self.no_split_shipment = attributes[:'no_split_shipment'] end if attributes.has_key?(:'postal_code') self.postal_code = attributes[:'postal_code'] end if attributes.has_key?(:'process_days') self.process_days = attributes[:'process_days'] end if attributes.has_key?(:'process_inventory_start_time') self.process_inventory_start_time = attributes[:'process_inventory_start_time'] end if attributes.has_key?(:'process_inventory_stop_time') self.process_inventory_stop_time = attributes[:'process_inventory_stop_time'] end if attributes.has_key?(:'require_asn') self.require_asn = attributes[:'require_asn'] end if attributes.has_key?(:'send_kit_instead_of_components') self.send_kit_instead_of_components = attributes[:'send_kit_instead_of_components'] end if attributes.has_key?(:'shipment_cutoff_time_friday') self.shipment_cutoff_time_friday = attributes[:'shipment_cutoff_time_friday'] end if attributes.has_key?(:'shipment_cutoff_time_monday') self.shipment_cutoff_time_monday = attributes[:'shipment_cutoff_time_monday'] end if attributes.has_key?(:'shipment_cutoff_time_saturday') self.shipment_cutoff_time_saturday = attributes[:'shipment_cutoff_time_saturday'] end if attributes.has_key?(:'shipment_cutoff_time_sunday') self.shipment_cutoff_time_sunday = attributes[:'shipment_cutoff_time_sunday'] end if attributes.has_key?(:'shipment_cutoff_time_thursday') self.shipment_cutoff_time_thursday = attributes[:'shipment_cutoff_time_thursday'] end if attributes.has_key?(:'shipment_cutoff_time_tuesday') self.shipment_cutoff_time_tuesday = attributes[:'shipment_cutoff_time_tuesday'] end if attributes.has_key?(:'shipment_cutoff_time_wednesday') self.shipment_cutoff_time_wednesday = attributes[:'shipment_cutoff_time_wednesday'] end if attributes.has_key?(:'state') self.state = attributes[:'state'] end if attributes.has_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 && 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 [Fixnum] 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, 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 build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end # Deserializes the data based on type # @param string type Data type # @param string value Value to be deserialized # @return [Object] Deserialized data def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?.+?), (?.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = UltracartClient.const_get(type).new temp_model.build_from_hash(value) end end # Returns the string representation of the object # @return [String] String presentation of the object def to_s to_hash.to_s end # to_body is an alias to to_hash (backward compatibility) # @return [Hash] Returns the object in the form of hash def to_body to_hash end # Returns the object in the form of hash # @return [Hash] Returns the object in the form of hash def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end # Outputs non-array value in the form of hash # For object, use to_hash. Otherwise, just return the value # @param [Object] value Any valid value # @return [Hash] Returns the value in the form of hash def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end end end