Class: Io::Flow::V0::Clients::OrderQuotes

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ OrderQuotes

Returns a new instance of OrderQuotes.



7572
7573
7574
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7572

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

Instance Method Details

#get_by_id(organization, id) ⇒ Object



7583
7584
7585
7586
7587
7588
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7583

def get_by_id(organization, id)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  HttpClient::Preconditions.assert_class('id', id, String)
  r = @client.request("/#{CGI.escape(organization)}/order/quotes/#{CGI.escape(id)}").get
  ::Io::Flow::V0::Models::OrderQuote.new(r)
end

#post(organization, order_quote_put_form) ⇒ Object



7576
7577
7578
7579
7580
7581
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7576

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

#put_by_id(organization, id, order_quote_put_form) ⇒ Object



7590
7591
7592
7593
7594
7595
7596
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7590

def put_by_id(organization, id, order_quote_put_form)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  HttpClient::Preconditions.assert_class('id', id, String)
  (x = order_quote_put_form; x.is_a?(::Io::Flow::V0::Models::OrderQuotePutForm) ? x : ::Io::Flow::V0::Models::OrderQuotePutForm.new(x))
  r = @client.request("/#{CGI.escape(organization)}/order/quotes/#{CGI.escape(id)}").with_json(order_quote_put_form.to_json).put
  ::Io::Flow::V0::Models::OrderQuote.new(r)
end