Class: Io::Flow::V0::Models::PartnerCenter

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

Overview

Represents information about a partner (e.g. external 3PL) running the fulfillment center

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PartnerCenter

Returns a new instance of PartnerCenter.



43639
43640
43641
43642
43643
43644
43645
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43639

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:partner_reference], 'PartnerCenter')
  @partner_reference = (x = opts.delete(:partner_reference); x.is_a?(::Io::Flow::V0::Models::PartnerReference) ? x : ::Io::Flow::V0::Models::PartnerReference.new(x))
  @number = (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String))
  @fees = (x = opts.delete(:fees); x.nil? ? nil : HttpClient::Preconditions.assert_class('fees', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PartnerCenterFee) ? x : ::Io::Flow::V0::Models::PartnerCenterFee.from_json(x)) })
end

Instance Attribute Details

#feesObject (readonly)

Returns the value of attribute fees.



43637
43638
43639
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43637

def fees
  @fees
end

#numberObject (readonly)

Returns the value of attribute number.



43637
43638
43639
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43637

def number
  @number
end

#partner_referenceObject (readonly)

Returns the value of attribute partner_reference.



43637
43638
43639
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43637

def partner_reference
  @partner_reference
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



43651
43652
43653
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43651

def copy(incoming={})
  PartnerCenter.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



43655
43656
43657
43658
43659
43660
43661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43655

def to_hash
  {
    :partner_reference => partner_reference.to_hash,
    :number => number,
    :fees => fees.nil? ? nil : fees.map { |o| o.to_hash }
  }
end

#to_jsonObject



43647
43648
43649
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43647

def to_json
  JSON.dump(to_hash)
end