Class: Io::Flow::V0::Models::OrganizationTokenForm
- 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 organization.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
Attributes inherited from TokenForm
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrganizationTokenForm
constructor
A new instance of OrganizationTokenForm.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from TokenForm
Constructor Details
#initialize(incoming = {}) ⇒ OrganizationTokenForm
Returns a new instance of OrganizationTokenForm.
21671 21672 21673 21674 21675 21676 21677 21678 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21671 def initialize(incoming={}) super(:discriminator => TokenForm::Types::ORGANIZATION_TOKEN_FORM) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:organization, :environment], 'OrganizationTokenForm') @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), 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.
21669 21670 21671 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21669 def description @description end |
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
21669 21670 21671 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21669 def environment @environment end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
21669 21670 21671 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21669 def organization @organization end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
21684 21685 21686 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21684 def copy(incoming={}) OrganizationTokenForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
21688 21689 21690 21691 21692 21693 21694 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21688 def subtype_to_hash { :organization => organization, :environment => environment.value, :description => description } end |
#to_json ⇒ Object
21680 21681 21682 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21680 def to_json JSON.dump(to_hash) end |