class Io::Flow::V0::Models::ThirdPartyLogisticsPartner

Attributes

center_id[R]
location[R]
operations_contact[R]
scheduled_pickups[R]
warehouse_address[R]
warehouse_url[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 70415
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:warehouse_address, :operations_contact], 'ThirdPartyLogisticsPartner')
  @warehouse_address = (x = opts.delete(:warehouse_address); x.is_a?(::Io::Flow::V0::Models::MerchantOnboardingAddress) ? x : ::Io::Flow::V0::Models::MerchantOnboardingAddress.new(x))
  @warehouse_url = (x = opts.delete(:warehouse_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('warehouse_url', x, String))
  @location = (x = opts.delete(:location); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::MerchantOnboardingAddress) ? x : ::Io::Flow::V0::Models::MerchantOnboardingAddress.new(x)))
  @scheduled_pickups = (x = opts.delete(:scheduled_pickups); x.nil? ? nil : HttpClient::Preconditions.assert_class('scheduled_pickups', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OnboardingMerchantScheduledPickup) ? x : ::Io::Flow::V0::Models::OnboardingMerchantScheduledPickup.new(x)) })
  @operations_contact = (x = opts.delete(:operations_contact); x.is_a?(::Io::Flow::V0::Models::OperationsContact) ? x : ::Io::Flow::V0::Models::OperationsContact.new(x))
  @center_id = (x = opts.delete(:center_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('center_id', x, String))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 70430
def copy(incoming={})
  ThirdPartyLogisticsPartner.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 70434
def to_hash
  {
    :warehouse_address => warehouse_address.to_hash,
    :warehouse_url => warehouse_url,
    :location => location.nil? ? nil : location.to_hash,
    :scheduled_pickups => scheduled_pickups.nil? ? nil : scheduled_pickups.map { |o| o.to_hash },
    :operations_contact => operations_contact.to_hash,
    :center_id => center_id
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 70426
def to_json
  JSON.dump(to_hash)
end