Class: TransferZero::CurrencyInfoApi

Inherits:
Object
  • Object
show all
Defined in:
lib/transferzero-sdk/api/currency_info_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CurrencyInfoApi

Returns a new instance of CurrencyInfoApi.



19
20
21
# File 'lib/transferzero-sdk/api/currency_info_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/transferzero-sdk/api/currency_info_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#info_currencies(opts = {}) ⇒ CurrencyListResponse

Getting a list of possible requested currencies Fetches a list of currencies available to use in other API requests. Usually the 3-character alpha ISO 4217 currency code (eg. USD) is used as the identifier.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



28
29
30
31
# File 'lib/transferzero-sdk/api/currency_info_api.rb', line 28

def info_currencies(opts = {})
  data, _status_code, _headers = info_currencies_with_http_info(opts)
  data
end

#info_currencies_in(opts = {}) ⇒ CurrencyExchangeListResponse

Getting a list of possible input currencies Fetches a list of currencies available to use as the input currency in other API requests. Usually the 3-character alpha ISO 4217 currency code (eg. USD) is used as the identifier. Use this endpoint to determine the current exchange rate from a specific input currency to any output currency that’s available.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sender_id (String)

    Allows the scoping of the results by `sender_id` (optional). Example: `/v1/info/currencies/in?sender_id=26ec8517-2f0d-48c0-b74f-0bccb9ab3a87`

Returns:



77
78
79
80
# File 'lib/transferzero-sdk/api/currency_info_api.rb', line 77

def info_currencies_in(opts = {})
  data, _status_code, _headers = info_currencies_in_with_http_info(opts)
  data
end

#info_currencies_in_with_http_info(opts = {}) ⇒ Array<(CurrencyExchangeListResponse, Fixnum, Hash)>

Getting a list of possible input currencies Fetches a list of currencies available to use as the input currency in other API requests. Usually the 3-character alpha ISO 4217 currency code (eg. USD) is used as the identifier. Use this endpoint to determine the current exchange rate from a specific input currency to any output currency that&#39;s available.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sender_id (String)

    Allows the scoping of the results by &#x60;sender_id&#x60; (optional). Example: &#x60;/v1/info/currencies/in?sender_id&#x3D;26ec8517-2f0d-48c0-b74f-0bccb9ab3a87&#x60;

Returns:



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
113
114
115
116
117
118
119
120
# File 'lib/transferzero-sdk/api/currency_info_api.rb', line 87

def info_currencies_in_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrencyInfoApi.info_currencies_in ...'
  end
  # resource path
  local_var_path = '/info/currencies/in'

  # query parameters
  query_params = {}
  query_params[:'sender_id'] = opts[:'sender_id'] if !opts[:'sender_id'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CurrencyExchangeListResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrencyInfoApi#info_currencies_in\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#info_currencies_out(opts = {}) ⇒ CurrencyExchangeListResponse

Getting a list of possible output currencies Fetches a list of currencies available to use as the output currency and their exchange rates against the available input currencies. Usually the 3-character alpha ISO 4217 currency code (eg. USD) is used as the identifier.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sender_id (String)

    Allows the scoping of the results by &#x60;sender_id&#x60; (optional). Example: &#x60;/v1/info/currencies/out?sender_id&#x3D;26ec8517-2f0d-48c0-b74f-0bccb9ab3a87&#x60;

Returns:



128
129
130
131
# File 'lib/transferzero-sdk/api/currency_info_api.rb', line 128

def info_currencies_out(opts = {})
  data, _status_code, _headers = info_currencies_out_with_http_info(opts)
  data
end

#info_currencies_out_with_http_info(opts = {}) ⇒ Array<(CurrencyExchangeListResponse, Fixnum, Hash)>

Getting a list of possible output currencies Fetches a list of currencies available to use as the output currency and their exchange rates against the available input currencies. Usually the 3-character alpha ISO 4217 currency code (eg. USD) is used as the identifier.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :sender_id (String)

    Allows the scoping of the results by &#x60;sender_id&#x60; (optional). Example: &#x60;/v1/info/currencies/out?sender_id&#x3D;26ec8517-2f0d-48c0-b74f-0bccb9ab3a87&#x60;

Returns:



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/transferzero-sdk/api/currency_info_api.rb', line 138

def info_currencies_out_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrencyInfoApi.info_currencies_out ...'
  end
  # resource path
  local_var_path = '/info/currencies/out'

  # query parameters
  query_params = {}
  query_params[:'sender_id'] = opts[:'sender_id'] if !opts[:'sender_id'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CurrencyExchangeListResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrencyInfoApi#info_currencies_out\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#info_currencies_with_http_info(opts = {}) ⇒ Array<(CurrencyListResponse, Fixnum, Hash)>

Getting a list of possible requested currencies Fetches a list of currencies available to use in other API requests. Usually the 3-character alpha ISO 4217 currency code (eg. USD) is used as the identifier.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CurrencyListResponse, Fixnum, Hash)>)

    CurrencyListResponse data, response status code and response headers



37
38
39
40
41
42
43
44
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
# File 'lib/transferzero-sdk/api/currency_info_api.rb', line 37

def info_currencies_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrencyInfoApi.info_currencies ...'
  end
  # resource path
  local_var_path = '/info/currencies'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CurrencyListResponse')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrencyInfoApi#info_currencies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end