Class: Io::Flow::V0::Clients::EcommercePlatforms

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ EcommercePlatforms

Returns a new instance of EcommercePlatforms.



6764
6765
6766
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6764

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

Instance Method Details

#get(organization_id) ⇒ Object



6768
6769
6770
6771
6772
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6768

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

#put(organization_id, ecommerce_platform_form) ⇒ Object



6774
6775
6776
6777
6778
6779
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6774

def put(organization_id, ecommerce_platform_form)
  HttpClient::Preconditions.assert_class('organization_id', organization_id, String)
  (x = ecommerce_platform_form; x.is_a?(::Io::Flow::V0::Models::EcommercePlatformForm) ? x : ::Io::Flow::V0::Models::EcommercePlatformForm.new(x))
  r = @client.request("/organizations/#{CGI.escape(organization_id)}/ecommerce/platform").with_json(ecommerce_platform_form.to_json).put
  ::Io::Flow::V0::Models::EcommercePlatform.new(r)
end