class FireflyIIIClient::CurrenciesApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/firefly_iii_client/api/currencies_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

default_currency(code, opts = {}) click to toggle source

Make currency default currency. Make this currency the default currency. If the currency is not enabled, it will be enabled as well. @param code [String] The currency code. @param [Hash] opts the optional parameters @return [CurrencySingle]

# 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 = {}) click to toggle source

Make currency default currency. Make this currency the default currency. If the currency is not enabled, it will be enabled as well. @param code [String] The currency code. @param [Hash] opts the optional parameters @return [Array<(CurrencySingle, Integer, Hash)>] CurrencySingle data, response status code and response headers

# 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 = {}) click to toggle source

Delete a currency. Delete a currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @return [nil]

# 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 = {}) click to toggle source

Delete a currency. Delete a currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# 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 = {}) click to toggle source

Disable a currency. Disable a currency. @param code [Integer] The currency code. @param [Hash] opts the optional parameters @return [CurrencySingle]

# 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 = {}) click to toggle source

Disable a currency. Disable a currency. @param code [Integer] The currency code. @param [Hash] opts the optional parameters @return [Array<(CurrencySingle, Integer, Hash)>] CurrencySingle data, response status code and response headers

# 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 = {}) click to toggle source

Enable a single currency. Enable a single currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @return [CurrencySingle]

# 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 = {}) click to toggle source

Enable a single currency. Enable a single currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @return [Array<(CurrencySingle, Integer, Hash)>] CurrencySingle data, response status code and response headers

# 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 = {}) click to toggle source

Get a single currency. Get a single currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @return [CurrencySingle]

# 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 = {}) click to toggle source

Get a single currency. Get a single currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @return [Array<(CurrencySingle, Integer, Hash)>] CurrencySingle data, response status code and response headers

# 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 = {}) click to toggle source

List all accounts with this currency. List all accounts with this currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @option opts [String] :date A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account&#39;s balance on that day. @option opts [AccountTypeFilter] :type Optional filter on the account type(s) returned @return [AccountArray]

# File lib/firefly_iii_client/api/currencies_api.rb, line 343
def list_account_by_currency(code, opts = {})
  data, _status_code, _headers = list_account_by_currency_with_http_info(code, opts)
  data
end
list_account_by_currency_with_http_info(code, opts = {}) click to toggle source

List all accounts with this currency. List all accounts with this currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @option opts [String] :date A date formatted YYYY-MM-DD. When added to the request, Firefly III will show the account&#39;s balance on that day. @option opts [AccountTypeFilter] :type Optional filter on the account type(s) returned @return [Array<(AccountArray, Integer, Hash)>] AccountArray data, response status code and response headers

# File lib/firefly_iii_client/api/currencies_api.rb, line 356
def list_account_by_currency_with_http_info(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 = {}) click to toggle source

List all available budgets with this currency. List all available budgets with this currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50 @return [AvailableBudgetArray]

# 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 = {}) click to toggle source

List all available budgets with this currency. List all available budgets with this currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50 @return [Array<(AvailableBudgetArray, Integer, Hash)>] AvailableBudgetArray data, response status code and response headers

# 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 = {}) click to toggle source

List all bills with this currency. List all bills with this currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @return [BillArray]

# 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 = {}) click to toggle source

List all bills with this currency. List all bills with this currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @return [Array<(BillArray, Integer, Hash)>] BillArray data, response status code and response headers

# 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 = {}) click to toggle source

List all budget limits with this currency List all budget limits with this currency @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @option opts [Date] :start Start date for the budget limit list. @option opts [Date] :_end End date for the budget limit list. @return [BudgetLimitArray]

# 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 = {}) click to toggle source

List all budget limits with this currency List all budget limits with this currency @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @option opts [Date] :start Start date for the budget limit list. @option opts [Date] :_end End date for the budget limit list. @return [Array<(BudgetLimitArray, Integer, Hash)>] BudgetLimitArray data, response status code and response headers

# 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 = {}) click to toggle source

List all currencies. List all currencies. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @return [CurrencyArray]

# 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 = {}) click to toggle source

List all currencies. List all currencies. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @return [Array<(CurrencyArray, Integer, Hash)>] CurrencyArray data, response status code and response headers

# 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 = {}) click to toggle source

List all known exchange rates with (from or to) this currency. List all known exchange rates. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @option opts [Date] :date The date of which you want to know the exchange rate @option opts [Date] :start Use this instead of the date parameter to search for a range of currency exchange values. @option opts [Date] :_end Use this instead of the date parameter to search for a range of currency exchange values. @return [ExchangeRateArray]

# 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 = {}) click to toggle source

List all known exchange rates with (from or to) this currency. List all known exchange rates. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @option opts [Date] :date The date of which you want to know the exchange rate @option opts [Date] :start Use this instead of the date parameter to search for a range of currency exchange values. @option opts [Date] :_end Use this instead of the date parameter to search for a range of currency exchange values. @return [Array<(ExchangeRateArray, Integer, Hash)>] ExchangeRateArray data, response status code and response headers

# 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 = {}) click to toggle source

List all recurring transactions with this currency. List all recurring transactions with this currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @return [RecurrenceArray]

# 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 = {}) click to toggle source

List all recurring transactions with this currency. List all recurring transactions with this currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @return [Array<(RecurrenceArray, Integer, Hash)>] RecurrenceArray data, response status code and response headers

# 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 = {}) click to toggle source

List all rules with this currency. List all rules with this currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination per 50. @return [RuleArray]

# 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 = {}) click to toggle source

List all rules with this currency. List all rules with this currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination per 50. @return [Array<(RuleArray, Integer, Hash)>] RuleArray data, response status code and response headers

# 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 = {}) click to toggle source

List all transactions with this currency. List all transactions with this currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is per 50. @option opts [Date] :start_date A date formatted YYYY-MM-DD, to limit the list of transactions. @option opts [Date] :end_date A date formatted YYYY-MM-DD, to limit the list of transactions. @option opts [TransactionTypeFilter] :type Optional filter on the transaction type(s) returned @return [TransactionArray]

# 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 = {}) click to toggle source

List all transactions with this currency. List all transactions with this currency. @param code [String] The currency code. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is per 50. @option opts [Date] :start_date A date formatted YYYY-MM-DD, to limit the list of transactions. @option opts [Date] :end_date A date formatted YYYY-MM-DD, to limit the list of transactions. @option opts [TransactionTypeFilter] :type Optional filter on the transaction type(s) returned @return [Array<(TransactionArray, Integer, Hash)>] TransactionArray data, response status code and response headers

# 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 = {}) click to toggle source

Store a new currency Creates a new currency. The data required can be submitted as a JSON body or as a list of parameters. @param currency [Currency] JSON array or key&#x3D;value pairs with the necessary currency information. See the model for the exact specifications. @param [Hash] opts the optional parameters @return [CurrencySingle]

# 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 = {}) click to toggle source

Store a new currency Creates a new currency. The data required can be submitted as a JSON body or as a list of parameters. @param currency [Currency] JSON array or key&#x3D;value pairs with the necessary currency information. See the model for the exact specifications. @param [Hash] opts the optional parameters @return [Array<(CurrencySingle, Integer, Hash)>] CurrencySingle data, response status code and response headers

# 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 = {}) click to toggle source

Update existing currency. Update existing currency. @param code [String] The currency code. @param currency [Currency] JSON array with updated currency information. See the model for the exact specifications. @param [Hash] opts the optional parameters @return [CurrencySingle]

# 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 = {}) click to toggle source

Update existing currency. Update existing currency. @param code [String] The currency code. @param currency [Currency] JSON array with updated currency information. See the model for the exact specifications. @param [Hash] opts the optional parameters @return [Array<(CurrencySingle, Integer, Hash)>] CurrencySingle data, response status code and response headers

# 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