Class: Io::Flow::V0::Clients::ShippingConfigurationCopies

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ShippingConfigurationCopies

Returns a new instance of ShippingConfigurationCopies.



4813
4814
4815
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4813

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

Instance Method Details

#post_by_key(organization, key, shipping_configuration_copy_form) ⇒ Object



4817
4818
4819
4820
4821
4822
4823
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4817

def post_by_key(organization, key, shipping_configuration_copy_form)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  HttpClient::Preconditions.assert_class('key', key, String)
  (x = shipping_configuration_copy_form; x.is_a?(::Io::Flow::V0::Models::ShippingConfigurationCopyForm) ? x : ::Io::Flow::V0::Models::ShippingConfigurationCopyForm.new(x))
  r = @client.request("/#{CGI.escape(organization)}/shipping/configuration/copies/#{CGI.escape(key)}").with_json(shipping_configuration_copy_form.to_json).post
  ::Io::Flow::V0::Models::ShippingConfigurationCopy.new(r)
end