Class: Io::Flow::V0::Models::ThirdPartyLogisticsPartner

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ThirdPartyLogisticsPartner

Returns a new instance of ThirdPartyLogisticsPartner.



70415
70416
70417
70418
70419
70420
70421
70422
70423
70424
# 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

Instance Attribute Details

#center_idObject (readonly)

Returns the value of attribute center_id.



70413
70414
70415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70413

def center_id
  @center_id
end

#locationObject (readonly)

Returns the value of attribute location.



70413
70414
70415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70413

def location
  @location
end

#operations_contactObject (readonly)

Returns the value of attribute operations_contact.



70413
70414
70415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70413

def operations_contact
  @operations_contact
end

#scheduled_pickupsObject (readonly)

Returns the value of attribute scheduled_pickups.



70413
70414
70415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70413

def scheduled_pickups
  @scheduled_pickups
end

#warehouse_addressObject (readonly)

Returns the value of attribute warehouse_address.



70413
70414
70415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70413

def warehouse_address
  @warehouse_address
end

#warehouse_urlObject (readonly)

Returns the value of attribute warehouse_url.



70413
70414
70415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70413

def warehouse_url
  @warehouse_url
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



70430
70431
70432
# 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_hashObject



70434
70435
70436
70437
70438
70439
70440
70441
70442
70443
# 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_jsonObject



70426
70427
70428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70426

def to_json
  JSON.dump(to_hash)
end