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.



1723
1724
1725
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 1723

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

Instance Method Details

#get(organization, experience_key) ⇒ Object



1727
1728
1729
1730
1731
1732
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 1727

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



1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 1734

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