Skip to content

Latest commit

 

History

History
738 lines (526 loc) · 29.7 KB

RuleGroupsApi.md

File metadata and controls

738 lines (526 loc) · 29.7 KB

firefly_iii_client.RuleGroupsApi

All URIs are relative to https://demo.firefly-iii.org/api

Method HTTP request Description
delete_rule_group DELETE /v1/rule-groups/{id} Delete a rule group.
fire_rule_group POST /v1/rule-groups/{id}/trigger Fire the rule group on your transactions.
get_rule_group GET /v1/rule-groups/{id} Get a single rule group.
list_rule_by_group GET /v1/rule-groups/{id}/rules List rules in this rule group.
list_rule_group GET /v1/rule-groups List all rule groups.
store_rule_group POST /v1/rule-groups Store a new rule group.
test_rule_group GET /v1/rule-groups/{id}/test Test which transactions would be hit by the rule group. No changes will be made.
update_rule_group PUT /v1/rule-groups/{id} Update existing rule group.

delete_rule_group

delete_rule_group(id, x_trace_id=x_trace_id)

Delete a rule group.

Delete a rule group.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://demo.firefly-iii.org/api
# See configuration.py for a list of all supported configuration parameters.
configuration = firefly_iii_client.Configuration(
    host = "https://demo.firefly-iii.org/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: local_bearer_auth
configuration = firefly_iii_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with firefly_iii_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = firefly_iii_client.RuleGroupsApi(api_client)
    id = '123' # str | The ID of the rule group.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)

    try:
        # Delete a rule group.
        api_instance.delete_rule_group(id, x_trace_id=x_trace_id)
    except Exception as e:
        print("Exception when calling RuleGroupsApi->delete_rule_group: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the rule group.
x_trace_id str Unique identifier associated with this request. [optional]

Return type

void (empty response body)

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Rule group deleted. -
400 Bad request -
401 Unauthenticated -
404 Page not found -
500 Internal exception -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

fire_rule_group

fire_rule_group(id, x_trace_id=x_trace_id, start=start, end=end, accounts=accounts)

Fire the rule group on your transactions.

Fire the rule group on your transactions. Changes will be made by the rules in the rule group! Limit the result if you want to.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://demo.firefly-iii.org/api
# See configuration.py for a list of all supported configuration parameters.
configuration = firefly_iii_client.Configuration(
    host = "https://demo.firefly-iii.org/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: local_bearer_auth
configuration = firefly_iii_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with firefly_iii_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = firefly_iii_client.RuleGroupsApi(api_client)
    id = '123' # str | The ID of the rule group.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)
    start = 'Mon Sep 17 00:00:00 UTC 2018' # date | A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. Both the start date and the end date must be present.  (optional)
    end = 'Mon Sep 17 00:00:00 UTC 2018' # date | A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. Both the start date and the end date must be present.  (optional)
    accounts = [["1","2","3"]] # List[int] | Limit the triggering of the rule group to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped.  (optional)

    try:
        # Fire the rule group on your transactions.
        api_instance.fire_rule_group(id, x_trace_id=x_trace_id, start=start, end=end, accounts=accounts)
    except Exception as e:
        print("Exception when calling RuleGroupsApi->fire_rule_group: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the rule group.
x_trace_id str Unique identifier associated with this request. [optional]
start date A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. Both the start date and the end date must be present. [optional]
end date A date formatted YYYY-MM-DD, to limit the transactions the actions will be applied to. Both the start date and the end date must be present. [optional]
accounts List[int] Limit the triggering of the rule group to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped. [optional]

Return type

void (empty response body)

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 The rules in the group are executed. Due to the setup of this function (asynchronous job execution) the result cannot be displayed. -
400 Bad request -
401 Unauthenticated -
404 Page not found -
500 Internal exception -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_rule_group

RuleGroupSingle get_rule_group(id, x_trace_id=x_trace_id)

Get a single rule group.

Get a single rule group. This does not include the rules. For that, see below.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.rule_group_single import RuleGroupSingle
from firefly_iii_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://demo.firefly-iii.org/api
# See configuration.py for a list of all supported configuration parameters.
configuration = firefly_iii_client.Configuration(
    host = "https://demo.firefly-iii.org/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: local_bearer_auth
configuration = firefly_iii_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with firefly_iii_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = firefly_iii_client.RuleGroupsApi(api_client)
    id = '123' # str | The ID of the rule group.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)

    try:
        # Get a single rule group.
        api_response = api_instance.get_rule_group(id, x_trace_id=x_trace_id)
        print("The response of RuleGroupsApi->get_rule_group:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RuleGroupsApi->get_rule_group: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the rule group.
x_trace_id str Unique identifier associated with this request. [optional]

Return type

RuleGroupSingle

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json, application/json

HTTP response details

Status code Description Response headers
200 The requested rule group -
400 Bad request -
401 Unauthenticated -
404 Page not found -
500 Internal exception -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_rule_by_group

RuleArray list_rule_by_group(id, x_trace_id=x_trace_id, limit=limit, page=page)

List rules in this rule group.

List rules in this rule group.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.rule_array import RuleArray
from firefly_iii_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://demo.firefly-iii.org/api
# See configuration.py for a list of all supported configuration parameters.
configuration = firefly_iii_client.Configuration(
    host = "https://demo.firefly-iii.org/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: local_bearer_auth
configuration = firefly_iii_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with firefly_iii_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = firefly_iii_client.RuleGroupsApi(api_client)
    id = '123' # str | The ID of the rule group.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)
    limit = 10 # int | Number of items per page. The default pagination is per 50 items. (optional)
    page = 1 # int | Page number. The default pagination is per 50 items. (optional)

    try:
        # List rules in this rule group.
        api_response = api_instance.list_rule_by_group(id, x_trace_id=x_trace_id, limit=limit, page=page)
        print("The response of RuleGroupsApi->list_rule_by_group:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RuleGroupsApi->list_rule_by_group: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the rule group.
x_trace_id str Unique identifier associated with this request. [optional]
limit int Number of items per page. The default pagination is per 50 items. [optional]
page int Page number. The default pagination is per 50 items. [optional]

Return type

RuleArray

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json, application/json

HTTP response details

Status code Description Response headers
200 A list of rules. -
400 Bad request -
401 Unauthenticated -
404 Page not found -
500 Internal exception -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_rule_group

RuleGroupArray list_rule_group(x_trace_id=x_trace_id, limit=limit, page=page)

List all rule groups.

List all rule groups.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.rule_group_array import RuleGroupArray
from firefly_iii_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://demo.firefly-iii.org/api
# See configuration.py for a list of all supported configuration parameters.
configuration = firefly_iii_client.Configuration(
    host = "https://demo.firefly-iii.org/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: local_bearer_auth
configuration = firefly_iii_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with firefly_iii_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = firefly_iii_client.RuleGroupsApi(api_client)
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)
    limit = 10 # int | Number of items per page. The default pagination is per 50 items. (optional)
    page = 1 # int | Page number. The default pagination is per 50 items. (optional)

    try:
        # List all rule groups.
        api_response = api_instance.list_rule_group(x_trace_id=x_trace_id, limit=limit, page=page)
        print("The response of RuleGroupsApi->list_rule_group:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RuleGroupsApi->list_rule_group: %s\n" % e)

Parameters

Name Type Description Notes
x_trace_id str Unique identifier associated with this request. [optional]
limit int Number of items per page. The default pagination is per 50 items. [optional]
page int Page number. The default pagination is per 50 items. [optional]

Return type

RuleGroupArray

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json, application/json

HTTP response details

Status code Description Response headers
200 A list of rule groups. -
400 Bad request -
401 Unauthenticated -
404 Page not found -
500 Internal exception -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

store_rule_group

RuleGroupSingle store_rule_group(rule_group_store, x_trace_id=x_trace_id)

Store a new rule group.

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

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.rule_group_single import RuleGroupSingle
from firefly_iii_client.models.rule_group_store import RuleGroupStore
from firefly_iii_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://demo.firefly-iii.org/api
# See configuration.py for a list of all supported configuration parameters.
configuration = firefly_iii_client.Configuration(
    host = "https://demo.firefly-iii.org/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: local_bearer_auth
configuration = firefly_iii_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with firefly_iii_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = firefly_iii_client.RuleGroupsApi(api_client)
    rule_group_store = firefly_iii_client.RuleGroupStore() # RuleGroupStore | JSON array or key=value pairs with the necessary rule group information. See the model for the exact specifications.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)

    try:
        # Store a new rule group.
        api_response = api_instance.store_rule_group(rule_group_store, x_trace_id=x_trace_id)
        print("The response of RuleGroupsApi->store_rule_group:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RuleGroupsApi->store_rule_group: %s\n" % e)

Parameters

Name Type Description Notes
rule_group_store RuleGroupStore JSON array or key=value pairs with the necessary rule group information. See the model for the exact specifications.
x_trace_id str Unique identifier associated with this request. [optional]

Return type

RuleGroupSingle

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/vnd.api+json, application/json

HTTP response details

Status code Description Response headers
200 New rule group stored, result in response. -
400 Bad request -
401 Unauthenticated -
404 Page not found -
422 Validation error. The body will have the exact details. -
500 Internal exception -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

test_rule_group

TransactionArray test_rule_group(id, x_trace_id=x_trace_id, limit=limit, page=page, start=start, end=end, search_limit=search_limit, triggered_limit=triggered_limit, accounts=accounts)

Test which transactions would be hit by the rule group. No changes will be made.

Test which transactions would be hit by the rule group. No changes will be made. Limit the result if you want to.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.transaction_array import TransactionArray
from firefly_iii_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://demo.firefly-iii.org/api
# See configuration.py for a list of all supported configuration parameters.
configuration = firefly_iii_client.Configuration(
    host = "https://demo.firefly-iii.org/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: local_bearer_auth
configuration = firefly_iii_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with firefly_iii_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = firefly_iii_client.RuleGroupsApi(api_client)
    id = '123' # str | The ID of the rule group.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)
    limit = 10 # int | Number of items per page. The default pagination is per 50 items. (optional)
    page = 1 # int | Page number. The default pagination is per 50 items. (optional)
    start = 'Mon Sep 17 00:00:00 UTC 2018' # date | A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present.  (optional)
    end = 'Mon Sep 17 00:00:00 UTC 2018' # date | A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present.  (optional)
    search_limit = 56 # int | Maximum number of transactions Firefly III will try. Don't set this too high, or it will take Firefly III very long to run the test. I suggest a max of 200.  (optional)
    triggered_limit = 56 # int | Maximum number of transactions the rule group can actually trigger on, before Firefly III stops. I would suggest setting this to 10 or 15. Don't go above the user's page size, because browsing to page 2 or 3 of a test result would fire the test again, making any navigation efforts very slow.  (optional)
    accounts = [["1","2","3"]] # List[int] | Limit the testing of the rule group to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped.  (optional)

    try:
        # Test which transactions would be hit by the rule group. No changes will be made.
        api_response = api_instance.test_rule_group(id, x_trace_id=x_trace_id, limit=limit, page=page, start=start, end=end, search_limit=search_limit, triggered_limit=triggered_limit, accounts=accounts)
        print("The response of RuleGroupsApi->test_rule_group:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RuleGroupsApi->test_rule_group: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the rule group.
x_trace_id str Unique identifier associated with this request. [optional]
limit int Number of items per page. The default pagination is per 50 items. [optional]
page int Page number. The default pagination is per 50 items. [optional]
start date A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present. [optional]
end date A date formatted YYYY-MM-DD, to limit the transactions the test will be applied to. Both the start date and the end date must be present. [optional]
search_limit int Maximum number of transactions Firefly III will try. Don't set this too high, or it will take Firefly III very long to run the test. I suggest a max of 200. [optional]
triggered_limit int Maximum number of transactions the rule group can actually trigger on, before Firefly III stops. I would suggest setting this to 10 or 15. Don't go above the user's page size, because browsing to page 2 or 3 of a test result would fire the test again, making any navigation efforts very slow. [optional]
accounts List[int] Limit the testing of the rule group to these asset accounts or liabilities. Only asset accounts and liabilities will be accepted. Other types will be silently dropped. [optional]

Return type

TransactionArray

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.api+json, application/json

HTTP response details

Status code Description Response headers
200 A list of transactions that would be changed by any of the rules of the rule group. No changes will be made. -
400 Bad request -
401 Unauthenticated -
404 Page not found -
500 Internal exception -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_rule_group

RuleGroupSingle update_rule_group(id, rule_group_update, x_trace_id=x_trace_id)

Update existing rule group.

Update existing rule group.

Example

  • OAuth Authentication (firefly_iii_auth):
  • Bearer Authentication (local_bearer_auth):
import firefly_iii_client
from firefly_iii_client.models.rule_group_single import RuleGroupSingle
from firefly_iii_client.models.rule_group_update import RuleGroupUpdate
from firefly_iii_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://demo.firefly-iii.org/api
# See configuration.py for a list of all supported configuration parameters.
configuration = firefly_iii_client.Configuration(
    host = "https://demo.firefly-iii.org/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Configure Bearer authorization: local_bearer_auth
configuration = firefly_iii_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with firefly_iii_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = firefly_iii_client.RuleGroupsApi(api_client)
    id = '123' # str | The ID of the rule group.
    rule_group_update = firefly_iii_client.RuleGroupUpdate() # RuleGroupUpdate | JSON array with updated rule group information. See the model for the exact specifications.
    x_trace_id = 'x_trace_id_example' # str | Unique identifier associated with this request. (optional)

    try:
        # Update existing rule group.
        api_response = api_instance.update_rule_group(id, rule_group_update, x_trace_id=x_trace_id)
        print("The response of RuleGroupsApi->update_rule_group:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling RuleGroupsApi->update_rule_group: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the rule group.
rule_group_update RuleGroupUpdate JSON array with updated rule group information. See the model for the exact specifications.
x_trace_id str Unique identifier associated with this request. [optional]

Return type

RuleGroupSingle

Authorization

firefly_iii_auth, local_bearer_auth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/vnd.api+json, application/json

HTTP response details

Status code Description Response headers
200 Updated rule group stored, result in response -
400 Bad request -
401 Unauthenticated -
404 Page not found -
422 Validation error. The body will have the exact details. -
500 Internal exception -

[Back to top] [Back to API list] [Back to Model list] [Back to README]