Class: Io::Flow::V0::Clients::ConsumerInvoiceDocuments

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

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ConsumerInvoiceDocuments

Returns a new instance of ConsumerInvoiceDocuments.



5678
5679
5680
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5678

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

Instance Method Details

#get_tokens_and_type_by_token_and_type(token, type, incoming = {}) ⇒ Object



5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5682

def get_tokens_and_type_by_token_and_type(token, type, incoming={})
  HttpClient::Preconditions.assert_class('token', token, String)
  (x = type; x.is_a?(::Io::Flow::V0::Models::ConsumerInvoiceDocumentType) ? x : ::Io::Flow::V0::Models::ConsumerInvoiceDocumentType.apply(x))
  opts = HttpClient::Helper.symbolize_keys(incoming)
  query = {
    :language => (x = opts.delete(:language); x.nil? ? nil : HttpClient::Preconditions.assert_class('language', x, String))
  }.delete_if { |k, v| v.nil? }
  r = @client.request("/consumer/invoice/document/tokens/#{CGI.escape(token)}/type/#{type.value}").with_query(query).get
  ::Io::Flow::V0::Models::ConsumerInvoiceDocument.new(r)
end