Class: Io::Flow::V0::Clients::TaxDutyQuotes

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ TaxDutyQuotes

Returns a new instance of TaxDutyQuotes.



5123
5124
5125
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5123

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

Instance Method Details

#post(organization, tax_duty_quote_form) ⇒ Object

Create and return a new tax duty quote.



5128
5129
5130
5131
5132
5133
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5128

def post(organization, tax_duty_quote_form)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  (x = tax_duty_quote_form; x.is_a?(::Io::Flow::V0::Models::TaxDutyQuoteForm) ? x : ::Io::Flow::V0::Models::TaxDutyQuoteForm.new(x))
  r = @client.request("/#{CGI.escape(organization)}/levy/quotes").with_json(tax_duty_quote_form.to_json).post
  ::Io::Flow::V0::Models::TaxDutyQuote.new(r)
end