class UltracartClient::DistributionCenter

Attributes

address1[RW]

Address line 1 of the distribution center

address2[RW]

Address line 2 of the distribution center

city[RW]

City of the distribution center

code[RW]

Unique code for this distribution center

country_code[RW]

Country code of the distribution center

default_center[RW]

True if this is the default distribution center on the account

default_handles_all_items[RW]

True if this distribution center handles all new items by default

distribution_center_oid[RW]

Distribution center object identifier

duns[RW]

DUNS number assigned to this distribution center (EDI)

estimate_from_distribution_center_oid[RW]

Estimate shipments for this distribution center as if they came from the other distribution center

ftp_password[RW]

Password associated with the virtual FTP

hold_auto_order_before_shipment_minutes[RW]
hold_before_shipment_minutes[RW]

The number of minutes to hold a shipment

hold_before_transmission[RW]

True if the shipment should be held before transmission and require a manual release

latitude[RW]

Latitude where the distribution center is located

longitude[RW]

Longitude where the distribution center is located

name[RW]

Name of this distribution center

no_customer_direct_shipments[RW]

True if this distribution center does not handle customer direct shipments

no_split_shipment[RW]

True if this distribution center is not allowed to participate in a split shipment.

postal_code[RW]

Postal code of the distribution center

process_days[RW]

The number of processing days required before an order ships

process_inventory_start_time[RW]

The time (EST) after which inventory updates will be processed

process_inventory_stop_time[RW]

The time (EST) before which inventory updates will be processed

require_asn[RW]

True if ASNs are required for this distribution center (EDI)

send_kit_instead_of_components[RW]

True if we should send the kit instead of the components

shipment_cutoff_time_friday[RW]

The time (EST) after which shipments will not be processed on Friday

shipment_cutoff_time_monday[RW]

The time (EST) after which shipments will not be processed on Monday

shipment_cutoff_time_saturday[RW]

The time (EST) after which shipments will not be processed on Saturday

shipment_cutoff_time_sunday[RW]

The time (EST) after which shipments will not be processed on Sunday

shipment_cutoff_time_thursday[RW]

The time (EST) after which shipments will not be processed on Thursday

shipment_cutoff_time_tuesday[RW]

The time (EST) after which shipments will not be processed on Tuesday

shipment_cutoff_time_wednesday[RW]

The time (EST) after which shipments will not be processed on Wednesday

state[RW]

State of the distribution center

transport[RW]

Transport mechanism for this distribution center

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/ultracart_api/models/distribution_center.rb, line 119
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
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/ultracart_api/models/distribution_center.rb, line 200
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
swagger_types() click to toggle source

Attribute type mapping.

# File lib/ultracart_api/models/distribution_center.rb, line 159
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

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/ultracart_api/models/distribution_center.rb, line 358
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
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/ultracart_api/models/distribution_center.rb, line 433
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<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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
_to_hash(value) click to toggle source

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

# File lib/ultracart_api/models/distribution_center.rb, line 499
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
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/ultracart_api/models/distribution_center.rb, line 412
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
eql?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/ultracart_api/models/distribution_center.rb, line 399
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/ultracart_api/models/distribution_center.rb, line 405
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
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/ultracart_api/models/distribution_center.rb, line 345
def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/ultracart_api/models/distribution_center.rb, line 479
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/ultracart_api/models/distribution_center.rb, line 485
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
to_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/ultracart_api/models/distribution_center.rb, line 473
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/ultracart_api/models/distribution_center.rb, line 352
def valid?
  true
end