Class: Io::Flow::V0::Models::PartnerTokenReference
- Inherits:
-
TokenReference
- Object
- TokenReference
- Io::Flow::V0::Models::PartnerTokenReference
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Summary data for a given token
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#partner ⇒ Object
readonly
Returns the value of attribute partner.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Attributes inherited from TokenReference
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PartnerTokenReference
constructor
A new instance of PartnerTokenReference.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from TokenReference
Constructor Details
#initialize(incoming = {}) ⇒ PartnerTokenReference
Returns a new instance of PartnerTokenReference.
20408 20409 20410 20411 20412 20413 20414 20415 20416 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20408 def initialize(incoming={}) super(:discriminator => TokenReference::Types::PARTNER_TOKEN_REFERENCE) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :partner, :environment, :user], 'PartnerTokenReference') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @partner = (x = opts.delete(:partner); x.is_a?(::Io::Flow::V0::Models::TokenPartnerReference) ? x : ::Io::Flow::V0::Models::TokenPartnerReference.new(x)) @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x)) @user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::UserReference) ? x : ::Io::Flow::V0::Models::UserReference.new(x)) end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
20406 20407 20408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20406 def environment @environment end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
20406 20407 20408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20406 def id @id end |
#partner ⇒ Object (readonly)
Returns the value of attribute partner.
20406 20407 20408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20406 def partner @partner end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
20406 20407 20408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20406 def user @user end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
20422 20423 20424 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20422 def copy(incoming={}) PartnerTokenReference.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
20426 20427 20428 20429 20430 20431 20432 20433 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20426 def subtype_to_hash { :id => id, :partner => partner.to_hash, :environment => environment.value, :user => user.to_hash } end |
#to_json ⇒ Object
20418 20419 20420 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20418 def to_json JSON.dump(to_hash) end |