Class: Io::Flow::V0::Clients::SessionAuthorizations

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ SessionAuthorizations

Returns a new instance of SessionAuthorizations.



8317
8318
8319
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8317

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

Instance Method Details

#post(session_authorization_form) ⇒ Object



8321
8322
8323
8324
8325
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8321

def post(session_authorization_form)
  (x = session_authorization_form; x.is_a?(::Io::Flow::V0::Models::SessionAuthorizationForm) ? x : ::Io::Flow::V0::Models::SessionAuthorizationForm.new(x))
  r = @client.request("/authorizations/sessions").with_json(session_authorization_form.to_json).post
  ::Io::Flow::V0::Models::SessionAuthorization.from_json(r)
end