Class: Io::Flow::V0::Clients::OrganizationTokenV2

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ OrganizationTokenV2

Returns a new instance of OrganizationTokenV2.



7376
7377
7378
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7376

def initialize(client)
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
end

Instance Method Details

#post(organization_token_form_v2) ⇒ Object

Creates an organization token



7381
7382
7383
7384
7385
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7381

def post(organization_token_form_v2)
  (x = organization_token_form_v2; x.is_a?(::Io::Flow::V0::Models::OrganizationTokenFormV2) ? x : ::Io::Flow::V0::Models::OrganizationTokenFormV2.new(x))
  r = @client.request("/tokens/channel/organization").with_json(organization_token_form_v2.to_json).post
  ::Io::Flow::V0::Models::OrganizationTokenV2.new(r)
end