class DwollaSwagger::TransfersApi
Public Class Methods
Get a transfer by id.
@param id ID of transfer to get. @param [Hash] opts the optional parameters @return [Transfer]
# File lib/dwolla_swagger/api/transfers_api.rb, line 155 def self.by_id(id, opts = {}) # verify the required parameter 'id' is set raise "Missing the required parameter 'id' when calling by_id" if id.nil? # resource path path = "/transfers/{id}".sub('{format}','json') # check if id parameter is resource URI, otherwise substitute for ID path = id =~ URI::regexp ? path.sub('{' + 'id' + '}', id.split('/')[-1].to_s) : path.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = Transfer.new() and obj.build_from_hash(response.body)) end
Create a new transfer.
@param [Hash] opts the optional parameters @option opts [TransferRequestBody] :body Transfer
request. @return [Unit]
# File lib/dwolla_swagger/api/transfers_api.rb, line 115 def self.create(opts = {}) # resource path path = "/transfers".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/vnd.dwolla.v1.hal+json'] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = Swagger::Request.object_to_http_body(opts[:'body']) response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = Unit.new() and obj.build_from_hash(response.body)) end
Get a bank transfer failure by transfer id.
@param id ID of failed bank transfer to get. @param [Hash] opts the optional parameters @return [TransferFailure]
# File lib/dwolla_swagger/api/transfers_api.rb, line 248 def self.failure_by_id(id, opts = {}) # verify the required parameter 'id' is set raise "Missing the required parameter 'id' when calling failure_by_id" if id.nil? # resource path path = "/transfers/{id}/failure".sub('{format}','json') # check if id parameter is resource URI, otherwise substitute for ID path = id =~ URI::regexp ? path.sub('{' + 'id' + '}', id.split('/')[-1].to_s) : path.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = TransferFailure.new() and obj.build_from_hash(response.body)) end
Get an account's transfers.
@param id Account id to get transfers for. @param [Hash] opts the optional parameters @option opts [int] :limit How many results to return. @option opts [int] :offset How many results to skip. @return [TransferListResponse]
# File lib/dwolla_swagger/api/transfers_api.rb, line 17 def self.get_account_transfers(id, opts = {}) # verify the required parameter 'id' is set raise "Missing the required parameter 'id' when calling get_account_transfers" if id.nil? # resource path path = "/accounts/{id}/transfers".sub('{format}','json') # check if id parameter is resource URI, otherwise substitute for ID path = id =~ URI::regexp ? path.sub('{' + 'id' + '}', id.split('/')[-1].to_s) : path.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'offset'] = opts[:'offset'] if opts[:'offset'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/vnd.dwolla.v1.hal+json'] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = TransferListResponse.new() and obj.build_from_hash(response.body)) end
Get a customer's transfers.
@param id Customer
id to get transfers for. @param [Hash] opts the optional parameters @option opts [int] :limit How many results to return. @option opts [int] :offset How many results to skip. @return [TransferListResponse]
# File lib/dwolla_swagger/api/transfers_api.rb, line 67 def self.get_customer_transfers(id, opts = {}) # verify the required parameter 'id' is set raise "Missing the required parameter 'id' when calling get_customer_transfers" if id.nil? # resource path path = "/customers/{id}/transfers".sub('{format}','json') # check if id parameter is resource URI, otherwise substitute for ID path = id =~ URI::regexp ? path.sub('{' + 'id' + '}', id.split('/')[-1].to_s) : path.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'offset'] = opts[:'offset'] if opts[:'offset'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/vnd.dwolla.v1.hal+json'] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = TransferListResponse.new() and obj.build_from_hash(response.body)) end
Get a transfer's fees.
@param id Transfer
id to get fees for. @param [Hash] opts the optional parameters @return [FeesBySourceResponse]
# File lib/dwolla_swagger/api/transfers_api.rb, line 294 def self.get_fees_by_source(id, opts = {}) # verify the required parameter 'id' is set raise "Missing the required parameter 'id' when calling get_fees_by_source" if id.nil? # resource path path = "/transfers/{id}/fees".sub('{format}','json') # check if id parameter is resource URI, otherwise substitute for ID path = id =~ URI::regexp ? path.sub('{' + 'id' + '}', id.split('/')[-1].to_s) : path.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/vnd.dwolla.v1.hal+json'] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil response = Swagger::Request.new(:GET, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = FeesBySourceResponse.new() and obj.build_from_hash(response.body)) end
Update a transfer.
@param id ID of transfer to get. @param [Hash] opts the optional parameters @option opts [UpdateTransfer] :body Transfer
to update. @return [Transfer]
# File lib/dwolla_swagger/api/transfers_api.rb, line 202 def self.update(id, opts = {}) # verify the required parameter 'id' is set raise "Missing the required parameter 'id' when calling update" if id.nil? # resource path path = "/transfers/{id}".sub('{format}','json') # check if id parameter is resource URI, otherwise substitute for ID path = id =~ URI::regexp ? path.sub('{' + 'id' + '}', id.split('/')[-1].to_s) : path.sub('{' + 'id' + '}', id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/vnd.dwolla.v1.hal+json'] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/vnd.dwolla.v1.hal+json'] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = Swagger::Request.object_to_http_body(opts[:'body']) response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => @auth_names}).make response.code == 201 ? obj = response.headers['Location'] : (obj = Transfer.new() and obj.build_from_hash(response.body)) end