Class: Io::Flow::V0::Clients::TaxSettings

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ TaxSettings

Returns a new instance of TaxSettings.



7087
7088
7089
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7087

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

Instance Method Details

#delete(organization) ⇒ Object



7105
7106
7107
7108
7109
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7105

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.



7092
7093
7094
7095
7096
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7092

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



7098
7099
7100
7101
7102
7103
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7098

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