Class: Coinbase::Client::TransferApi
- Inherits:
-
Object
- Object
- Coinbase::Client::TransferApi
- Defined in:
- lib/coinbase/client/api/transfer_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#build_transfer(network_id, address_id, amount, asset_id, destination, opts = {}) ⇒ Transfer
Build a new transfer Build a new transfer object without tracking anything server-side.
-
#build_transfer_with_http_info(network_id, address_id, amount, asset_id, destination, opts = {}) ⇒ Array<(Transfer, Integer, Hash)>
Build a new transfer Build a new transfer object without tracking anything server-side.
-
#initialize(api_client = ApiClient.default) ⇒ TransferApi
constructor
A new instance of TransferApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TransferApi
Returns a new instance of TransferApi.
19 20 21 |
# File 'lib/coinbase/client/api/transfer_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/coinbase/client/api/transfer_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#build_transfer(network_id, address_id, amount, asset_id, destination, opts = {}) ⇒ Transfer
Build a new transfer Build a new transfer object without tracking anything server-side.
31 32 33 34 |
# File 'lib/coinbase/client/api/transfer_api.rb', line 31 def build_transfer(network_id, address_id, amount, asset_id, destination, opts = {}) data, _status_code, _headers = build_transfer_with_http_info(network_id, address_id, amount, asset_id, destination, opts) data end |
#build_transfer_with_http_info(network_id, address_id, amount, asset_id, destination, opts = {}) ⇒ Array<(Transfer, Integer, Hash)>
Build a new transfer Build a new transfer object without tracking anything server-side.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/coinbase/client/api/transfer_api.rb', line 45 def build_transfer_with_http_info(network_id, address_id, amount, asset_id, destination, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransferApi.build_transfer ...' end # verify the required parameter 'network_id' is set if @api_client.config.client_side_validation && network_id.nil? fail ArgumentError, "Missing the required parameter 'network_id' when calling TransferApi.build_transfer" end # verify the required parameter 'address_id' is set if @api_client.config.client_side_validation && address_id.nil? fail ArgumentError, "Missing the required parameter 'address_id' when calling TransferApi.build_transfer" end # verify the required parameter 'amount' is set if @api_client.config.client_side_validation && amount.nil? fail ArgumentError, "Missing the required parameter 'amount' when calling TransferApi.build_transfer" end # verify the required parameter 'asset_id' is set if @api_client.config.client_side_validation && asset_id.nil? fail ArgumentError, "Missing the required parameter 'asset_id' when calling TransferApi.build_transfer" end # verify the required parameter 'destination' is set if @api_client.config.client_side_validation && destination.nil? fail ArgumentError, "Missing the required parameter 'destination' when calling TransferApi.build_transfer" end # resource path local_var_path = '/v1/transfers/build' # query parameters query_params = opts[:query_params] || {} query_params[:'network_id'] = network_id query_params[:'address_id'] = address_id query_params[:'amount'] = amount query_params[:'asset_id'] = asset_id query_params[:'destination'] = destination # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Transfer' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"TransferApi.build_transfer", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TransferApi#build_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |