Class: Io::Flow::V0::Clients::ExperienceLogisticsSettings

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ExperienceLogisticsSettings

Returns a new instance of ExperienceLogisticsSettings.



1579
1580
1581
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 1579

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

Instance Method Details

#get(organization, experience_key) ⇒ Object



1583
1584
1585
1586
1587
1588
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 1583

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/logistics").get
  ::Io::Flow::V0::Models::ExperienceLogisticsSettings.new(r)
end

#put(organization, experience_key, experience_logistics_settings_put_form, incoming = {}) ⇒ Object



1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 1590

def put(organization, experience_key, experience_logistics_settings_put_form, incoming={})
  HttpClient::Preconditions.assert_class('organization', organization, String)
  HttpClient::Preconditions.assert_class('experience_key', experience_key, String)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  query = {
    :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String))
  }.delete_if { |k, v| v.nil? }
  (x = experience_logistics_settings_put_form; x.is_a?(::Io::Flow::V0::Models::ExperienceLogisticsSettingsPutForm) ? x : ::Io::Flow::V0::Models::ExperienceLogisticsSettingsPutForm.new(x))
  r = @client.request("/#{CGI.escape(organization)}/experiences/#{CGI.escape(experience_key)}/settings/logistics").with_query(query).with_json(experience_logistics_settings_put_form.to_json).put
  ::Io::Flow::V0::Models::ExperienceLogisticsSettings.new(r)
end