Class: Io::Flow::V0::Models::PartnerTokenForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Used to create a new token. User making the request must be authorized to create a token for this partner.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#partner ⇒ Object
readonly
Returns the value of attribute partner.
Attributes inherited from TokenForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PartnerTokenForm
constructor
A new instance of PartnerTokenForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from TokenForm
Constructor Details
#initialize(incoming = {}) ⇒ PartnerTokenForm
Returns a new instance of PartnerTokenForm.
22393 22394 22395 22396 22397 22398 22399 22400 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22393 def initialize(incoming={}) super(:discriminator => TokenForm::Types::PARTNER_TOKEN_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:partner, :environment], 'PartnerTokenForm') @partner = HttpClient::Preconditions.assert_class('partner', opts.delete(:partner), String) @environment = (x = opts.delete(:environment); x.is_a?(::Io::Flow::V0::Models::Environment) ? x : ::Io::Flow::V0::Models::Environment.apply(x)) @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String)) end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
22391 22392 22393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22391 def description @description end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
22391 22392 22393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22391 def environment @environment end |
#partner ⇒ Object (readonly)
Returns the value of attribute partner.
22391 22392 22393 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22391 def partner @partner end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
22406 22407 22408 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22406 def copy(incoming={}) PartnerTokenForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
22410 22411 22412 22413 22414 22415 22416 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22410 def subtype_to_hash { :partner => partner, :environment => environment.value, :description => description } end |
#to_json ⇒ Object
22402 22403 22404 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22402 def to_json JSON.dump(to_hash) end |