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.



7117
7118
7119
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7117

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

Instance Method Details

#get_by_id(organization, id) ⇒ Object



7128
7129
7130
7131
7132
7133
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7128

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



7121
7122
7123
7124
7125
7126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7121

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



7135
7136
7137
7138
7139
7140
7141
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7135

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