Class: FireflyIIIClient::CurrenciesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/firefly_iii_client/api/currencies_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CurrenciesApi

Returns a new instance of CurrenciesApi.



19
20
21
# File 'lib/firefly_iii_client/api/currencies_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/firefly_iii_client/api/currencies_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#default_currency(code, opts = {}) ⇒ CurrencySingle

Make currency default currency. Make this currency the default currency. If the currency is not enabled, it will be enabled as well.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Returns:



27
28
29
30
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 27

def default_currency(code, opts = {})
  data, _status_code, _headers = default_currency_with_http_info(code, opts)
  data
end

#default_currency_with_http_info(code, opts = {}) ⇒ Array<(CurrencySingle, Integer, Hash)>

Make currency default currency. Make this currency the default currency. If the currency is not enabled, it will be enabled as well.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Returns:

  • (Array<(CurrencySingle, Integer, Hash)>)

    CurrencySingle 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 37

def default_currency_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.default_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.default_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}/default'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # 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] || 'CurrencySingle'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.default_currency",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#default_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_currency(code, opts = {}) ⇒ nil

Delete a currency. Delete a currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Returns:

  • (nil)


90
91
92
93
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 90

def delete_currency(code, opts = {})
  delete_currency_with_http_info(code, opts)
  nil
end

#delete_currency_with_http_info(code, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a currency. Delete a currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 100

def delete_currency_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.delete_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.delete_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.delete_currency",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#delete_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#disable_currency(code, opts = {}) ⇒ CurrencySingle

Disable a currency. Disable a currency.

Parameters:

  • code (Integer)

    The currency code.

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

    the optional parameters

Returns:



151
152
153
154
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 151

def disable_currency(code, opts = {})
  data, _status_code, _headers = disable_currency_with_http_info(code, opts)
  data
end

#disable_currency_with_http_info(code, opts = {}) ⇒ Array<(CurrencySingle, Integer, Hash)>

Disable a currency. Disable a currency.

Parameters:

  • code (Integer)

    The currency code.

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

    the optional parameters

Returns:

  • (Array<(CurrencySingle, Integer, Hash)>)

    CurrencySingle data, response status code and response headers



161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 161

def disable_currency_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.disable_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.disable_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}/disable'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # 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] || 'CurrencySingle'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.disable_currency",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#disable_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#enable_currency(code, opts = {}) ⇒ CurrencySingle

Enable a single currency. Enable a single currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Returns:



214
215
216
217
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 214

def enable_currency(code, opts = {})
  data, _status_code, _headers = enable_currency_with_http_info(code, opts)
  data
end

#enable_currency_with_http_info(code, opts = {}) ⇒ Array<(CurrencySingle, Integer, Hash)>

Enable a single currency. Enable a single currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Returns:

  • (Array<(CurrencySingle, Integer, Hash)>)

    CurrencySingle data, response status code and response headers



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 224

def enable_currency_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.enable_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.enable_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}/enable'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # 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] || 'CurrencySingle'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.enable_currency",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#enable_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_currency(code, opts = {}) ⇒ CurrencySingle

Get a single currency. Get a single currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Returns:



277
278
279
280
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 277

def get_currency(code, opts = {})
  data, _status_code, _headers = get_currency_with_http_info(code, opts)
  data
end

#get_currency_with_http_info(code, opts = {}) ⇒ Array<(CurrencySingle, Integer, Hash)>

Get a single currency. Get a single currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Returns:

  • (Array<(CurrencySingle, Integer, Hash)>)

    CurrencySingle data, response status code and response headers



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 287

def get_currency_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.get_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.get_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # 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] || 'CurrencySingle'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.get_currency",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#get_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_account_by_currency(code, opts = {}) ⇒ AccountArray

List all accounts with this currency. List all accounts with this currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50.

  • :date (String)

    A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account&#39;s balance on that day.

  • :type (AccountTypeFilter)

    Optional filter on the account type(s) returned

Returns:



343
344
345
346
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 343

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

#list_account_by_currency_with_http_info(code, opts = {}) ⇒ Array<(AccountArray, Integer, Hash)>

List all accounts with this currency. List all accounts with this currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50.

  • :date (String)

    A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account&#39;s balance on that day.

  • :type (AccountTypeFilter)

    Optional filter on the account type(s) returned

Returns:

  • (Array<(AccountArray, Integer, Hash)>)

    AccountArray data, response status code and response headers



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 356

def (code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.list_account_by_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.list_account_by_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}/accounts'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

  # 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] || 'AccountArray'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.list_account_by_currency",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#list_account_by_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_available_budget_by_currency(code, opts = {}) ⇒ AvailableBudgetArray

List all available budgets with this currency. List all available budgets with this currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50

Returns:



413
414
415
416
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 413

def list_available_budget_by_currency(code, opts = {})
  data, _status_code, _headers = list_available_budget_by_currency_with_http_info(code, opts)
  data
end

#list_available_budget_by_currency_with_http_info(code, opts = {}) ⇒ Array<(AvailableBudgetArray, Integer, Hash)>

List all available budgets with this currency. List all available budgets with this currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50

Returns:

  • (Array<(AvailableBudgetArray, Integer, Hash)>)

    AvailableBudgetArray data, response status code and response headers



424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 424

def list_available_budget_by_currency_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.list_available_budget_by_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.list_available_budget_by_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}/available_budgets'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

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

  # 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] || 'AvailableBudgetArray'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.list_available_budget_by_currency",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#list_available_budget_by_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_bill_by_currency(code, opts = {}) ⇒ BillArray

List all bills with this currency. List all bills with this currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50.

Returns:



479
480
481
482
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 479

def list_bill_by_currency(code, opts = {})
  data, _status_code, _headers = list_bill_by_currency_with_http_info(code, opts)
  data
end

#list_bill_by_currency_with_http_info(code, opts = {}) ⇒ Array<(BillArray, Integer, Hash)>

List all bills with this currency. List all bills with this currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50.

Returns:

  • (Array<(BillArray, Integer, Hash)>)

    BillArray data, response status code and response headers



490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 490

def list_bill_by_currency_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.list_bill_by_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.list_bill_by_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}/bills'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

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

  # 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] || 'BillArray'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.list_bill_by_currency",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#list_bill_by_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_budget_limit_by_currency(code, opts = {}) ⇒ BudgetLimitArray

List all budget limits with this currency List all budget limits with this currency

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50.

  • :start (Date)

    Start date for the budget limit list.

  • :_end (Date)

    End date for the budget limit list.

Returns:



547
548
549
550
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 547

def list_budget_limit_by_currency(code, opts = {})
  data, _status_code, _headers = list_budget_limit_by_currency_with_http_info(code, opts)
  data
end

#list_budget_limit_by_currency_with_http_info(code, opts = {}) ⇒ Array<(BudgetLimitArray, Integer, Hash)>

List all budget limits with this currency List all budget limits with this currency

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50.

  • :start (Date)

    Start date for the budget limit list.

  • :_end (Date)

    End date for the budget limit list.

Returns:

  • (Array<(BudgetLimitArray, Integer, Hash)>)

    BudgetLimitArray data, response status code and response headers



560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 560

def list_budget_limit_by_currency_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.list_budget_limit_by_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.list_budget_limit_by_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}/budget_limits'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil?

  # 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] || 'BudgetLimitArray'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.list_budget_limit_by_currency",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#list_budget_limit_by_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_currency(opts = {}) ⇒ CurrencyArray

List all currencies. List all currencies.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50.

Returns:



616
617
618
619
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 616

def list_currency(opts = {})
  data, _status_code, _headers = list_currency_with_http_info(opts)
  data
end

#list_currency_with_http_info(opts = {}) ⇒ Array<(CurrencyArray, Integer, Hash)>

List all currencies. List all currencies.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50.

Returns:

  • (Array<(CurrencyArray, Integer, Hash)>)

    CurrencyArray data, response status code and response headers



626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 626

def list_currency_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.list_currency ...'
  end
  # resource path
  local_var_path = '/api/v1/currencies'

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

  # 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] || 'CurrencyArray'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.list_currency",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#list_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_exchange_rate_by_currency(code, opts = {}) ⇒ ExchangeRateArray

List all known exchange rates with (from or to) this currency. List all known exchange rates.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50.

  • :date (Date)

    The date of which you want to know the exchange rate

  • :start (Date)

    Use this instead of the date parameter to search for a range of currency exchange values.

  • :_end (Date)

    Use this instead of the date parameter to search for a range of currency exchange values.

Returns:



680
681
682
683
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 680

def list_exchange_rate_by_currency(code, opts = {})
  data, _status_code, _headers = list_exchange_rate_by_currency_with_http_info(code, opts)
  data
end

#list_exchange_rate_by_currency_with_http_info(code, opts = {}) ⇒ Array<(ExchangeRateArray, Integer, Hash)>

List all known exchange rates with (from or to) this currency. List all known exchange rates.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50.

  • :date (Date)

    The date of which you want to know the exchange rate

  • :start (Date)

    Use this instead of the date parameter to search for a range of currency exchange values.

  • :_end (Date)

    Use this instead of the date parameter to search for a range of currency exchange values.

Returns:

  • (Array<(ExchangeRateArray, Integer, Hash)>)

    ExchangeRateArray data, response status code and response headers



694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 694

def list_exchange_rate_by_currency_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.list_exchange_rate_by_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.list_exchange_rate_by_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}/cer'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil?

  # 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] || 'ExchangeRateArray'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.list_exchange_rate_by_currency",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#list_exchange_rate_by_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_recurrence_by_currency(code, opts = {}) ⇒ RecurrenceArray

List all recurring transactions with this currency. List all recurring transactions with this currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50.

Returns:



752
753
754
755
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 752

def list_recurrence_by_currency(code, opts = {})
  data, _status_code, _headers = list_recurrence_by_currency_with_http_info(code, opts)
  data
end

#list_recurrence_by_currency_with_http_info(code, opts = {}) ⇒ Array<(RecurrenceArray, Integer, Hash)>

List all recurring transactions with this currency. List all recurring transactions with this currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is 50.

Returns:

  • (Array<(RecurrenceArray, Integer, Hash)>)

    RecurrenceArray data, response status code and response headers



763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 763

def list_recurrence_by_currency_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.list_recurrence_by_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.list_recurrence_by_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}/recurrences'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

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

  # 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] || 'RecurrenceArray'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.list_recurrence_by_currency",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#list_recurrence_by_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_rule_by_currency(code, opts = {}) ⇒ RuleArray

List all rules with this currency. List all rules with this currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination per 50.

Returns:



818
819
820
821
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 818

def list_rule_by_currency(code, opts = {})
  data, _status_code, _headers = list_rule_by_currency_with_http_info(code, opts)
  data
end

#list_rule_by_currency_with_http_info(code, opts = {}) ⇒ Array<(RuleArray, Integer, Hash)>

List all rules with this currency. List all rules with this currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination per 50.

Returns:

  • (Array<(RuleArray, Integer, Hash)>)

    RuleArray data, response status code and response headers



829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 829

def list_rule_by_currency_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.list_rule_by_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.list_rule_by_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}/rules'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

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

  # 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] || 'RuleArray'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.list_rule_by_currency",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#list_rule_by_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_transaction_by_currency(code, opts = {}) ⇒ TransactionArray

List all transactions with this currency. List all transactions with this currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is per 50.

  • :start_date (Date)

    A date formatted YYYY-MM-DD, to limit the list of transactions.

  • :end_date (Date)

    A date formatted YYYY-MM-DD, to limit the list of transactions.

  • :type (TransactionTypeFilter)

    Optional filter on the transaction type(s) returned

Returns:



887
888
889
890
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 887

def list_transaction_by_currency(code, opts = {})
  data, _status_code, _headers = list_transaction_by_currency_with_http_info(code, opts)
  data
end

#list_transaction_by_currency_with_http_info(code, opts = {}) ⇒ Array<(TransactionArray, Integer, Hash)>

List all transactions with this currency. List all transactions with this currency.

Parameters:

  • code (String)

    The currency code.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number. The default pagination is per 50.

  • :start_date (Date)

    A date formatted YYYY-MM-DD, to limit the list of transactions.

  • :end_date (Date)

    A date formatted YYYY-MM-DD, to limit the list of transactions.

  • :type (TransactionTypeFilter)

    Optional filter on the transaction type(s) returned

Returns:

  • (Array<(TransactionArray, Integer, Hash)>)

    TransactionArray data, response status code and response headers



901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 901

def list_transaction_by_currency_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.list_transaction_by_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.list_transaction_by_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}/transactions'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

  # 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] || 'TransactionArray'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.list_transaction_by_currency",
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#list_transaction_by_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#store_currency(currency, opts = {}) ⇒ CurrencySingle

Store a new currency Creates a new currency. The data required can be submitted as a JSON body or as a list of parameters.

Parameters:

  • currency (Currency)

    JSON array or key&#x3D;value pairs with the necessary currency information. See the model for the exact specifications.

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

    the optional parameters

Returns:



958
959
960
961
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 958

def store_currency(currency, opts = {})
  data, _status_code, _headers = store_currency_with_http_info(currency, opts)
  data
end

#store_currency_with_http_info(currency, opts = {}) ⇒ Array<(CurrencySingle, Integer, Hash)>

Store a new currency Creates a new currency. The data required can be submitted as a JSON body or as a list of parameters.

Parameters:

  • currency (Currency)

    JSON array or key&#x3D;value pairs with the necessary currency information. See the model for the exact specifications.

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

    the optional parameters

Returns:

  • (Array<(CurrencySingle, Integer, Hash)>)

    CurrencySingle data, response status code and response headers



968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 968

def store_currency_with_http_info(currency, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.store_currency ...'
  end
  # verify the required parameter 'currency' is set
  if @api_client.config.client_side_validation && currency.nil?
    fail ArgumentError, "Missing the required parameter 'currency' when calling CurrenciesApi.store_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(currency)

  # return_type
  return_type = opts[:debug_return_type] || 'CurrencySingle'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.store_currency",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#store_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_currency(code, currency, opts = {}) ⇒ CurrencySingle

Update existing currency. Update existing currency.

Parameters:

  • code (String)

    The currency code.

  • currency (Currency)

    JSON array with updated currency information. See the model for the exact specifications.

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

    the optional parameters

Returns:



1024
1025
1026
1027
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 1024

def update_currency(code, currency, opts = {})
  data, _status_code, _headers = update_currency_with_http_info(code, currency, opts)
  data
end

#update_currency_with_http_info(code, currency, opts = {}) ⇒ Array<(CurrencySingle, Integer, Hash)>

Update existing currency. Update existing currency.

Parameters:

  • code (String)

    The currency code.

  • currency (Currency)

    JSON array with updated currency information. See the model for the exact specifications.

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

    the optional parameters

Returns:

  • (Array<(CurrencySingle, Integer, Hash)>)

    CurrencySingle data, response status code and response headers



1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
# File 'lib/firefly_iii_client/api/currencies_api.rb', line 1035

def update_currency_with_http_info(code, currency, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CurrenciesApi.update_currency ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling CurrenciesApi.update_currency"
  end
  # verify the required parameter 'currency' is set
  if @api_client.config.client_side_validation && currency.nil?
    fail ArgumentError, "Missing the required parameter 'currency' when calling CurrenciesApi.update_currency"
  end
  # resource path
  local_var_path = '/api/v1/currencies/{code}'.sub('{' + 'code' + '}', CGI.escape(code.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(currency)

  # return_type
  return_type = opts[:debug_return_type] || 'CurrencySingle'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['firefly_iii_auth']

  new_options = opts.merge(
    :operation => :"CurrenciesApi.update_currency",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CurrenciesApi#update_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end