Class: Io::Flow::V0::Clients::EcommercePlatforms
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::EcommercePlatforms
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
- #get(organization_id) ⇒ Object
-
#initialize(client) ⇒ EcommercePlatforms
constructor
A new instance of EcommercePlatforms.
- #put(organization_id, ecommerce_platform_form) ⇒ Object
Constructor Details
#initialize(client) ⇒ EcommercePlatforms
Returns a new instance of EcommercePlatforms.
6338 6339 6340 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6338 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#get(organization_id) ⇒ Object
6342 6343 6344 6345 6346 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6342 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
6348 6349 6350 6351 6352 6353 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6348 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 |