Class: Io::Flow::V0::Clients::TaxSettings
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::TaxSettings
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
- #delete(organization) ⇒ Object
-
#get(organization) ⇒ Object
Returns the tax settings for the organization.
-
#initialize(client) ⇒ TaxSettings
constructor
A new instance of TaxSettings.
- #put(organization, tax_setting) ⇒ Object
Constructor Details
#initialize(client) ⇒ TaxSettings
Returns a new instance of TaxSettings.
7607 7608 7609 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7607 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#delete(organization) ⇒ Object
7625 7626 7627 7628 7629 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7625 def delete(organization) HttpClient::Preconditions.assert_class('organization', organization, String) r = @client.request("/#{CGI.escape(organization)}/tax/settings").delete nil end |
#get(organization) ⇒ Object
Returns the tax settings for the organization.
7612 7613 7614 7615 7616 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7612 def get(organization) HttpClient::Preconditions.assert_class('organization', organization, String) r = @client.request("/#{CGI.escape(organization)}/tax/settings").get ::Io::Flow::V0::Models::TaxSetting.from_json(r) end |
#put(organization, tax_setting) ⇒ Object
7618 7619 7620 7621 7622 7623 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7618 def put(organization, tax_setting) HttpClient::Preconditions.assert_class('organization', organization, String) (x = tax_setting; x.is_a?(::Io::Flow::V0::Models::TaxSetting) ? x : ::Io::Flow::V0::Models::TaxSetting.from_json(x)) r = @client.request("/#{CGI.escape(organization)}/tax/settings").with_json(tax_setting.to_json).put ::Io::Flow::V0::Models::TaxSetting.from_json(r) end |