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.



6773
6774
6775
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6773

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

Instance Method Details

#get(organization_id) ⇒ Object



6777
6778
6779
6780
6781
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6777

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



6784
6785
6786
6787
6788
6789
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6784

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