Class: Io::Flow::V0::Clients::OrganizationDefaultConfigurations

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ OrganizationDefaultConfigurations

Returns a new instance of OrganizationDefaultConfigurations.



7702
7703
7704
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7702

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

Instance Method Details

#get(organization_id) ⇒ Object



7706
7707
7708
7709
7710
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7706

def get(organization_id)
  HttpClient::Preconditions.assert_class('organization_id', organization_id, String)
  r = @client.request("/#{CGI.escape(organization_id)}/default/configurations").get
  ::Io::Flow::V0::Models::OrganizationDefaultConfigurations.new(r)
end

#put_checkout(organization_id, organization_default_configurations_form) ⇒ Object

Update the default checkout configuration id for this organization



7713
7714
7715
7716
7717
7718
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7713

def put_checkout(organization_id, organization_default_configurations_form)
  HttpClient::Preconditions.assert_class('organization_id', organization_id, String)
  (x = organization_default_configurations_form; x.is_a?(::Io::Flow::V0::Models::OrganizationDefaultConfigurationsForm) ? x : ::Io::Flow::V0::Models::OrganizationDefaultConfigurationsForm.new(x))
  r = @client.request("/#{CGI.escape(organization_id)}/default/configurations/checkout").with_json(organization_default_configurations_form.to_json).put
  ::Io::Flow::V0::Models::OrganizationDefaultConfigurations.new(r)
end