Class: Io::Flow::V0::Models::OrganizationTokenV2Reference

Inherits:
TokenReference
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from TokenReference

#discriminator

Instance Method Summary collapse

Methods inherited from TokenReference

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ OrganizationTokenV2Reference

Returns a new instance of OrganizationTokenV2Reference.



55664
55665
55666
55667
55668
55669
55670
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55664

def initialize(incoming={})
  super(:discriminator => TokenReference::Types::ORGANIZATION_TOKEN_V2_REFERENCE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :organization], 'OrganizationTokenV2Reference')
  @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))
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



55662
55663
55664
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55662

def id
  @id
end

#organizationObject (readonly)

Returns the value of attribute organization.



55662
55663
55664
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55662

def organization
  @organization
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



55676
55677
55678
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55676

def copy(incoming={})
  OrganizationTokenV2Reference.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



55680
55681
55682
55683
55684
55685
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55680

def subtype_to_hash
  {
    :id => id,
    :organization => organization.to_hash
  }
end

#to_jsonObject



55672
55673
55674
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55672

def to_json
  JSON.dump(to_hash)
end