class FireflyIIIClient::RecurrencesApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

delete_recurrence(id, opts = {}) click to toggle source

Delete a recurring transaction. Delete a recurring transaction. Transactions created will not be deleted. @param id [Integer] The ID of the recurring transaction. @param [Hash] opts the optional parameters @return [nil]

# File lib/firefly_iii_client/api/recurrences_api.rb, line 27
def delete_recurrence(id, opts = {})
  delete_recurrence_with_http_info(id, opts)
  nil
end
delete_recurrence_with_http_info(id, opts = {}) click to toggle source

Delete a recurring transaction. Delete a recurring transaction. Transactions created will not be deleted. @param id [Integer] The ID of the recurring transaction. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/firefly_iii_client/api/recurrences_api.rb, line 37
def delete_recurrence_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RecurrencesApi.delete_recurrence ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling RecurrencesApi.delete_recurrence"
  end
  # resource path
  local_var_path = '/api/v1/recurrences/{id}'.sub('{' + 'id' + '}', CGI.escape(id.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 => :"RecurrencesApi.delete_recurrence",
    :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: RecurrencesApi#delete_recurrence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_recurrence(id, opts = {}) click to toggle source

Get a single recurring transaction. Get a single recurring transaction. @param id [Integer] The ID of the recurring transaction. @param [Hash] opts the optional parameters @return [RecurrenceSingle]

# File lib/firefly_iii_client/api/recurrences_api.rb, line 88
def get_recurrence(id, opts = {})
  data, _status_code, _headers = get_recurrence_with_http_info(id, opts)
  data
end
get_recurrence_with_http_info(id, opts = {}) click to toggle source

Get a single recurring transaction. Get a single recurring transaction. @param id [Integer] The ID of the recurring transaction. @param [Hash] opts the optional parameters @return [Array<(RecurrenceSingle, Integer, Hash)>] RecurrenceSingle data, response status code and response headers

# File lib/firefly_iii_client/api/recurrences_api.rb, line 98
def get_recurrence_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RecurrencesApi.get_recurrence ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling RecurrencesApi.get_recurrence"
  end
  # resource path
  local_var_path = '/api/v1/recurrences/{id}'.sub('{' + 'id' + '}', CGI.escape(id.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] || 'RecurrenceSingle'

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

  new_options = opts.merge(
    :operation => :"RecurrencesApi.get_recurrence",
    :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: RecurrencesApi#get_recurrence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_recurrence(opts = {}) click to toggle source

List all recurring transactions. List all recurring transactions. @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/recurrences_api.rb, line 151
def list_recurrence(opts = {})
  data, _status_code, _headers = list_recurrence_with_http_info(opts)
  data
end
list_recurrence_with_http_info(opts = {}) click to toggle source

List all recurring transactions. List all recurring transactions. @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/recurrences_api.rb, line 161
def list_recurrence_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RecurrencesApi.list_recurrence ...'
  end
  # resource path
  local_var_path = '/api/v1/recurrences'

  # 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 => :"RecurrencesApi.list_recurrence",
    :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: RecurrencesApi#list_recurrence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_transaction_by_recurrence(id, opts = {}) click to toggle source

List all transactions created by a recurring transaction. List all transactions created by a recurring transaction, optionally limited to the date ranges specified. @param id [Integer] The ID of the recurring transaction. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @option opts [Date] :start A date formatted YYYY-MM-DD. Both the start and end date must be present. @option opts [Date] :_end A date formatted YYYY-MM-DD. Both the start and end date must be present. @option opts [TransactionTypeFilter] :type Optional filter on the transaction type(s) returned @return [TransactionArray]

# File lib/firefly_iii_client/api/recurrences_api.rb, line 215
def list_transaction_by_recurrence(id, opts = {})
  data, _status_code, _headers = list_transaction_by_recurrence_with_http_info(id, opts)
  data
end
list_transaction_by_recurrence_with_http_info(id, opts = {}) click to toggle source

List all transactions created by a recurring transaction. List all transactions created by a recurring transaction, optionally limited to the date ranges specified. @param id [Integer] The ID of the recurring transaction. @param [Hash] opts the optional parameters @option opts [Integer] :page Page number. The default pagination is 50. @option opts [Date] :start A date formatted YYYY-MM-DD. Both the start and end date must be present. @option opts [Date] :_end A date formatted YYYY-MM-DD. Both the start and end date must be present. @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/recurrences_api.rb, line 229
def list_transaction_by_recurrence_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RecurrencesApi.list_transaction_by_recurrence ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling RecurrencesApi.list_transaction_by_recurrence"
  end
  # resource path
  local_var_path = '/api/v1/recurrences/{id}/transactions'.sub('{' + 'id' + '}', CGI.escape(id.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?
  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 => :"RecurrencesApi.list_transaction_by_recurrence",
    :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: RecurrencesApi#list_transaction_by_recurrence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
store_recurrence(recurrence, opts = {}) click to toggle source

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

# File lib/firefly_iii_client/api/recurrences_api.rb, line 286
def store_recurrence(recurrence, opts = {})
  data, _status_code, _headers = store_recurrence_with_http_info(recurrence, opts)
  data
end
store_recurrence_with_http_info(recurrence, opts = {}) click to toggle source

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

# File lib/firefly_iii_client/api/recurrences_api.rb, line 296
def store_recurrence_with_http_info(recurrence, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RecurrencesApi.store_recurrence ...'
  end
  # verify the required parameter 'recurrence' is set
  if @api_client.config.client_side_validation && recurrence.nil?
    fail ArgumentError, "Missing the required parameter 'recurrence' when calling RecurrencesApi.store_recurrence"
  end
  # resource path
  local_var_path = '/api/v1/recurrences'

  # 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(recurrence)

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

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

  new_options = opts.merge(
    :operation => :"RecurrencesApi.store_recurrence",
    :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: RecurrencesApi#store_recurrence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
trigger_recurrence(opts = {}) click to toggle source

Trigger the creation of recurring transactions (like a cron job). Triggers the recurring transactions, like a cron job would. If the schedule does not call for a new transaction to be created, nothing will happen. @param [Hash] opts the optional parameters @return [nil]

# File lib/firefly_iii_client/api/recurrences_api.rb, line 350
def trigger_recurrence(opts = {})
  trigger_recurrence_with_http_info(opts)
  nil
end
trigger_recurrence_with_http_info(opts = {}) click to toggle source

Trigger the creation of recurring transactions (like a cron job). Triggers the recurring transactions, like a cron job would. If the schedule does not call for a new transaction to be created, nothing will happen. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/firefly_iii_client/api/recurrences_api.rb, line 359
def trigger_recurrence_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RecurrencesApi.trigger_recurrence ...'
  end
  # resource path
  local_var_path = '/api/v1/recurrences/trigger'

  # 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 => :"RecurrencesApi.trigger_recurrence",
    :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: RecurrencesApi#trigger_recurrence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_recurrence(id, recurrence, opts = {}) click to toggle source

Update existing recurring transaction. Update existing recurring transaction. @param id [Integer] The ID of the recurring transaction. @param recurrence [Recurrence] JSON array with updated recurring transaction information. See the model for the exact specifications. @param [Hash] opts the optional parameters @return [RecurrenceSingle]

# File lib/firefly_iii_client/api/recurrences_api.rb, line 407
def update_recurrence(id, recurrence, opts = {})
  data, _status_code, _headers = update_recurrence_with_http_info(id, recurrence, opts)
  data
end
update_recurrence_with_http_info(id, recurrence, opts = {}) click to toggle source

Update existing recurring transaction. Update existing recurring transaction. @param id [Integer] The ID of the recurring transaction. @param recurrence [Recurrence] JSON array with updated recurring transaction information. See the model for the exact specifications. @param [Hash] opts the optional parameters @return [Array<(RecurrenceSingle, Integer, Hash)>] RecurrenceSingle data, response status code and response headers

# File lib/firefly_iii_client/api/recurrences_api.rb, line 418
def update_recurrence_with_http_info(id, recurrence, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: RecurrencesApi.update_recurrence ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling RecurrencesApi.update_recurrence"
  end
  # verify the required parameter 'recurrence' is set
  if @api_client.config.client_side_validation && recurrence.nil?
    fail ArgumentError, "Missing the required parameter 'recurrence' when calling RecurrencesApi.update_recurrence"
  end
  # resource path
  local_var_path = '/api/v1/recurrences/{id}'.sub('{' + 'id' + '}', CGI.escape(id.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(recurrence)

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

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

  new_options = opts.merge(
    :operation => :"RecurrencesApi.update_recurrence",
    :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: RecurrencesApi#update_recurrence\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end