Class: Io::Flow::V0::Models::OrganizationReference

Inherits:
ExpandableOrganization show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from ExpandableOrganization

#discriminator

Instance Method Summary collapse

Methods inherited from ExpandableOrganization

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ OrganizationReference

Returns a new instance of OrganizationReference.



29597
29598
29599
29600
29601
29602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29597

def initialize(incoming={})
  super(:discriminator => ExpandableOrganization::Types::ORGANIZATION_REFERENCE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id], 'OrganizationReference')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



29595
29596
29597
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29595

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29608
29609
29610
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29608

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

#subtype_to_hashObject



29612
29613
29614
29615
29616
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29612

def subtype_to_hash
  {
    :id => id
  }
end

#to_jsonObject



29604
29605
29606
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29604

def to_json
  JSON.dump(to_hash)
end