Class: Io::Flow::V0::Models::PartnerCenter
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PartnerCenter
- 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
-
#fees ⇒ Object
readonly
Returns the value of attribute fees.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#partner_reference ⇒ Object
readonly
Returns the value of attribute partner_reference.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PartnerCenter
constructor
A new instance of PartnerCenter.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PartnerCenter
Returns a new instance of PartnerCenter.
31611 31612 31613 31614 31615 31616 31617 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31611 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
#fees ⇒ Object (readonly)
Returns the value of attribute fees.
31609 31610 31611 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31609 def fees @fees end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
31609 31610 31611 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31609 def number @number end |
#partner_reference ⇒ Object (readonly)
Returns the value of attribute partner_reference.
31609 31610 31611 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31609 def partner_reference @partner_reference end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
31623 31624 31625 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31623 def copy(incoming={}) PartnerCenter.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
31627 31628 31629 31630 31631 31632 31633 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31627 def to_hash { :partner_reference => partner_reference.to_hash, :number => number, :fees => fees.nil? ? nil : fees.map { |o| o.to_hash } } end |
#to_json ⇒ Object
31619 31620 31621 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31619 def to_json JSON.dump(to_hash) end |