Class: Io::Flow::V0::Clients::ExperienceCheckoutSettings

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ExperienceCheckoutSettings

Returns a new instance of ExperienceCheckoutSettings.



1456
1457
1458
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 1456

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

Instance Method Details

#get(organization, experience_key) ⇒ Object



1460
1461
1462
1463
1464
1465
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 1460

def get(organization, experience_key)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
  r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/settings/checkout").get
  ::Io::Flow::V0::Models::ExperienceCheckoutSettings.new(r)
end

#put(organization, experience_key, experience_checkout_settings_form) ⇒ Object



1467
1468
1469
1470
1471
1472
1473
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 1467

def put(organization, experience_key, experience_checkout_settings_form)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
  (x = experience_checkout_settings_form; x.is_a?(::Io::Flow::V0::Models::ExperienceCheckoutSettingsForm) ? x : ::Io::Flow::V0::Models::ExperienceCheckoutSettingsForm.new(x))
  r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/settings/checkout").with_json(experience_checkout_settings_form.to_json).put
  ::Io::Flow::V0::Models::ExperienceCheckoutSettings.new(r)
end