9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
|
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9105
def get(organization, incoming={})
HttpClient::Preconditions.assert_class('organization', organization, String)
opts = HttpClient::Helper.symbolize_keys(incoming)
query = {
:id => (x = opts.delete(:id); x.nil? ? nil : HttpClient::Preconditions.assert_class('id', x, Array).map { |v| HttpClient::Preconditions.assert_class('id', v, String) }),
:statement_id => (x = opts.delete(:statement_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('statement_id', x, String)),
:since => (x = opts.delete(:since); x.nil? ? nil : HttpClient::Preconditions.assert_class('since', HttpClient::Helper.to_date_time_iso8601(x), DateTime)),
:updated_since => (x = opts.delete(:updated_since); x.nil? ? nil : HttpClient::Preconditions.assert_class('updated_since', HttpClient::Helper.to_date_time_iso8601(x), DateTime)),
:limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer),
:offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer),
:sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "-created_at" : x), String)
}.delete_if { |k, v| v.nil? }
r = @client.request("/#{CGI.escape(organization)}/billing/transactions").with_query(query).get
r.map { |x| ::Io::Flow::V0::Models::Transaction.new(x) }
end
|