Class: Io::Flow::V0::Models::OrganizationTokenReference
- Inherits:
-
TokenReference
- Object
- TokenReference
- Io::Flow::V0::Models::OrganizationTokenReference
- 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.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Attributes inherited from TokenReference
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrganizationTokenReference
constructor
A new instance of OrganizationTokenReference.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from TokenReference
Constructor Details
#initialize(incoming = {}) ⇒ OrganizationTokenReference
Returns a new instance of OrganizationTokenReference.
26155 26156 26157 26158 26159 26160 26161 26162 26163 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26155 def initialize(incoming={}) super(:discriminator => TokenReference::Types::ORGANIZATION_TOKEN_REFERENCE) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :organization, :environment, :user], 'OrganizationTokenReference') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @organization = (x = opts.delete(:organization); x.is_a?(::Io::Flow::V0::Models::OrganizationReference) ? x : ::Io::Flow::V0::Models::OrganizationReference.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.
26153 26154 26155 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26153 def environment @environment end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
26153 26154 26155 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26153 def id @id end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
26153 26154 26155 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26153 def organization @organization end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
26153 26154 26155 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26153 def user @user end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
26169 26170 26171 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26169 def copy(incoming={}) OrganizationTokenReference.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
26173 26174 26175 26176 26177 26178 26179 26180 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26173 def subtype_to_hash { :id => id, :organization => organization.to_hash, :environment => environment.value, :user => user.to_hash } end |
#to_json ⇒ Object
26165 26166 26167 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26165 def to_json JSON.dump(to_hash) end |