This commit is contained in:
Illya Marchenko 2024-03-25 11:55:01 +02:00
commit 5c13135615
Signed by: stuzer05
GPG Key ID: A6ABAAA9268F9F4F
254 changed files with 36649 additions and 0 deletions

3
.env.example Normal file

@ -0,0 +1,3 @@
FIREFLY3_TOKEN=
MONOBANK_TOKEN=

3
.gitignore vendored Normal file

@ -0,0 +1,3 @@
/.idea
/main
/.env

4
Makefile Normal file

@ -0,0 +1,4 @@
.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build .

657
firefly3/README.md Normal file

@ -0,0 +1,657 @@
# Go API client for swagger
This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III
itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This
file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests
from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out
there, sorry about that.
## Overview
This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using
the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API
client.
- API version: 2.0.12
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen For more information, please
visit [https://firefly-iii.org](https://firefly-iii.org)
## Installation
Put the package under your project folder and add the following in import:
```golang
import "./swagger"
```
## Documentation for API Endpoints
All URIs are relative to *https://demo.firefly-iii.org/api*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AboutApi* | [**GetAbout**](docs/AboutApi.md#getabout) | **Get** /v1/about | System information end point.
*AboutApi* | [**GetCron**](docs/AboutApi.md#getcron) | **Get** /v1/cron/{cliToken} | Cron job endpoint
*AboutApi* | [**GetCurrentUser**](docs/AboutApi.md#getcurrentuser) | **
Get** /v1/about/user | Currently authenticated user endpoint.
*AccountsApi* | [**DeleteAccount**](docs/AccountsApi.md#deleteaccount) | **
Delete** /v1/accounts/{id} | Permanently delete account.
*AccountsApi* | [**GetAccount**](docs/AccountsApi.md#getaccount) | **Get** /v1/accounts/{id} | Get single account.
*AccountsApi* | [**ListAccount**](docs/AccountsApi.md#listaccount) | **Get** /v1/accounts | List all accounts.
*AccountsApi* | [**ListAttachmentByAccount**](docs/AccountsApi.md#listattachmentbyaccount) | **
Get** /v1/accounts/{id}/attachments | Lists all attachments.
*AccountsApi* | [**ListPiggyBankByAccount**](docs/AccountsApi.md#listpiggybankbyaccount) | **
Get** /v1/accounts/{id}/piggy-banks | List all piggy banks related to the account.
*AccountsApi* | [**ListTransactionByAccount**](docs/AccountsApi.md#listtransactionbyaccount) | **
Get** /v1/accounts/{id}/transactions | List all transactions related to the account.
*AccountsApi* | [**StoreAccount**](docs/AccountsApi.md#storeaccount) | **Post** /v1/accounts | Create new account.
*AccountsApi* | [**UpdateAccount**](docs/AccountsApi.md#updateaccount) | **
Put** /v1/accounts/{id} | Update existing account.
*AttachmentsApi* | [**DeleteAttachment**](docs/AttachmentsApi.md#deleteattachment) | **
Delete** /v1/attachments/{id} | Delete an attachment.
*AttachmentsApi* | [**DownloadAttachment**](docs/AttachmentsApi.md#downloadattachment) | **
Get** /v1/attachments/{id}/download | Download a single attachment.
*AttachmentsApi* | [**GetAttachment**](docs/AttachmentsApi.md#getattachment) | **
Get** /v1/attachments/{id} | Get a single attachment.
*AttachmentsApi* | [**ListAttachment**](docs/AttachmentsApi.md#listattachment) | **
Get** /v1/attachments | List all attachments.
*AttachmentsApi* | [**StoreAttachment**](docs/AttachmentsApi.md#storeattachment) | **
Post** /v1/attachments | Store a new attachment.
*AttachmentsApi* | [**UpdateAttachment**](docs/AttachmentsApi.md#updateattachment) | **
Put** /v1/attachments/{id} | Update existing attachment.
*AttachmentsApi* | [**UploadAttachment**](docs/AttachmentsApi.md#uploadattachment) | **
Post** /v1/attachments/{id}/upload | Upload an attachment.
*AutocompleteApi* | [**GetAccountsAC**](docs/AutocompleteApi.md#getaccountsac) | **
Get** /v1/autocomplete/accounts | Returns all accounts of the user returned in a basic auto-complete array.
*AutocompleteApi* | [**GetBillsAC**](docs/AutocompleteApi.md#getbillsac) | **
Get** /v1/autocomplete/bills | Returns all bills of the user returned in a basic auto-complete array.
*AutocompleteApi* | [**GetBudgetsAC**](docs/AutocompleteApi.md#getbudgetsac) | **
Get** /v1/autocomplete/budgets | Returns all budgets of the user returned in a basic auto-complete array.
*AutocompleteApi* | [**GetCategoriesAC**](docs/AutocompleteApi.md#getcategoriesac) | **
Get** /v1/autocomplete/categories | Returns all categories of the user returned in a basic auto-complete array.
*AutocompleteApi* | [**GetCurrenciesAC**](docs/AutocompleteApi.md#getcurrenciesac) | **
Get** /v1/autocomplete/currencies | Returns all currencies of the user returned in a basic auto-complete array.
*AutocompleteApi* | [**GetCurrenciesCodeAC**](docs/AutocompleteApi.md#getcurrenciescodeac) | **
Get** /v1/autocomplete/currencies-with-code | Returns all currencies of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it.
*AutocompleteApi* | [**GetObjectGroupsAC**](docs/AutocompleteApi.md#getobjectgroupsac) | **
Get** /v1/autocomplete/object-groups | Returns all object groups of the user returned in a basic auto-complete array.
*AutocompleteApi* | [**GetPiggiesAC**](docs/AutocompleteApi.md#getpiggiesac) | **
Get** /v1/autocomplete/piggy-banks | Returns all piggy banks of the user returned in a basic auto-complete array.
*AutocompleteApi* | [**GetPiggiesBalanceAC**](docs/AutocompleteApi.md#getpiggiesbalanceac) | **
Get** /v1/autocomplete/piggy-banks-with-balance | Returns all piggy banks of the user returned in a basic auto-complete array complemented with balance information.
*AutocompleteApi* | [**GetRecurringAC**](docs/AutocompleteApi.md#getrecurringac) | **
Get** /v1/autocomplete/recurring | Returns all recurring transactions of the user returned in a basic auto-complete array.
*AutocompleteApi* | [**GetRuleGroupsAC**](docs/AutocompleteApi.md#getrulegroupsac) | **
Get** /v1/autocomplete/rule-groups | Returns all rule groups of the user returned in a basic auto-complete array.
*AutocompleteApi* | [**GetRulesAC**](docs/AutocompleteApi.md#getrulesac) | **
Get** /v1/autocomplete/rules | Returns all rules of the user returned in a basic auto-complete array.
*AutocompleteApi* | [**GetTagAC**](docs/AutocompleteApi.md#gettagac) | **
Get** /v1/autocomplete/tags | Returns all tags of the user returned in a basic auto-complete array.
*AutocompleteApi* | [**GetTransactionTypesAC**](docs/AutocompleteApi.md#gettransactiontypesac) | **
Get** /v1/autocomplete/transaction-types | Returns all transaction types returned in a basic auto-complete array. English only.
*AutocompleteApi* | [**GetTransactionsAC**](docs/AutocompleteApi.md#gettransactionsac) | **
Get** /v1/autocomplete/transactions | Returns all transaction descriptions of the user returned in a basic auto-complete array.
*AutocompleteApi* | [**GetTransactionsIDAC**](docs/AutocompleteApi.md#gettransactionsidac) | **
Get** /v1/autocomplete/transactions-with-id | Returns all transactions, complemented with their ID, of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it.
*AvailableBudgetsApi* | [**GetAvailableBudget**](docs/AvailableBudgetsApi.md#getavailablebudget) | **
Get** /v1/available-budgets/{id} | Get a single available budget.
*AvailableBudgetsApi* | [**ListAvailableBudget**](docs/AvailableBudgetsApi.md#listavailablebudget) | **
Get** /v1/available-budgets | List all available budget amounts.
*BillsApi* | [**DeleteBill**](docs/BillsApi.md#deletebill) | **Delete** /v1/bills/{id} | Delete a bill.
*BillsApi* | [**GetBill**](docs/BillsApi.md#getbill) | **Get** /v1/bills/{id} | Get a single bill.
*BillsApi* | [**ListAttachmentByBill**](docs/BillsApi.md#listattachmentbybill) | **
Get** /v1/bills/{id}/attachments | List all attachments uploaded to the bill.
*BillsApi* | [**ListBill**](docs/BillsApi.md#listbill) | **Get** /v1/bills | List all bills.
*BillsApi* | [**ListRuleByBill**](docs/BillsApi.md#listrulebybill) | **
Get** /v1/bills/{id}/rules | List all rules associated with the bill.
*BillsApi* | [**ListTransactionByBill**](docs/BillsApi.md#listtransactionbybill) | **
Get** /v1/bills/{id}/transactions | List all transactions associated with the bill.
*BillsApi* | [**StoreBill**](docs/BillsApi.md#storebill) | **Post** /v1/bills | Store a new bill
*BillsApi* | [**UpdateBill**](docs/BillsApi.md#updatebill) | **Put** /v1/bills/{id} | Update existing bill.
*BudgetsApi* | [**DeleteBudget**](docs/BudgetsApi.md#deletebudget) | **Delete** /v1/budgets/{id} | Delete a budget.
*BudgetsApi* | [**DeleteBudgetLimit**](docs/BudgetsApi.md#deletebudgetlimit) | **
Delete** /v1/budgets/{id}/limits/{limitId} | Delete a budget limit.
*BudgetsApi* | [**GetBudget**](docs/BudgetsApi.md#getbudget) | **Get** /v1/budgets/{id} | Get a single budget.
*BudgetsApi* | [**GetBudgetLimit**](docs/BudgetsApi.md#getbudgetlimit) | **
Get** /v1/budgets/{id}/limits/{limitId} | Get single budget limit.
*BudgetsApi* | [**ListAttachmentByBudget**](docs/BudgetsApi.md#listattachmentbybudget) | **
Get** /v1/budgets/{id}/attachments | Lists all attachments of a budget.
*BudgetsApi* | [**ListBudget**](docs/BudgetsApi.md#listbudget) | **Get** /v1/budgets | List all budgets.
*BudgetsApi* | [**ListBudgetLimit**](docs/BudgetsApi.md#listbudgetlimit) | **
Get** /v1/budget-limits | Get list of budget limits by date
*BudgetsApi* | [**ListBudgetLimitByBudget**](docs/BudgetsApi.md#listbudgetlimitbybudget) | **
Get** /v1/budgets/{id}/limits | Get all limits for a budget.
*BudgetsApi* | [**ListTransactionByBudget**](docs/BudgetsApi.md#listtransactionbybudget) | **
Get** /v1/budgets/{id}/transactions | All transactions to a budget.
*BudgetsApi* | [**ListTransactionByBudgetLimit**](docs/BudgetsApi.md#listtransactionbybudgetlimit) | **
Get** /v1/budgets/{id}/limits/{limitId}/transactions | List all transactions by a budget limit ID.
*BudgetsApi* | [**StoreBudget**](docs/BudgetsApi.md#storebudget) | **Post** /v1/budgets | Store a new budget
*BudgetsApi* | [**StoreBudgetLimit**](docs/BudgetsApi.md#storebudgetlimit) | **
Post** /v1/budgets/{id}/limits | Store new budget limit.
*BudgetsApi* | [**UpdateBudget**](docs/BudgetsApi.md#updatebudget) | **Put** /v1/budgets/{id} | Update existing budget.
*BudgetsApi* | [**UpdateBudgetLimit**](docs/BudgetsApi.md#updatebudgetlimit) | **
Put** /v1/budgets/{id}/limits/{limitId} | Update existing budget limit.
*CategoriesApi* | [**DeleteCategory**](docs/CategoriesApi.md#deletecategory) | **
Delete** /v1/categories/{id} | Delete a category.
*CategoriesApi* | [**GetCategory**](docs/CategoriesApi.md#getcategory) | **
Get** /v1/categories/{id} | Get a single category.
*CategoriesApi* | [**ListAttachmentByCategory**](docs/CategoriesApi.md#listattachmentbycategory) | **
Get** /v1/categories/{id}/attachments | Lists all attachments.
*CategoriesApi* | [**ListCategory**](docs/CategoriesApi.md#listcategory) | **Get** /v1/categories | List all categories.
*CategoriesApi* | [**ListTransactionByCategory**](docs/CategoriesApi.md#listtransactionbycategory) | **
Get** /v1/categories/{id}/transactions | List all transactions in a category.
*CategoriesApi* | [**StoreCategory**](docs/CategoriesApi.md#storecategory) | **
Post** /v1/categories | Store a new category
*CategoriesApi* | [**UpdateCategory**](docs/CategoriesApi.md#updatecategory) | **
Put** /v1/categories/{id} | Update existing category.
*ChartsApi* | [**GetChartAccountOverview**](docs/ChartsApi.md#getchartaccountoverview) | **
Get** /v1/chart/account/overview | Dashboard chart with asset account balance information.
*ConfigurationApi* | [**GetConfiguration**](docs/ConfigurationApi.md#getconfiguration) | **
Get** /v1/configuration | Get Firefly III system configuration values.
*ConfigurationApi* | [**GetSingleConfiguration**](docs/ConfigurationApi.md#getsingleconfiguration) | **
Get** /v1/configuration/{name} | Get a single Firefly III system configuration value
*ConfigurationApi* | [**SetConfiguration**](docs/ConfigurationApi.md#setconfiguration) | **
Put** /v1/configuration/{name} | Update configuration value
*CurrenciesApi* | [**DefaultCurrency**](docs/CurrenciesApi.md#defaultcurrency) | **
Post** /v1/currencies/{code}/default | Make currency default currency.
*CurrenciesApi* | [**DeleteCurrency**](docs/CurrenciesApi.md#deletecurrency) | **
Delete** /v1/currencies/{code} | Delete a currency.
*CurrenciesApi* | [**DisableCurrency**](docs/CurrenciesApi.md#disablecurrency) | **
Post** /v1/currencies/{code}/disable | Disable a currency.
*CurrenciesApi* | [**EnableCurrency**](docs/CurrenciesApi.md#enablecurrency) | **
Post** /v1/currencies/{code}/enable | Enable a single currency.
*CurrenciesApi* | [**GetCurrency**](docs/CurrenciesApi.md#getcurrency) | **
Get** /v1/currencies/{code} | Get a single currency.
*CurrenciesApi* | [**GetDefaultCurrency**](docs/CurrenciesApi.md#getdefaultcurrency) | **
Get** /v1/currencies/default | Get the user's default currency.
*CurrenciesApi* | [**ListAccountByCurrency**](docs/CurrenciesApi.md#listaccountbycurrency) | **
Get** /v1/currencies/{code}/accounts | List all accounts with this currency.
*CurrenciesApi* | [**ListAvailableBudgetByCurrency**](docs/CurrenciesApi.md#listavailablebudgetbycurrency) | **
Get** /v1/currencies/{code}/available-budgets | List all available budgets with this currency.
*CurrenciesApi* | [**ListBillByCurrency**](docs/CurrenciesApi.md#listbillbycurrency) | **
Get** /v1/currencies/{code}/bills | List all bills with this currency.
*CurrenciesApi* | [**ListBudgetLimitByCurrency**](docs/CurrenciesApi.md#listbudgetlimitbycurrency) | **
Get** /v1/currencies/{code}/budget_limits | List all budget limits with this currency
*CurrenciesApi* | [**ListCurrency**](docs/CurrenciesApi.md#listcurrency) | **Get** /v1/currencies | List all currencies.
*CurrenciesApi* | [**ListRecurrenceByCurrency**](docs/CurrenciesApi.md#listrecurrencebycurrency) | **
Get** /v1/currencies/{code}/recurrences | List all recurring transactions with this currency.
*CurrenciesApi* | [**ListRuleByCurrency**](docs/CurrenciesApi.md#listrulebycurrency) | **
Get** /v1/currencies/{code}/rules | List all rules with this currency.
*CurrenciesApi* | [**ListTransactionByCurrency**](docs/CurrenciesApi.md#listtransactionbycurrency) | **
Get** /v1/currencies/{code}/transactions | List all transactions with this currency.
*CurrenciesApi* | [**StoreCurrency**](docs/CurrenciesApi.md#storecurrency) | **
Post** /v1/currencies | Store a new currency
*CurrenciesApi* | [**UpdateCurrency**](docs/CurrenciesApi.md#updatecurrency) | **
Put** /v1/currencies/{code} | Update existing currency.
*DataApi* | [**BulkUpdateTransactions**](docs/DataApi.md#bulkupdatetransactions) | **
Post** /v1/data/bulk/transactions | Bulk update transaction properties. For more information, see https://docs.firefly-iii.org/references/firefly-iii/api/specials/
*DataApi* | [**DestroyData**](docs/DataApi.md#destroydata) | **Delete** /v1/data/destroy | Endpoint to destroy user data
*DataApi* | [**ExportAccounts**](docs/DataApi.md#exportaccounts) | **
Get** /v1/data/export/accounts | Export account data from Firefly III
*DataApi* | [**ExportBills**](docs/DataApi.md#exportbills) | **
Get** /v1/data/export/bills | Export bills from Firefly III
*DataApi* | [**ExportBudgets**](docs/DataApi.md#exportbudgets) | **
Get** /v1/data/export/budgets | Export budgets and budget amount data from Firefly III
*DataApi* | [**ExportCategories**](docs/DataApi.md#exportcategories) | **
Get** /v1/data/export/categories | Export category data from Firefly III
*DataApi* | [**ExportPiggies**](docs/DataApi.md#exportpiggies) | **
Get** /v1/data/export/piggy-banks | Export piggy banks from Firefly III
*DataApi* | [**ExportRecurring**](docs/DataApi.md#exportrecurring) | **
Get** /v1/data/export/recurring | Export recurring transaction data from Firefly III
*DataApi* | [**ExportRules**](docs/DataApi.md#exportrules) | **
Get** /v1/data/export/rules | Export rule groups and rule data from Firefly III
*DataApi* | [**ExportTags**](docs/DataApi.md#exporttags) | **
Get** /v1/data/export/tags | Export tag data from Firefly III
*DataApi* | [**ExportTransactions**](docs/DataApi.md#exporttransactions) | **
Get** /v1/data/export/transactions | Export transaction data from Firefly III
*DataApi* | [**PurgeData**](docs/DataApi.md#purgedata) | **Delete** /v1/data/purge | Endpoint to purge user data
*InsightApi* | [**InsightExpenseAsset**](docs/InsightApi.md#insightexpenseasset) | **
Get** /v1/insight/expense/asset | Insight into expenses, grouped by asset account.
*InsightApi* | [**InsightExpenseBill**](docs/InsightApi.md#insightexpensebill) | **
Get** /v1/insight/expense/bill | Insight into expenses, grouped by bill.
*InsightApi* | [**InsightExpenseBudget**](docs/InsightApi.md#insightexpensebudget) | **
Get** /v1/insight/expense/budget | Insight into expenses, grouped by budget.
*InsightApi* | [**InsightExpenseCategory**](docs/InsightApi.md#insightexpensecategory) | **
Get** /v1/insight/expense/category | Insight into expenses, grouped by category.
*InsightApi* | [**InsightExpenseExpense**](docs/InsightApi.md#insightexpenseexpense) | **
Get** /v1/insight/expense/expense | Insight into expenses, grouped by expense account.
*InsightApi* | [**InsightExpenseNoBill**](docs/InsightApi.md#insightexpensenobill) | **
Get** /v1/insight/expense/no-bill | Insight into expenses, without bill.
*InsightApi* | [**InsightExpenseNoBudget**](docs/InsightApi.md#insightexpensenobudget) | **
Get** /v1/insight/expense/no-budget | Insight into expenses, without budget.
*InsightApi* | [**InsightExpenseNoCategory**](docs/InsightApi.md#insightexpensenocategory) | **
Get** /v1/insight/expense/no-category | Insight into expenses, without category.
*InsightApi* | [**InsightExpenseNoTag**](docs/InsightApi.md#insightexpensenotag) | **
Get** /v1/insight/expense/no-tag | Insight into expenses, without tag.
*InsightApi* | [**InsightExpenseTag**](docs/InsightApi.md#insightexpensetag) | **
Get** /v1/insight/expense/tag | Insight into expenses, grouped by tag.
*InsightApi* | [**InsightExpenseTotal**](docs/InsightApi.md#insightexpensetotal) | **
Get** /v1/insight/expense/total | Insight into total expenses.
*InsightApi* | [**InsightIncomeAsset**](docs/InsightApi.md#insightincomeasset) | **
Get** /v1/insight/income/asset | Insight into income, grouped by asset account.
*InsightApi* | [**InsightIncomeCategory**](docs/InsightApi.md#insightincomecategory) | **
Get** /v1/insight/income/category | Insight into income, grouped by category.
*InsightApi* | [**InsightIncomeNoCategory**](docs/InsightApi.md#insightincomenocategory) | **
Get** /v1/insight/income/no-category | Insight into income, without category.
*InsightApi* | [**InsightIncomeNoTag**](docs/InsightApi.md#insightincomenotag) | **
Get** /v1/insight/income/no-tag | Insight into income, without tag.
*InsightApi* | [**InsightIncomeRevenue**](docs/InsightApi.md#insightincomerevenue) | **
Get** /v1/insight/income/revenue | Insight into income, grouped by revenue account.
*InsightApi* | [**InsightIncomeTag**](docs/InsightApi.md#insightincometag) | **
Get** /v1/insight/income/tag | Insight into income, grouped by tag.
*InsightApi* | [**InsightIncomeTotal**](docs/InsightApi.md#insightincometotal) | **
Get** /v1/insight/income/total | Insight into total income.
*InsightApi* | [**InsightTransferCategory**](docs/InsightApi.md#insighttransfercategory) | **
Get** /v1/insight/transfer/category | Insight into transfers, grouped by category.
*InsightApi* | [**InsightTransferNoCategory**](docs/InsightApi.md#insighttransfernocategory) | **
Get** /v1/insight/transfer/no-category | Insight into transfers, without category.
*InsightApi* | [**InsightTransferNoTag**](docs/InsightApi.md#insighttransfernotag) | **
Get** /v1/insight/transfer/no-tag | Insight into expenses, without tag.
*InsightApi* | [**InsightTransferTag**](docs/InsightApi.md#insighttransfertag) | **
Get** /v1/insight/transfer/tag | Insight into transfers, grouped by tag.
*InsightApi* | [**InsightTransferTotal**](docs/InsightApi.md#insighttransfertotal) | **
Get** /v1/insight/transfer/total | Insight into total transfers.
*InsightApi* | [**InsightTransfers**](docs/InsightApi.md#insighttransfers) | **
Get** /v1/insight/transfer/asset | Insight into transfers, grouped by account.
*LinksApi* | [**DeleteLinkType**](docs/LinksApi.md#deletelinktype) | **
Delete** /v1/link-types/{id} | Permanently delete link type.
*LinksApi* | [**DeleteTransactionLink**](docs/LinksApi.md#deletetransactionlink) | **
Delete** /v1/transaction-links/{id} | Permanently delete link between transactions.
*LinksApi* | [**GetLinkType**](docs/LinksApi.md#getlinktype) | **Get** /v1/link-types/{id} | Get single a link type.
*LinksApi* | [**GetTransactionLink**](docs/LinksApi.md#gettransactionlink) | **
Get** /v1/transaction-links/{id} | Get a single link.
*LinksApi* | [**ListLinkType**](docs/LinksApi.md#listlinktype) | **Get** /v1/link-types | List all types of links.
*LinksApi* | [**ListTransactionByLinkType**](docs/LinksApi.md#listtransactionbylinktype) | **
Get** /v1/link-types/{id}/transactions | List all transactions under this link type.
*LinksApi* | [**ListTransactionLink**](docs/LinksApi.md#listtransactionlink) | **
Get** /v1/transaction-links | List all transaction links.
*LinksApi* | [**StoreLinkType**](docs/LinksApi.md#storelinktype) | **Post** /v1/link-types | Create a new link type
*LinksApi* | [**StoreTransactionLink**](docs/LinksApi.md#storetransactionlink) | **
Post** /v1/transaction-links | Create a new link between transactions
*LinksApi* | [**UpdateLinkType**](docs/LinksApi.md#updatelinktype) | **
Put** /v1/link-types/{id} | Update existing link type.
*LinksApi* | [**UpdateTransactionLink**](docs/LinksApi.md#updatetransactionlink) | **
Put** /v1/transaction-links/{id} | Update an existing link between transactions.
*ObjectGroupsApi* | [**DeleteObjectGroup**](docs/ObjectGroupsApi.md#deleteobjectgroup) | **
Delete** /v1/object-groups/{id} | Delete a object group.
*ObjectGroupsApi* | [**GetObjectGroup**](docs/ObjectGroupsApi.md#getobjectgroup) | **
Get** /v1/object-groups/{id} | Get a single object group.
*ObjectGroupsApi* | [**ListBillByObjectGroup**](docs/ObjectGroupsApi.md#listbillbyobjectgroup) | **
Get** /v1/object-groups/{id}/bills | List all bills with this object group.
*ObjectGroupsApi* | [**ListObjectGroups**](docs/ObjectGroupsApi.md#listobjectgroups) | **
Get** /v1/object-groups | List all oject groups.
*ObjectGroupsApi* | [**ListPiggyBankByObjectGroup**](docs/ObjectGroupsApi.md#listpiggybankbyobjectgroup) | **
Get** /v1/object-groups/{id}/piggy-banks | List all piggy banks related to the object group.
*ObjectGroupsApi* | [**UpdateObjectGroup**](docs/ObjectGroupsApi.md#updateobjectgroup) | **
Put** /v1/object-groups/{id} | Update existing object group.
*PiggyBanksApi* | [**DeletePiggyBank**](docs/PiggyBanksApi.md#deletepiggybank) | **
Delete** /v1/piggy-banks/{id} | Delete a piggy bank.
*PiggyBanksApi* | [**GetPiggyBank**](docs/PiggyBanksApi.md#getpiggybank) | **
Get** /v1/piggy-banks/{id} | Get a single piggy bank.
*PiggyBanksApi* | [**ListAttachmentByPiggyBank**](docs/PiggyBanksApi.md#listattachmentbypiggybank) | **
Get** /v1/piggy-banks/{id}/attachments | Lists all attachments.
*PiggyBanksApi* | [**ListEventByPiggyBank**](docs/PiggyBanksApi.md#listeventbypiggybank) | **
Get** /v1/piggy-banks/{id}/events | List all events linked to a piggy bank.
*PiggyBanksApi* | [**ListPiggyBank**](docs/PiggyBanksApi.md#listpiggybank) | **
Get** /v1/piggy-banks | List all piggy banks.
*PiggyBanksApi* | [**StorePiggyBank**](docs/PiggyBanksApi.md#storepiggybank) | **
Post** /v1/piggy-banks | Store a new piggy bank
*PiggyBanksApi* | [**UpdatePiggyBank**](docs/PiggyBanksApi.md#updatepiggybank) | **
Put** /v1/piggy-banks/{id} | Update existing piggy bank.
*PreferencesApi* | [**GetPreference**](docs/PreferencesApi.md#getpreference) | **
Get** /v1/preferences/{name} | Return a single preference.
*PreferencesApi* | [**ListPreference**](docs/PreferencesApi.md#listpreference) | **
Get** /v1/preferences | List all users preferences.
*PreferencesApi* | [**StorePreference**](docs/PreferencesApi.md#storepreference) | **
Post** /v1/preferences | Store a new preference for this user.
*PreferencesApi* | [**UpdatePreference**](docs/PreferencesApi.md#updatepreference) | **
Put** /v1/preferences/{name} | Update preference
*RecurrencesApi* | [**DeleteRecurrence**](docs/RecurrencesApi.md#deleterecurrence) | **
Delete** /v1/recurrences/{id} | Delete a recurring transaction.
*RecurrencesApi* | [**GetRecurrence**](docs/RecurrencesApi.md#getrecurrence) | **
Get** /v1/recurrences/{id} | Get a single recurring transaction.
*RecurrencesApi* | [**ListRecurrence**](docs/RecurrencesApi.md#listrecurrence) | **
Get** /v1/recurrences | List all recurring transactions.
*RecurrencesApi* | [**ListTransactionByRecurrence**](docs/RecurrencesApi.md#listtransactionbyrecurrence) | **
Get** /v1/recurrences/{id}/transactions | List all transactions created by a recurring transaction.
*RecurrencesApi* | [**StoreRecurrence**](docs/RecurrencesApi.md#storerecurrence) | **
Post** /v1/recurrences | Store a new recurring transaction
*RecurrencesApi* | [**UpdateRecurrence**](docs/RecurrencesApi.md#updaterecurrence) | **
Put** /v1/recurrences/{id} | Update existing recurring transaction.
*RuleGroupsApi* | [**DeleteRuleGroup**](docs/RuleGroupsApi.md#deleterulegroup) | **
Delete** /v1/rule-groups/{id} | Delete a rule group.
*RuleGroupsApi* | [**FireRuleGroup**](docs/RuleGroupsApi.md#firerulegroup) | **
Post** /v1/rule-groups/{id}/trigger | Fire the rule group on your transactions.
*RuleGroupsApi* | [**GetRuleGroup**](docs/RuleGroupsApi.md#getrulegroup) | **
Get** /v1/rule-groups/{id} | Get a single rule group.
*RuleGroupsApi* | [**ListRuleByGroup**](docs/RuleGroupsApi.md#listrulebygroup) | **
Get** /v1/rule-groups/{id}/rules | List rules in this rule group.
*RuleGroupsApi* | [**ListRuleGroup**](docs/RuleGroupsApi.md#listrulegroup) | **
Get** /v1/rule-groups | List all rule groups.
*RuleGroupsApi* | [**StoreRuleGroup**](docs/RuleGroupsApi.md#storerulegroup) | **
Post** /v1/rule-groups | Store a new rule group.
*RuleGroupsApi* | [**TestRuleGroup**](docs/RuleGroupsApi.md#testrulegroup) | **
Get** /v1/rule-groups/{id}/test | Test which transactions would be hit by the rule group. No changes will be made.
*RuleGroupsApi* | [**UpdateRuleGroup**](docs/RuleGroupsApi.md#updaterulegroup) | **
Put** /v1/rule-groups/{id} | Update existing rule group.
*RulesApi* | [**DeleteRule**](docs/RulesApi.md#deleterule) | **Delete** /v1/rules/{id} | Delete an rule.
*RulesApi* | [**FireRule**](docs/RulesApi.md#firerule) | **
Post** /v1/rules/{id}/trigger | Fire the rule on your transactions.
*RulesApi* | [**GetRule**](docs/RulesApi.md#getrule) | **Get** /v1/rules/{id} | Get a single rule.
*RulesApi* | [**ListRule**](docs/RulesApi.md#listrule) | **Get** /v1/rules | List all rules.
*RulesApi* | [**StoreRule**](docs/RulesApi.md#storerule) | **Post** /v1/rules | Store a new rule
*RulesApi* | [**TestRule**](docs/RulesApi.md#testrule) | **
Get** /v1/rules/{id}/test | Test which transactions would be hit by the rule. No changes will be made.
*RulesApi* | [**UpdateRule**](docs/RulesApi.md#updaterule) | **Put** /v1/rules/{id} | Update existing rule.
*SearchApi* | [**SearchAccounts**](docs/SearchApi.md#searchaccounts) | **Get** /v1/search/accounts | Search for accounts
*SearchApi* | [**SearchTransactions**](docs/SearchApi.md#searchtransactions) | **
Get** /v1/search/transactions | Search for transactions
*SummaryApi* | [**GetBasicSummary**](docs/SummaryApi.md#getbasicsummary) | **
Get** /v1/summary/basic | Returns basic sums of the users data.
*TagsApi* | [**DeleteTag**](docs/TagsApi.md#deletetag) | **Delete** /v1/tags/{tag} | Delete an tag.
*TagsApi* | [**GetTag**](docs/TagsApi.md#gettag) | **Get** /v1/tags/{tag} | Get a single tag.
*TagsApi* | [**ListAttachmentByTag**](docs/TagsApi.md#listattachmentbytag) | **
Get** /v1/tags/{tag}/attachments | Lists all attachments.
*TagsApi* | [**ListTag**](docs/TagsApi.md#listtag) | **Get** /v1/tags | List all tags.
*TagsApi* | [**ListTransactionByTag**](docs/TagsApi.md#listtransactionbytag) | **
Get** /v1/tags/{tag}/transactions | List all transactions with this tag.
*TagsApi* | [**StoreTag**](docs/TagsApi.md#storetag) | **Post** /v1/tags | Store a new tag
*TagsApi* | [**UpdateTag**](docs/TagsApi.md#updatetag) | **Put** /v1/tags/{tag} | Update existing tag.
*TransactionsApi* | [**DeleteTransaction**](docs/TransactionsApi.md#deletetransaction) | **
Delete** /v1/transactions/{id} | Delete a transaction.
*TransactionsApi* | [**DeleteTransactionJournal**](docs/TransactionsApi.md#deletetransactionjournal) | **
Delete** /v1/transaction-journals/{id} | Delete split from transaction
*TransactionsApi* | [**GetTransaction**](docs/TransactionsApi.md#gettransaction) | **
Get** /v1/transactions/{id} | Get a single transaction.
*TransactionsApi* | [**GetTransactionByJournal**](docs/TransactionsApi.md#gettransactionbyjournal) | **
Get** /v1/transaction-journals/{id} | Get a single transaction, based on one of the underlying transaction journals (transaction splits).
*TransactionsApi* | [**ListAttachmentByTransaction**](docs/TransactionsApi.md#listattachmentbytransaction) | **
Get** /v1/transactions/{id}/attachments | Lists all attachments.
*TransactionsApi* | [**ListEventByTransaction**](docs/TransactionsApi.md#listeventbytransaction) | **
Get** /v1/transactions/{id}/piggy-bank-events | Lists all piggy bank events.
*TransactionsApi* | [**ListLinksByJournal**](docs/TransactionsApi.md#listlinksbyjournal) | **
Get** /v1/transaction-journals/{id}/links | Lists all the transaction links for an individual journal (individual split).
*TransactionsApi* | [**ListTransaction**](docs/TransactionsApi.md#listtransaction) | **
Get** /v1/transactions | List all the user's transactions.
*TransactionsApi* | [**StoreTransaction**](docs/TransactionsApi.md#storetransaction) | **
Post** /v1/transactions | Store a new transaction
*TransactionsApi* | [**UpdateTransaction**](docs/TransactionsApi.md#updatetransaction) | **
Put** /v1/transactions/{id} | Update existing transaction. For more information, see https://docs.firefly-iii.org/references/firefly-iii/api/specials/
*UsersApi* | [**DeleteUser**](docs/UsersApi.md#deleteuser) | **Delete** /v1/users/{id} | Delete a user.
*UsersApi* | [**GetUser**](docs/UsersApi.md#getuser) | **Get** /v1/users/{id} | Get a single user.
*UsersApi* | [**ListUser**](docs/UsersApi.md#listuser) | **Get** /v1/users | List all users.
*UsersApi* | [**StoreUser**](docs/UsersApi.md#storeuser) | **Post** /v1/users | Store a new user
*UsersApi* | [**UpdateUser**](docs/UsersApi.md#updateuser) | **
Put** /v1/users/{id} | Update an existing user's information.
*WebhooksApi* | [**DeleteWebhook**](docs/WebhooksApi.md#deletewebhook) | **
Delete** /v1/webhooks/{id} | Delete a webhook.
*WebhooksApi* | [**DeleteWebhookMessage**](docs/WebhooksApi.md#deletewebhookmessage) | **
Delete** /v1/webhooks/{id}/messages/{messageId} | Delete a webhook message.
*WebhooksApi* | [**DeleteWebhookMessageAttempt**](docs/WebhooksApi.md#deletewebhookmessageattempt) | **
Delete** /v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId} | Delete a webhook attempt.
*WebhooksApi* | [**GetSingleWebhookMessage**](docs/WebhooksApi.md#getsinglewebhookmessage) | **
Get** /v1/webhooks/{id}/messages/{messageId} | Get a single message from a webhook.
*WebhooksApi* | [**GetSingleWebhookMessageAttempt**](docs/WebhooksApi.md#getsinglewebhookmessageattempt) | **
Get** /v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId} | Get a single failed attempt from a single webhook message.
*WebhooksApi* | [**GetWebhook**](docs/WebhooksApi.md#getwebhook) | **Get** /v1/webhooks/{id} | Get a single webhook.
*WebhooksApi* | [**GetWebhookMessageAttempts**](docs/WebhooksApi.md#getwebhookmessageattempts) | **
Get** /v1/webhooks/{id}/messages/{messageId}/attempts | Get all the failed attempts of a single webhook message.
*WebhooksApi* | [**GetWebhookMessages**](docs/WebhooksApi.md#getwebhookmessages) | **
Get** /v1/webhooks/{id}/messages | Get all the messages of a single webhook.
*WebhooksApi* | [**ListWebhook**](docs/WebhooksApi.md#listwebhook) | **Get** /v1/webhooks | List all webhooks.
*WebhooksApi* | [**StoreWebhook**](docs/WebhooksApi.md#storewebhook) | **Post** /v1/webhooks | Store a new webhook
*WebhooksApi* | [**SubmitWebook**](docs/WebhooksApi.md#submitwebook) | **
Post** /v1/webhooks/{id}/submit | Submit messages for a webhook.
*WebhooksApi* | [**TriggerTransactionWebhook**](docs/WebhooksApi.md#triggertransactionwebhook) | **
Post** /v1/webhooks/{id}/trigger-transaction/{transactionId} | Trigger webhook for a given transaction.
*WebhooksApi* | [**UpdateWebhook**](docs/WebhooksApi.md#updatewebhook) | **
Put** /v1/webhooks/{id} | Update existing webhook.
## Documentation For Models
- [Account](docs/Account.md)
- [AccountArray](docs/AccountArray.md)
- [AccountRead](docs/AccountRead.md)
- [AccountRoleProperty](docs/AccountRoleProperty.md)
- [AccountSearchFieldFilter](docs/AccountSearchFieldFilter.md)
- [AccountSingle](docs/AccountSingle.md)
- [AccountStore](docs/AccountStore.md)
- [AccountTypeFilter](docs/AccountTypeFilter.md)
- [AccountTypeProperty](docs/AccountTypeProperty.md)
- [AccountUpdate](docs/AccountUpdate.md)
- [AttachableType](docs/AttachableType.md)
- [Attachment](docs/Attachment.md)
- [AttachmentArray](docs/AttachmentArray.md)
- [AttachmentRead](docs/AttachmentRead.md)
- [AttachmentSingle](docs/AttachmentSingle.md)
- [AttachmentStore](docs/AttachmentStore.md)
- [AttachmentUpdate](docs/AttachmentUpdate.md)
- [AutoBudgetPeriod](docs/AutoBudgetPeriod.md)
- [AutoBudgetType](docs/AutoBudgetType.md)
- [AutocompleteAccount](docs/AutocompleteAccount.md)
- [AutocompleteBill](docs/AutocompleteBill.md)
- [AutocompleteBudget](docs/AutocompleteBudget.md)
- [AutocompleteCategory](docs/AutocompleteCategory.md)
- [AutocompleteCurrency](docs/AutocompleteCurrency.md)
- [AutocompleteCurrencyCode](docs/AutocompleteCurrencyCode.md)
- [AutocompleteObjectGroup](docs/AutocompleteObjectGroup.md)
- [AutocompletePiggy](docs/AutocompletePiggy.md)
- [AutocompletePiggyBalance](docs/AutocompletePiggyBalance.md)
- [AutocompleteRecurrence](docs/AutocompleteRecurrence.md)
- [AutocompleteRule](docs/AutocompleteRule.md)
- [AutocompleteRuleGroup](docs/AutocompleteRuleGroup.md)
- [AutocompleteTag](docs/AutocompleteTag.md)
- [AutocompleteTransaction](docs/AutocompleteTransaction.md)
- [AutocompleteTransactionId](docs/AutocompleteTransactionId.md)
- [AutocompleteTransactionType](docs/AutocompleteTransactionType.md)
- [AvailableBudget](docs/AvailableBudget.md)
- [AvailableBudgetArray](docs/AvailableBudgetArray.md)
- [AvailableBudgetRead](docs/AvailableBudgetRead.md)
- [AvailableBudgetSingle](docs/AvailableBudgetSingle.md)
- [BadRequestResponse](docs/BadRequestResponse.md)
- [BasicSummaryEntry](docs/BasicSummaryEntry.md)
- [Bill](docs/Bill.md)
- [BillArray](docs/BillArray.md)
- [BillPaidDates](docs/BillPaidDates.md)
- [BillRead](docs/BillRead.md)
- [BillRepeatFrequency](docs/BillRepeatFrequency.md)
- [BillSingle](docs/BillSingle.md)
- [BillStore](docs/BillStore.md)
- [BillUpdate](docs/BillUpdate.md)
- [Budget](docs/Budget.md)
- [BudgetArray](docs/BudgetArray.md)
- [BudgetLimit](docs/BudgetLimit.md)
- [BudgetLimitArray](docs/BudgetLimitArray.md)
- [BudgetLimitRead](docs/BudgetLimitRead.md)
- [BudgetLimitSingle](docs/BudgetLimitSingle.md)
- [BudgetLimitStore](docs/BudgetLimitStore.md)
- [BudgetRead](docs/BudgetRead.md)
- [BudgetSingle](docs/BudgetSingle.md)
- [BudgetSpent](docs/BudgetSpent.md)
- [BudgetStore](docs/BudgetStore.md)
- [BudgetUpdate](docs/BudgetUpdate.md)
- [Category](docs/Category.md)
- [CategoryArray](docs/CategoryArray.md)
- [CategoryEarned](docs/CategoryEarned.md)
- [CategoryRead](docs/CategoryRead.md)
- [CategorySingle](docs/CategorySingle.md)
- [CategorySpent](docs/CategorySpent.md)
- [CategoryUpdate](docs/CategoryUpdate.md)
- [ChartDataPoint](docs/ChartDataPoint.md)
- [ChartDataSet](docs/ChartDataSet.md)
- [ConfigValueFilter](docs/ConfigValueFilter.md)
- [ConfigValueUpdateFilter](docs/ConfigValueUpdateFilter.md)
- [Configuration](docs/Configuration.md)
- [ConfigurationSingle](docs/ConfigurationSingle.md)
- [ConfigurationUpdate](docs/ConfigurationUpdate.md)
- [CreditCardTypeProperty](docs/CreditCardTypeProperty.md)
- [CronResult](docs/CronResult.md)
- [CronResultRow](docs/CronResultRow.md)
- [Currency](docs/Currency.md)
- [CurrencyArray](docs/CurrencyArray.md)
- [CurrencyRead](docs/CurrencyRead.md)
- [CurrencySingle](docs/CurrencySingle.md)
- [CurrencyStore](docs/CurrencyStore.md)
- [CurrencyUpdate](docs/CurrencyUpdate.md)
- [DataDestroyObject](docs/DataDestroyObject.md)
- [ExportFileFilter](docs/ExportFileFilter.md)
- [InsightGroupEntry](docs/InsightGroupEntry.md)
- [InsightTotalEntry](docs/InsightTotalEntry.md)
- [InsightTransferEntry](docs/InsightTransferEntry.md)
- [InterestPeriodProperty](docs/InterestPeriodProperty.md)
- [InternalExceptionResponse](docs/InternalExceptionResponse.md)
- [LiabilityDirectionProperty](docs/LiabilityDirectionProperty.md)
- [LiabilityTypeProperty](docs/LiabilityTypeProperty.md)
- [LinkType](docs/LinkType.md)
- [LinkTypeArray](docs/LinkTypeArray.md)
- [LinkTypeRead](docs/LinkTypeRead.md)
- [LinkTypeSingle](docs/LinkTypeSingle.md)
- [LinkTypeUpdate](docs/LinkTypeUpdate.md)
- [Meta](docs/Meta.md)
- [MetaPagination](docs/MetaPagination.md)
- [NotFoundResponse](docs/NotFoundResponse.md)
- [ObjectGroup](docs/ObjectGroup.md)
- [ObjectGroupArray](docs/ObjectGroupArray.md)
- [ObjectGroupRead](docs/ObjectGroupRead.md)
- [ObjectGroupSingle](docs/ObjectGroupSingle.md)
- [ObjectGroupUpdate](docs/ObjectGroupUpdate.md)
- [ObjectLink](docs/ObjectLink.md)
- [ObjectLink0](docs/ObjectLink0.md)
- [PageLink](docs/PageLink.md)
- [PiggyBank](docs/PiggyBank.md)
- [PiggyBankArray](docs/PiggyBankArray.md)
- [PiggyBankEvent](docs/PiggyBankEvent.md)
- [PiggyBankEventArray](docs/PiggyBankEventArray.md)
- [PiggyBankEventRead](docs/PiggyBankEventRead.md)
- [PiggyBankRead](docs/PiggyBankRead.md)
- [PiggyBankSingle](docs/PiggyBankSingle.md)
- [PiggyBankStore](docs/PiggyBankStore.md)
- [PiggyBankUpdate](docs/PiggyBankUpdate.md)
- [PolymorphicProperty](docs/PolymorphicProperty.md)
- [Preference](docs/Preference.md)
- [PreferenceArray](docs/PreferenceArray.md)
- [PreferenceRead](docs/PreferenceRead.md)
- [PreferenceSingle](docs/PreferenceSingle.md)
- [PreferenceUpdate](docs/PreferenceUpdate.md)
- [Recurrence](docs/Recurrence.md)
- [RecurrenceArray](docs/RecurrenceArray.md)
- [RecurrenceRead](docs/RecurrenceRead.md)
- [RecurrenceRepetition](docs/RecurrenceRepetition.md)
- [RecurrenceRepetitionStore](docs/RecurrenceRepetitionStore.md)
- [RecurrenceRepetitionType](docs/RecurrenceRepetitionType.md)
- [RecurrenceRepetitionUpdate](docs/RecurrenceRepetitionUpdate.md)
- [RecurrenceSingle](docs/RecurrenceSingle.md)
- [RecurrenceStore](docs/RecurrenceStore.md)
- [RecurrenceTransaction](docs/RecurrenceTransaction.md)
- [RecurrenceTransactionStore](docs/RecurrenceTransactionStore.md)
- [RecurrenceTransactionType](docs/RecurrenceTransactionType.md)
- [RecurrenceTransactionUpdate](docs/RecurrenceTransactionUpdate.md)
- [RecurrenceUpdate](docs/RecurrenceUpdate.md)
- [Rule](docs/Rule.md)
- [RuleAction](docs/RuleAction.md)
- [RuleActionKeyword](docs/RuleActionKeyword.md)
- [RuleActionStore](docs/RuleActionStore.md)
- [RuleActionUpdate](docs/RuleActionUpdate.md)
- [RuleArray](docs/RuleArray.md)
- [RuleGroup](docs/RuleGroup.md)
- [RuleGroupArray](docs/RuleGroupArray.md)
- [RuleGroupRead](docs/RuleGroupRead.md)
- [RuleGroupSingle](docs/RuleGroupSingle.md)
- [RuleGroupStore](docs/RuleGroupStore.md)
- [RuleGroupUpdate](docs/RuleGroupUpdate.md)
- [RuleRead](docs/RuleRead.md)
- [RuleSingle](docs/RuleSingle.md)
- [RuleStore](docs/RuleStore.md)
- [RuleTrigger](docs/RuleTrigger.md)
- [RuleTriggerKeyword](docs/RuleTriggerKeyword.md)
- [RuleTriggerStore](docs/RuleTriggerStore.md)
- [RuleTriggerType](docs/RuleTriggerType.md)
- [RuleTriggerUpdate](docs/RuleTriggerUpdate.md)
- [RuleUpdate](docs/RuleUpdate.md)
- [ShortAccountTypeProperty](docs/ShortAccountTypeProperty.md)
- [SystemInfo](docs/SystemInfo.md)
- [SystemInfoData](docs/SystemInfoData.md)
- [TagArray](docs/TagArray.md)
- [TagModel](docs/TagModel.md)
- [TagModelStore](docs/TagModelStore.md)
- [TagModelUpdate](docs/TagModelUpdate.md)
- [TagRead](docs/TagRead.md)
- [TagSingle](docs/TagSingle.md)
- [Transaction](docs/Transaction.md)
- [TransactionArray](docs/TransactionArray.md)
- [TransactionLink](docs/TransactionLink.md)
- [TransactionLinkArray](docs/TransactionLinkArray.md)
- [TransactionLinkRead](docs/TransactionLinkRead.md)
- [TransactionLinkSingle](docs/TransactionLinkSingle.md)
- [TransactionLinkStore](docs/TransactionLinkStore.md)
- [TransactionLinkUpdate](docs/TransactionLinkUpdate.md)
- [TransactionRead](docs/TransactionRead.md)
- [TransactionSingle](docs/TransactionSingle.md)
- [TransactionSplit](docs/TransactionSplit.md)
- [TransactionSplitStore](docs/TransactionSplitStore.md)
- [TransactionSplitUpdate](docs/TransactionSplitUpdate.md)
- [TransactionStore](docs/TransactionStore.md)
- [TransactionTypeFilter](docs/TransactionTypeFilter.md)
- [TransactionTypeProperty](docs/TransactionTypeProperty.md)
- [TransactionUpdate](docs/TransactionUpdate.md)
- [UnauthenticatedResponse](docs/UnauthenticatedResponse.md)
- [User](docs/User.md)
- [UserArray](docs/UserArray.md)
- [UserBlockedCodeProperty](docs/UserBlockedCodeProperty.md)
- [UserRead](docs/UserRead.md)
- [UserRoleProperty](docs/UserRoleProperty.md)
- [UserSingle](docs/UserSingle.md)
- [ValidationErrorResponse](docs/ValidationErrorResponse.md)
- [ValidationErrorResponseErrors](docs/ValidationErrorResponseErrors.md)
- [Webhook](docs/Webhook.md)
- [WebhookArray](docs/WebhookArray.md)
- [WebhookAttempt](docs/WebhookAttempt.md)
- [WebhookAttemptArray](docs/WebhookAttemptArray.md)
- [WebhookAttemptRead](docs/WebhookAttemptRead.md)
- [WebhookAttemptSingle](docs/WebhookAttemptSingle.md)
- [WebhookDelivery](docs/WebhookDelivery.md)
- [WebhookMessage](docs/WebhookMessage.md)
- [WebhookMessageArray](docs/WebhookMessageArray.md)
- [WebhookMessageRead](docs/WebhookMessageRead.md)
- [WebhookMessageSingle](docs/WebhookMessageSingle.md)
- [WebhookRead](docs/WebhookRead.md)
- [WebhookResponse](docs/WebhookResponse.md)
- [WebhookSingle](docs/WebhookSingle.md)
- [WebhookStore](docs/WebhookStore.md)
- [WebhookTrigger](docs/WebhookTrigger.md)
- [WebhookUpdate](docs/WebhookUpdate.md)
## Documentation For Authorization
## firefly_iii_auth
- **Type**: OAuth
- **Flow**: accessCode
- **Authorization URL**: https://demo.firefly-iii.org/oauth/authorize
- **Scopes**:
Example
```golang
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)
```
Or via OAuth2 module to automatically refresh tokens and perform user authentication.
```golang
import "golang.org/x/oauth2"
/* Perform OAuth2 round trip request and obtain a token */
tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)
```
## local_bearer_auth
## Author
james@firefly-iii.org

441
firefly3/api_about.go Normal file

@ -0,0 +1,441 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"context"
"fmt"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type AboutApiService service
/*
AboutApiService System information end point.
Returns general system information and versions of the (supporting) software.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AboutApiGetAboutOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return SystemInfo
*/
type AboutApiGetAboutOpts struct {
XTraceId optional.Interface
}
func (a *AboutApiService) GetAbout(ctx context.Context, localVarOptionals *AboutApiGetAboutOpts) (SystemInfo, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue SystemInfo
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/about"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v SystemInfo
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AboutApiService Cron job endpoint
Firefly III has one endpoint for its various cron related tasks. Send a GET to this endpoint to run the cron. The cron requires the CLI token to be present. The cron job will fire for all users.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param cliToken The CLI token of any user in Firefly III, required to run the cron job.
* @param optional nil or *AboutApiGetCronOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Date" (optional.String) - A date formatted YYYY-MM-DD. This can be used to make the cron job pretend it&#x27;s running on another day.
* @param "Force" (optional.Bool) - Forces the cron job to fire, regardless of whether it has fired before. This may result in double transactions or weird budgets, so be careful.
@return CronResult
*/
type AboutApiGetCronOpts struct {
XTraceId optional.Interface
Date optional.String
Force optional.Bool
}
func (a *AboutApiService) GetCron(ctx context.Context, cliToken string, localVarOptionals *AboutApiGetCronOpts) (CronResult, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue CronResult
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/cron/{cliToken}"
localVarPath = strings.Replace(localVarPath, "{"+"cliToken"+"}", fmt.Sprintf("%v", cliToken), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Date.IsSet() {
localVarQueryParams.Add("date", parameterToString(localVarOptionals.Date.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Force.IsSet() {
localVarQueryParams.Add("force", parameterToString(localVarOptionals.Force.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v CronResult
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AboutApiService Currently authenticated user endpoint.
Returns the currently authenticated user.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AboutApiGetCurrentUserOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return UserSingle
*/
type AboutApiGetCurrentUserOpts struct {
XTraceId optional.Interface
}
func (a *AboutApiService) GetCurrentUser(ctx context.Context, localVarOptionals *AboutApiGetCurrentUserOpts) (UserSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue UserSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/about/user"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json", "application/vnd.firefly3+json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v UserSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}

1188
firefly3/api_accounts.go Normal file

File diff suppressed because it is too large Load Diff

992
firefly3/api_attachments.go Normal file

@ -0,0 +1,992 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"context"
"fmt"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"os"
"strings"
)
// Linger please
var (
_ context.Context
)
type AttachmentsApiService service
/*
AttachmentsApiService Delete an attachment.
With this endpoint you delete an attachment, including any stored file data.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the single attachment.
* @param optional nil or *AttachmentsApiDeleteAttachmentOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
*/
type AttachmentsApiDeleteAttachmentOpts struct {
XTraceId optional.Interface
}
func (a *AttachmentsApiService) DeleteAttachment(ctx context.Context, id string, localVarOptionals *AttachmentsApiDeleteAttachmentOpts) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/attachments/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
return localVarHttpResponse, newErr
}
return localVarHttpResponse, nil
}
/*
AttachmentsApiService Download a single attachment.
This endpoint allows you to download the binary content of a transaction. It will be sent to you as a download, using the content type \&quot;application/octet-stream\&quot; and content disposition \&quot;attachment; filename&#x3D;example.pdf\&quot;.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the attachment.
* @param optional nil or *AttachmentsApiDownloadAttachmentOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return *os.File
*/
type AttachmentsApiDownloadAttachmentOpts struct {
XTraceId optional.Interface
}
func (a *AttachmentsApiService) DownloadAttachment(ctx context.Context, id string, localVarOptionals *AttachmentsApiDownloadAttachmentOpts) (*os.File, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue *os.File
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/attachments/{id}/download"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/octet-stream", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v *os.File
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AttachmentsApiService Get a single attachment.
Get a single attachment. This endpoint only returns the available metadata for the attachment. Actual file data is handled in two other endpoints (see below).
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the attachment.
* @param optional nil or *AttachmentsApiGetAttachmentOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return AttachmentSingle
*/
type AttachmentsApiGetAttachmentOpts struct {
XTraceId optional.Interface
}
func (a *AttachmentsApiService) GetAttachment(ctx context.Context, id string, localVarOptionals *AttachmentsApiGetAttachmentOpts) (AttachmentSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue AttachmentSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/attachments/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json", "application/vnd.firefly3+json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v AttachmentSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AttachmentsApiService List all attachments.
This endpoint lists all attachments.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AttachmentsApiListAttachmentOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
@return AttachmentArray
*/
type AttachmentsApiListAttachmentOpts struct {
XTraceId optional.Interface
Limit optional.Int32
Page optional.Int32
}
func (a *AttachmentsApiService) ListAttachment(ctx context.Context, localVarOptionals *AttachmentsApiListAttachmentOpts) (AttachmentArray, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue AttachmentArray
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/attachments"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json", "application/vnd.firefly3+json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v AttachmentArray
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AttachmentsApiService Store a new attachment.
Creates a new attachment. The data required can be submitted as a JSON body or as a list of parameters. You cannot use this endpoint to upload the actual file data (see below). This endpoint only creates the attachment object.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body JSON array or key&#x3D;value pairs with the necessary attachment information. See the model for the exact specifications.
* @param optional nil or *AttachmentsApiStoreAttachmentOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return AttachmentSingle
*/
type AttachmentsApiStoreAttachmentOpts struct {
XTraceId optional.Interface
}
func (a *AttachmentsApiService) StoreAttachment(ctx context.Context, body AttachmentStore, localVarOptionals *AttachmentsApiStoreAttachmentOpts) (AttachmentSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue AttachmentSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/attachments"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "application/x-www-form-urlencoded"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json", "application/vnd.firefly3+json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
// body params
localVarPostBody = &body
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v AttachmentSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 422 {
var v ValidationErrorResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AttachmentsApiService Update existing attachment.
Update the meta data for an existing attachment. This endpoint does not allow you to upload or download data. For that, see below.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body JSON array with updated attachment information. See the model for the exact specifications.
* @param id The ID of the attachment.
* @param optional nil or *AttachmentsApiUpdateAttachmentOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return AttachmentSingle
*/
type AttachmentsApiUpdateAttachmentOpts struct {
XTraceId optional.Interface
}
func (a *AttachmentsApiService) UpdateAttachment(ctx context.Context, body AttachmentUpdate, id string, localVarOptionals *AttachmentsApiUpdateAttachmentOpts) (AttachmentSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue AttachmentSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/attachments/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "application/x-www-form-urlencoded"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json", "application/vnd.firefly3+json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
// body params
localVarPostBody = &body
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v AttachmentSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 422 {
var v ValidationErrorResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AttachmentsApiService Upload an attachment.
Use this endpoint to upload (and possible overwrite) the file contents of an attachment. Simply put the entire file in the body as binary data.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the attachment.
* @param optional nil or *AttachmentsApiUploadAttachmentOpts - Optional Parameters:
* @param "Body" (optional.Interface of Object) -
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
*/
type AttachmentsApiUploadAttachmentOpts struct {
Body optional.Interface
XTraceId optional.Interface
}
func (a *AttachmentsApiService) UploadAttachment(ctx context.Context, id string, localVarOptionals *AttachmentsApiUploadAttachmentOpts) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/attachments/{id}/upload"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/octet-stream"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
// body params
if localVarOptionals != nil && localVarOptionals.Body.IsSet() {
localVarOptionalBody := localVarOptionals.Body.Value()
localVarPostBody = &localVarOptionalBody
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 422 {
var v ValidationErrorResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
return localVarHttpResponse, newErr
}
return localVarHttpResponse, nil
}

2324
firefly3/api_autocomplete.go Normal file

File diff suppressed because it is too large Load Diff

@ -0,0 +1,317 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"context"
"fmt"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type AvailableBudgetsApiService service
/*
AvailableBudgetsApiService Get a single available budget.
Get a single available budget, by ID.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the available budget.
* @param optional nil or *AvailableBudgetsApiGetAvailableBudgetOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return AvailableBudgetSingle
*/
type AvailableBudgetsApiGetAvailableBudgetOpts struct {
XTraceId optional.Interface
}
func (a *AvailableBudgetsApiService) GetAvailableBudget(ctx context.Context, id string, localVarOptionals *AvailableBudgetsApiGetAvailableBudgetOpts) (AvailableBudgetSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue AvailableBudgetSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/available-budgets/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json", "application/vnd.firefly3+json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v AvailableBudgetSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
AvailableBudgetsApiService List all available budget amounts.
Firefly III allows users to set the amount that is available to be budgeted in so-called \&quot;available budgets\&quot;. For example, the user could have 1200,- available to be divided during the coming month. This amount is used on the /budgets page. This endpoint returns all of these amounts and the periods for which they are set.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *AvailableBudgetsApiListAvailableBudgetOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
* @param "Start" (optional.String) - A date formatted YYYY-MM-DD.
* @param "End" (optional.String) - A date formatted YYYY-MM-DD.
@return AvailableBudgetArray
*/
type AvailableBudgetsApiListAvailableBudgetOpts struct {
XTraceId optional.Interface
Limit optional.Int32
Page optional.Int32
Start optional.String
End optional.String
}
func (a *AvailableBudgetsApiService) ListAvailableBudget(ctx context.Context, localVarOptionals *AvailableBudgetsApiListAvailableBudgetOpts) (AvailableBudgetArray, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue AvailableBudgetArray
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/available-budgets"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Start.IsSet() {
localVarQueryParams.Add("start", parameterToString(localVarOptionals.Start.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.End.IsSet() {
localVarQueryParams.Add("end", parameterToString(localVarOptionals.End.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json", "application/vnd.firefly3+json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v AvailableBudgetArray
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}

1173
firefly3/api_bills.go Normal file

File diff suppressed because it is too large Load Diff

2043
firefly3/api_budgets.go Normal file

File diff suppressed because it is too large Load Diff

1037
firefly3/api_categories.go Normal file

File diff suppressed because it is too large Load Diff

164
firefly3/api_charts.go Normal file

@ -0,0 +1,164 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"context"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type ChartsApiService service
/*
ChartsApiService Dashboard chart with asset account balance information.
This endpoint returns the data required to generate a chart with basic asset account balance information.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
* @param optional nil or *ChartsApiGetChartAccountOverviewOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return []ChartDataSet
*/
type ChartsApiGetChartAccountOverviewOpts struct {
XTraceId optional.Interface
}
func (a *ChartsApiService) GetChartAccountOverview(ctx context.Context, start string, end string, localVarOptionals *ChartsApiGetChartAccountOverviewOpts) ([]ChartDataSet, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []ChartDataSet
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/chart/account/overview"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []ChartDataSet
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}

@ -0,0 +1,445 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"context"
"fmt"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type ConfigurationApiService service
/*
ConfigurationApiService Get Firefly III system configuration values.
Returns all editable and not-editable configuration values for this Firefly III installation
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *ConfigurationApiGetConfigurationOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return []Configuration
*/
type ConfigurationApiGetConfigurationOpts struct {
XTraceId optional.Interface
}
func (a *ConfigurationApiService) GetConfiguration(ctx context.Context, localVarOptionals *ConfigurationApiGetConfigurationOpts) ([]Configuration, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue []Configuration
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/configuration"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json", "application/x-www-form-urlencoded"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v []Configuration
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
ConfigurationApiService Get a single Firefly III system configuration value
Returns one configuration variable for this Firefly III installation
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param name The name of the configuration value you want to know.
* @param optional nil or *ConfigurationApiGetSingleConfigurationOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return ConfigurationSingle
*/
type ConfigurationApiGetSingleConfigurationOpts struct {
XTraceId optional.Interface
}
func (a *ConfigurationApiService) GetSingleConfiguration(ctx context.Context, name ConfigValueFilter, localVarOptionals *ConfigurationApiGetSingleConfigurationOpts) (ConfigurationSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue ConfigurationSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/configuration/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v ConfigurationSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
ConfigurationApiService Update configuration value
Set a single configuration value. Not all configuration values can be updated so the list of accepted configuration variables is small.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param value
* @param name The name of the configuration value you want to update.
* @param optional nil or *ConfigurationApiSetConfigurationOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return ConfigurationSingle
*/
type ConfigurationApiSetConfigurationOpts struct {
XTraceId optional.Interface
}
func (a *ConfigurationApiService) SetConfiguration(ctx context.Context, value PolymorphicProperty, name ConfigValueUpdateFilter, localVarOptionals *ConfigurationApiSetConfigurationOpts) (ConfigurationSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue ConfigurationSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/configuration/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/x-www-form-urlencoded", "application/json"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
// body params
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v ConfigurationSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 422 {
var v ValidationErrorResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}

2319
firefly3/api_currencies.go Normal file

File diff suppressed because it is too large Load Diff

1616
firefly3/api_data.go Normal file

File diff suppressed because it is too large Load Diff

3498
firefly3/api_insight.go Normal file

File diff suppressed because it is too large Load Diff

1574
firefly3/api_links.go Normal file

File diff suppressed because it is too large Load Diff

@ -0,0 +1,865 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"context"
"fmt"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type ObjectGroupsApiService service
/*
ObjectGroupsApiService Delete a object group.
Delete a object group.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the object group.
* @param optional nil or *ObjectGroupsApiDeleteObjectGroupOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
*/
type ObjectGroupsApiDeleteObjectGroupOpts struct {
XTraceId optional.Interface
}
func (a *ObjectGroupsApiService) DeleteObjectGroup(ctx context.Context, id string, localVarOptionals *ObjectGroupsApiDeleteObjectGroupOpts) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/object-groups/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
return localVarHttpResponse, newErr
}
return localVarHttpResponse, nil
}
/*
ObjectGroupsApiService Get a single object group.
Get a single object group.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the object group.
* @param optional nil or *ObjectGroupsApiGetObjectGroupOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return ObjectGroupSingle
*/
type ObjectGroupsApiGetObjectGroupOpts struct {
XTraceId optional.Interface
}
func (a *ObjectGroupsApiService) GetObjectGroup(ctx context.Context, id string, localVarOptionals *ObjectGroupsApiGetObjectGroupOpts) (ObjectGroupSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue ObjectGroupSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/object-groups/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v ObjectGroupSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
ObjectGroupsApiService List all bills with this object group.
List all bills with this object group.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the account.
* @param optional nil or *ObjectGroupsApiListBillByObjectGroupOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
@return BillArray
*/
type ObjectGroupsApiListBillByObjectGroupOpts struct {
XTraceId optional.Interface
Limit optional.Int32
Page optional.Int32
}
func (a *ObjectGroupsApiService) ListBillByObjectGroup(ctx context.Context, id string, localVarOptionals *ObjectGroupsApiListBillByObjectGroupOpts) (BillArray, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue BillArray
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/object-groups/{id}/bills"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v BillArray
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
ObjectGroupsApiService List all oject groups.
List all oject groups.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *ObjectGroupsApiListObjectGroupsOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
@return ObjectGroupArray
*/
type ObjectGroupsApiListObjectGroupsOpts struct {
XTraceId optional.Interface
Limit optional.Int32
Page optional.Int32
}
func (a *ObjectGroupsApiService) ListObjectGroups(ctx context.Context, localVarOptionals *ObjectGroupsApiListObjectGroupsOpts) (ObjectGroupArray, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue ObjectGroupArray
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/object-groups"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v ObjectGroupArray
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
ObjectGroupsApiService List all piggy banks related to the object group.
This endpoint returns a list of all the piggy banks connected to the object group.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the account.
* @param optional nil or *ObjectGroupsApiListPiggyBankByObjectGroupOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
@return PiggyBankArray
*/
type ObjectGroupsApiListPiggyBankByObjectGroupOpts struct {
XTraceId optional.Interface
Limit optional.Int32
Page optional.Int32
}
func (a *ObjectGroupsApiService) ListPiggyBankByObjectGroup(ctx context.Context, id string, localVarOptionals *ObjectGroupsApiListPiggyBankByObjectGroupOpts) (PiggyBankArray, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue PiggyBankArray
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/object-groups/{id}/piggy-banks"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v PiggyBankArray
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
ObjectGroupsApiService Update existing object group.
Update existing object group.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body JSON array with updated piggy bank information. See the model for the exact specifications.
* @param id The ID of the object group
* @param optional nil or *ObjectGroupsApiUpdateObjectGroupOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return ObjectGroupSingle
*/
type ObjectGroupsApiUpdateObjectGroupOpts struct {
XTraceId optional.Interface
}
func (a *ObjectGroupsApiService) UpdateObjectGroup(ctx context.Context, body ObjectGroupUpdate, id string, localVarOptionals *ObjectGroupsApiUpdateObjectGroupOpts) (ObjectGroupSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue ObjectGroupSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/object-groups/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "application/x-www-form-urlencoded"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
// body params
localVarPostBody = &body
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v ObjectGroupSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 422 {
var v ValidationErrorResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}

1012
firefly3/api_piggy_banks.go Normal file

File diff suppressed because it is too large Load Diff

603
firefly3/api_preferences.go Normal file

@ -0,0 +1,603 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"context"
"fmt"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type PreferencesApiService service
/*
PreferencesApiService Return a single preference.
Return a single preference and the value.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param name The name of the preference.
* @param optional nil or *PreferencesApiGetPreferenceOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return PreferenceSingle
*/
type PreferencesApiGetPreferenceOpts struct {
XTraceId optional.Interface
}
func (a *PreferencesApiService) GetPreference(ctx context.Context, name string, localVarOptionals *PreferencesApiGetPreferenceOpts) (PreferenceSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue PreferenceSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/preferences/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v PreferenceSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
PreferencesApiService List all users preferences.
List all of the preferences of the user.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *PreferencesApiListPreferenceOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
@return PreferenceArray
*/
type PreferencesApiListPreferenceOpts struct {
XTraceId optional.Interface
Limit optional.Int32
Page optional.Int32
}
func (a *PreferencesApiService) ListPreference(ctx context.Context, localVarOptionals *PreferencesApiListPreferenceOpts) (PreferenceArray, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue PreferenceArray
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/preferences"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v PreferenceArray
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
PreferencesApiService Store a new preference for this user.
This endpoint creates a new preference. The name and data are free-format, and entirely up to you. If the preference is not used in Firefly III itself it may not be configurable through the user interface, but you can use this endpoint to persist custom data for your own app.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body JSON array with the necessary preference information or key&#x3D;value pairs. See the model for the exact specifications.
* @param optional nil or *PreferencesApiStorePreferenceOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return PreferenceSingle
*/
type PreferencesApiStorePreferenceOpts struct {
XTraceId optional.Interface
}
func (a *PreferencesApiService) StorePreference(ctx context.Context, body Preference, localVarOptionals *PreferencesApiStorePreferenceOpts) (PreferenceSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue PreferenceSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/preferences"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "application/x-www-form-urlencoded"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
// body params
localVarPostBody = &body
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v PreferenceSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 422 {
var v ValidationErrorResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
PreferencesApiService Update preference
Update a user&#x27;s preference.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body JSON array or key&#x3D;value pairs with the necessary preference information. See the model for the exact specifications.
* @param name The name of the preference. Will always overwrite. Will be created if it does not exist.
* @param optional nil or *PreferencesApiUpdatePreferenceOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return PreferenceSingle
*/
type PreferencesApiUpdatePreferenceOpts struct {
XTraceId optional.Interface
}
func (a *PreferencesApiService) UpdatePreference(ctx context.Context, body PreferenceUpdate, name string, localVarOptionals *PreferencesApiUpdatePreferenceOpts) (PreferenceSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue PreferenceSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/preferences/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "application/x-www-form-urlencoded"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
// body params
localVarPostBody = &body
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v PreferenceSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 422 {
var v ValidationErrorResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}

881
firefly3/api_recurrences.go Normal file

@ -0,0 +1,881 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"context"
"fmt"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type RecurrencesApiService service
/*
RecurrencesApiService Delete a recurring transaction.
Delete a recurring transaction. Transactions created by the recurring transaction will not be deleted.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the recurring transaction.
* @param optional nil or *RecurrencesApiDeleteRecurrenceOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
*/
type RecurrencesApiDeleteRecurrenceOpts struct {
XTraceId optional.Interface
}
func (a *RecurrencesApiService) DeleteRecurrence(ctx context.Context, id string, localVarOptionals *RecurrencesApiDeleteRecurrenceOpts) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/recurrences/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
return localVarHttpResponse, newErr
}
return localVarHttpResponse, nil
}
/*
RecurrencesApiService Get a single recurring transaction.
Get a single recurring transaction.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the recurring transaction.
* @param optional nil or *RecurrencesApiGetRecurrenceOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return RecurrenceSingle
*/
type RecurrencesApiGetRecurrenceOpts struct {
XTraceId optional.Interface
}
func (a *RecurrencesApiService) GetRecurrence(ctx context.Context, id string, localVarOptionals *RecurrencesApiGetRecurrenceOpts) (RecurrenceSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue RecurrenceSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/recurrences/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v RecurrenceSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
RecurrencesApiService List all recurring transactions.
List all recurring transactions.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *RecurrencesApiListRecurrenceOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
@return RecurrenceArray
*/
type RecurrencesApiListRecurrenceOpts struct {
XTraceId optional.Interface
Limit optional.Int32
Page optional.Int32
}
func (a *RecurrencesApiService) ListRecurrence(ctx context.Context, localVarOptionals *RecurrencesApiListRecurrenceOpts) (RecurrenceArray, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue RecurrenceArray
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/recurrences"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v RecurrenceArray
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
RecurrencesApiService List all transactions created by a recurring transaction.
List all transactions created by a recurring transaction, optionally limited to the date ranges specified.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The ID of the recurring transaction.
* @param optional nil or *RecurrencesApiListTransactionByRecurrenceOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
* @param "Start" (optional.String) - A date formatted YYYY-MM-DD. Both the start and end date must be present.
* @param "End" (optional.String) - A date formatted YYYY-MM-DD. Both the start and end date must be present.
* @param "Type_" (optional.Interface of TransactionTypeFilter) - Optional filter on the transaction type(s) returned
@return TransactionArray
*/
type RecurrencesApiListTransactionByRecurrenceOpts struct {
XTraceId optional.Interface
Limit optional.Int32
Page optional.Int32
Start optional.String
End optional.String
Type_ optional.Interface
}
func (a *RecurrencesApiService) ListTransactionByRecurrence(ctx context.Context, id string, localVarOptionals *RecurrencesApiListTransactionByRecurrenceOpts) (TransactionArray, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue TransactionArray
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/recurrences/{id}/transactions"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Start.IsSet() {
localVarQueryParams.Add("start", parameterToString(localVarOptionals.Start.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.End.IsSet() {
localVarQueryParams.Add("end", parameterToString(localVarOptionals.End.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Type_.IsSet() {
localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v TransactionArray
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
RecurrencesApiService 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 ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body JSON array or key&#x3D;value pairs with the necessary recurring transaction information. See the model for the exact specifications.
* @param optional nil or *RecurrencesApiStoreRecurrenceOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return RecurrenceSingle
*/
type RecurrencesApiStoreRecurrenceOpts struct {
XTraceId optional.Interface
}
func (a *RecurrencesApiService) StoreRecurrence(ctx context.Context, body RecurrenceStore, localVarOptionals *RecurrencesApiStoreRecurrenceOpts) (RecurrenceSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue RecurrenceSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/recurrences"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "application/x-www-form-urlencoded"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
// body params
localVarPostBody = &body
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v RecurrenceSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 422 {
var v ValidationErrorResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
RecurrencesApiService Update existing recurring transaction.
Update existing recurring transaction.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body JSON array with updated recurring transaction information. See the model for the exact specifications.
* @param id The ID of the recurring transaction.
* @param optional nil or *RecurrencesApiUpdateRecurrenceOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return RecurrenceSingle
*/
type RecurrencesApiUpdateRecurrenceOpts struct {
XTraceId optional.Interface
}
func (a *RecurrencesApiService) UpdateRecurrence(ctx context.Context, body RecurrenceUpdate, id string, localVarOptionals *RecurrencesApiUpdateRecurrenceOpts) (RecurrenceSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue RecurrenceSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/recurrences/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "application/x-www-form-urlencoded"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
// body params
localVarPostBody = &body
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v RecurrenceSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 422 {
var v ValidationErrorResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}

1169
firefly3/api_rule_groups.go Normal file

File diff suppressed because it is too large Load Diff

1003
firefly3/api_rules.go Normal file

File diff suppressed because it is too large Load Diff

325
firefly3/api_search.go Normal file

@ -0,0 +1,325 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"context"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type SearchApiService service
/*
SearchApiService Search for accounts
Search for accounts
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param query The query you wish to search for.
* @param field The account field(s) you want to search in.
* @param optional nil or *SearchApiSearchAccountsOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
* @param "Type_" (optional.Interface of AccountTypeFilter) - The type of accounts you wish to limit the search to.
@return AccountArray
*/
type SearchApiSearchAccountsOpts struct {
XTraceId optional.Interface
Limit optional.Int32
Page optional.Int32
Type_ optional.Interface
}
func (a *SearchApiService) SearchAccounts(ctx context.Context, query string, field AccountSearchFieldFilter, localVarOptionals *SearchApiSearchAccountsOpts) (AccountArray, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue AccountArray
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/search/accounts"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
localVarQueryParams.Add("query", parameterToString(query, ""))
if localVarOptionals != nil && localVarOptionals.Type_.IsSet() {
localVarQueryParams.Add("type", parameterToString(localVarOptionals.Type_.Value(), ""))
}
localVarQueryParams.Add("field", parameterToString(field, ""))
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v AccountArray
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
SearchApiService Search for transactions
Searches through the users transactions.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param query The query you wish to search for.
* @param optional nil or *SearchApiSearchTransactionsOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
@return TransactionArray
*/
type SearchApiSearchTransactionsOpts struct {
XTraceId optional.Interface
Limit optional.Int32
Page optional.Int32
}
func (a *SearchApiService) SearchTransactions(ctx context.Context, query string, localVarOptionals *SearchApiSearchTransactionsOpts) (TransactionArray, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue TransactionArray
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/search/transactions"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
localVarQueryParams.Add("query", parameterToString(query, ""))
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v TransactionArray
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}

169
firefly3/api_summary.go Normal file

@ -0,0 +1,169 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"context"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type SummaryApiService service
/*
SummaryApiService Returns basic sums of the users data.
Returns basic sums of the users data, like the net worth, spent and earned amounts. It is multi-currency, and is used in Firefly III to populate the dashboard.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param start A date formatted YYYY-MM-DD.
* @param end A date formatted YYYY-MM-DD.
* @param optional nil or *SummaryApiGetBasicSummaryOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "CurrencyCode" (optional.String) - A currency code like EUR or USD, to filter the result.
@return map[string]BasicSummaryEntry
*/
type SummaryApiGetBasicSummaryOpts struct {
XTraceId optional.Interface
CurrencyCode optional.String
}
func (a *SummaryApiService) GetBasicSummary(ctx context.Context, start string, end string, localVarOptionals *SummaryApiGetBasicSummaryOpts) (map[string]BasicSummaryEntry, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue map[string]BasicSummaryEntry
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/summary/basic"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
localVarQueryParams.Add("start", parameterToString(start, ""))
localVarQueryParams.Add("end", parameterToString(end, ""))
if localVarOptionals != nil && localVarOptionals.CurrencyCode.IsSet() {
localVarQueryParams.Add("currency_code", parameterToString(localVarOptionals.CurrencyCode.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v map[string]BasicSummaryEntry
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}

1037
firefly3/api_tags.go Normal file

File diff suppressed because it is too large Load Diff

1426
firefly3/api_transactions.go Normal file

File diff suppressed because it is too large Load Diff

720
firefly3/api_users.go Normal file

@ -0,0 +1,720 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"context"
"fmt"
"github.com/antihax/optional"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// Linger please
var (
_ context.Context
)
type UsersApiService service
/*
UsersApiService Delete a user.
Delete a user. You cannot delete the user you&#x27;re authenticated with. This cannot be undone. Be careful!
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The user ID.
* @param optional nil or *UsersApiDeleteUserOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
*/
type UsersApiDeleteUserOpts struct {
XTraceId optional.Interface
}
func (a *UsersApiService) DeleteUser(ctx context.Context, id string, localVarOptionals *UsersApiDeleteUserOpts) (*http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/users/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarHttpResponse, newErr
}
newErr.model = v
return localVarHttpResponse, newErr
}
return localVarHttpResponse, newErr
}
return localVarHttpResponse, nil
}
/*
UsersApiService Get a single user.
Gets all info of a single user.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param id The user ID.
* @param optional nil or *UsersApiGetUserOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return UserSingle
*/
type UsersApiGetUserOpts struct {
XTraceId optional.Interface
}
func (a *UsersApiService) GetUser(ctx context.Context, id string, localVarOptionals *UsersApiGetUserOpts) (UserSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue UserSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/users/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v UserSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
UsersApiService List all users.
List all the users in this instance of Firefly III.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param optional nil or *UsersApiListUserOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
* @param "Limit" (optional.Int32) - Number of items per page. The default pagination is per 50 items.
* @param "Page" (optional.Int32) - Page number. The default pagination is per 50 items.
@return UserArray
*/
type UsersApiListUserOpts struct {
XTraceId optional.Interface
Limit optional.Int32
Page optional.Int32
}
func (a *UsersApiService) ListUser(ctx context.Context, localVarOptionals *UsersApiListUserOpts) (UserArray, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue UserArray
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/users"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if localVarOptionals != nil && localVarOptionals.Limit.IsSet() {
localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), ""))
}
if localVarOptionals != nil && localVarOptionals.Page.IsSet() {
localVarQueryParams.Add("page", parameterToString(localVarOptionals.Page.Value(), ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v UserArray
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
UsersApiService Store a new user
Creates a new user. The data required can be submitted as a JSON body or as a list of parameters. The user will be given a random password, which they can reset using the \&quot;forgot password\&quot; function.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body JSON array or key&#x3D;value pairs with the necessary user information. See the model for the exact specifications.
* @param optional nil or *UsersApiStoreUserOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return UserSingle
*/
type UsersApiStoreUserOpts struct {
XTraceId optional.Interface
}
func (a *UsersApiService) StoreUser(ctx context.Context, body User, localVarOptionals *UsersApiStoreUserOpts) (UserSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue UserSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/users"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "application/x-www-form-urlencoded"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/json", "application/vnd.firefly3+json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
// body params
localVarPostBody = &body
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 200 {
var v UserSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 422 {
var v ValidationErrorResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}
/*
UsersApiService Update an existing user&#x27;s information.
Update existing user.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body JSON array with updated user information. See the model for the exact specifications.
* @param id The user ID.
* @param optional nil or *UsersApiUpdateUserOpts - Optional Parameters:
* @param "XTraceId" (optional.Interface of string) - Unique identifier associated with this request.
@return UserSingle
*/
type UsersApiUpdateUserOpts struct {
XTraceId optional.Interface
}
func (a *UsersApiService) UpdateUser(ctx context.Context, body User, id string, localVarOptionals *UsersApiUpdateUserOpts) (UserSingle, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
localVarReturnValue UserSingle
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/v1/users/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{"application/json", "application/x-www-form-urlencoded"}
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{"application/vnd.firefly3+json", "application/json"}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if localVarOptionals != nil && localVarOptionals.XTraceId.IsSet() {
localVarHeaderParams["X-Trace-Id"] = parameterToString(localVarOptionals.XTraceId.Value(), "")
}
// body params
localVarPostBody = &body
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarReturnValue, localVarHttpResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body)
localVarHttpResponse.Body.Close()
if err != nil {
return localVarReturnValue, localVarHttpResponse, err
}
if localVarHttpResponse.StatusCode < 300 {
// If we succeed, return the data, otherwise pass on to decode error.
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err == nil {
return localVarReturnValue, localVarHttpResponse, err
}
}
if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{
body: localVarBody,
error: localVarHttpResponse.Status,
}
if localVarHttpResponse.StatusCode == 200 {
var v UserSingle
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 422 {
var v ValidationErrorResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 401 {
var v UnauthenticatedResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 404 {
var v NotFoundResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 400 {
var v BadRequestResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
if localVarHttpResponse.StatusCode == 500 {
var v InternalExceptionResponse
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, newErr
}
return localVarReturnValue, localVarHttpResponse, nil
}

1678
firefly3/api_webhooks.go Normal file

File diff suppressed because it is too large Load Diff

549
firefly3/client.go Normal file

@ -0,0 +1,549 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"bytes"
"context"
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"io"
"mime/multipart"
"net/http"
"net/url"
"os"
"path/filepath"
"reflect"
"regexp"
"strconv"
"strings"
"time"
"unicode/utf8"
"golang.org/x/oauth2"
)
var (
jsonCheck = regexp.MustCompile("(?i:[application|text]/json)")
xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)")
)
// APIClient manages communication with the Firefly III API v2.0.12 API v2.0.12
// In most cases there should be only one, shared, APIClient.
type APIClient struct {
cfg *Configuration
common service // Reuse a single struct instead of allocating one for each service on the heap.
// API Services
AboutApi *AboutApiService
AccountsApi *AccountsApiService
AttachmentsApi *AttachmentsApiService
AutocompleteApi *AutocompleteApiService
AvailableBudgetsApi *AvailableBudgetsApiService
BillsApi *BillsApiService
BudgetsApi *BudgetsApiService
CategoriesApi *CategoriesApiService
ChartsApi *ChartsApiService
ConfigurationApi *ConfigurationApiService
CurrenciesApi *CurrenciesApiService
DataApi *DataApiService
InsightApi *InsightApiService
LinksApi *LinksApiService
ObjectGroupsApi *ObjectGroupsApiService
PiggyBanksApi *PiggyBanksApiService
PreferencesApi *PreferencesApiService
RecurrencesApi *RecurrencesApiService
RuleGroupsApi *RuleGroupsApiService
RulesApi *RulesApiService
SearchApi *SearchApiService
SummaryApi *SummaryApiService
TagsApi *TagsApiService
TransactionsApi *TransactionsApiService
UsersApi *UsersApiService
WebhooksApi *WebhooksApiService
}
type service struct {
client *APIClient
}
// NewAPIClient creates a new API client. Requires a userAgent string describing your application.
// optionally a custom http.Client to allow for advanced features such as caching.
func NewAPIClient(cfg *Configuration) *APIClient {
if cfg.HTTPClient == nil {
cfg.HTTPClient = http.DefaultClient
}
c := &APIClient{}
c.cfg = cfg
c.common.client = c
// API Services
c.AboutApi = (*AboutApiService)(&c.common)
c.AccountsApi = (*AccountsApiService)(&c.common)
c.AttachmentsApi = (*AttachmentsApiService)(&c.common)
c.AutocompleteApi = (*AutocompleteApiService)(&c.common)
c.AvailableBudgetsApi = (*AvailableBudgetsApiService)(&c.common)
c.BillsApi = (*BillsApiService)(&c.common)
c.BudgetsApi = (*BudgetsApiService)(&c.common)
c.CategoriesApi = (*CategoriesApiService)(&c.common)
c.ChartsApi = (*ChartsApiService)(&c.common)
c.ConfigurationApi = (*ConfigurationApiService)(&c.common)
c.CurrenciesApi = (*CurrenciesApiService)(&c.common)
c.DataApi = (*DataApiService)(&c.common)
c.InsightApi = (*InsightApiService)(&c.common)
c.LinksApi = (*LinksApiService)(&c.common)
c.ObjectGroupsApi = (*ObjectGroupsApiService)(&c.common)
c.PiggyBanksApi = (*PiggyBanksApiService)(&c.common)
c.PreferencesApi = (*PreferencesApiService)(&c.common)
c.RecurrencesApi = (*RecurrencesApiService)(&c.common)
c.RuleGroupsApi = (*RuleGroupsApiService)(&c.common)
c.RulesApi = (*RulesApiService)(&c.common)
c.SearchApi = (*SearchApiService)(&c.common)
c.SummaryApi = (*SummaryApiService)(&c.common)
c.TagsApi = (*TagsApiService)(&c.common)
c.TransactionsApi = (*TransactionsApiService)(&c.common)
c.UsersApi = (*UsersApiService)(&c.common)
c.WebhooksApi = (*WebhooksApiService)(&c.common)
return c
}
func atoi(in string) (int, error) {
return strconv.Atoi(in)
}
// selectHeaderContentType select a content type from the available list.
func selectHeaderContentType(contentTypes []string) string {
if len(contentTypes) == 0 {
return ""
}
if contains(contentTypes, "application/json") {
return "application/json"
}
return contentTypes[0] // use the first content type specified in 'consumes'
}
// selectHeaderAccept join all accept types and return
func selectHeaderAccept(accepts []string) string {
if len(accepts) == 0 {
return ""
}
if contains(accepts, "application/json") {
return "application/json"
}
return strings.Join(accepts, ",")
}
// contains is a case insenstive match, finding needle in a haystack
func contains(haystack []string, needle string) bool {
for _, a := range haystack {
if strings.ToLower(a) == strings.ToLower(needle) {
return true
}
}
return false
}
// Verify optional parameters are of the correct type.
func typeCheckParameter(obj interface{}, expected string, name string) error {
// Make sure there is an object.
if obj == nil {
return nil
}
// Check the type is as expected.
if reflect.TypeOf(obj).String() != expected {
return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String())
}
return nil
}
// parameterToString convert interface{} parameters to string, using a delimiter if format is provided.
func parameterToString(obj interface{}, collectionFormat string) string {
var delimiter string
switch collectionFormat {
case "pipes":
delimiter = "|"
case "ssv":
delimiter = " "
case "tsv":
delimiter = "\t"
case "csv":
delimiter = ","
}
if reflect.TypeOf(obj).Kind() == reflect.Slice {
return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]")
}
return fmt.Sprintf("%v", obj)
}
// callAPI do the request.
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
return c.cfg.HTTPClient.Do(request)
}
// Change base path to allow switching to mocks
func (c *APIClient) ChangeBasePath(path string) {
c.cfg.BasePath = path
}
// prepareRequest build the request
func (c *APIClient) prepareRequest(
ctx context.Context,
path string, method string,
postBody interface{},
headerParams map[string]string,
queryParams url.Values,
formParams url.Values,
fileName string,
fileBytes []byte) (localVarRequest *http.Request, err error) {
var body *bytes.Buffer
// Detect postBody type and post.
if postBody != nil {
contentType := headerParams["Content-Type"]
if contentType == "" {
contentType = detectContentType(postBody)
headerParams["Content-Type"] = contentType
}
body, err = setBody(postBody, contentType)
if err != nil {
return nil, err
}
}
// add form parameters and file if available.
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") {
if body != nil {
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
}
body = &bytes.Buffer{}
w := multipart.NewWriter(body)
for k, v := range formParams {
for _, iv := range v {
if strings.HasPrefix(k, "@") { // file
err = addFile(w, k[1:], iv)
if err != nil {
return nil, err
}
} else { // form value
w.WriteField(k, iv)
}
}
}
if len(fileBytes) > 0 && fileName != "" {
w.Boundary()
//_, fileNm := filepath.Split(fileName)
part, err := w.CreateFormFile("file", filepath.Base(fileName))
if err != nil {
return nil, err
}
_, err = part.Write(fileBytes)
if err != nil {
return nil, err
}
// Set the Boundary in the Content-Type
headerParams["Content-Type"] = w.FormDataContentType()
}
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
w.Close()
}
if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 {
if body != nil {
return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.")
}
body = &bytes.Buffer{}
body.WriteString(formParams.Encode())
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
}
// Setup path and query parameters
url, err := url.Parse(path)
if err != nil {
return nil, err
}
// Adding Query Param
query := url.Query()
for k, v := range queryParams {
for _, iv := range v {
query.Add(k, iv)
}
}
// Encode the parameters.
url.RawQuery = query.Encode()
// Generate a new request
if body != nil {
localVarRequest, err = http.NewRequest(method, url.String(), body)
} else {
localVarRequest, err = http.NewRequest(method, url.String(), nil)
}
if err != nil {
return nil, err
}
// add header parameters, if any
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers.Set(h, v)
}
localVarRequest.Header = headers
}
// Override request host, if applicable
if c.cfg.Host != "" {
localVarRequest.Host = c.cfg.Host
}
// Add the user agent to the request.
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
if ctx != nil {
// add context to the request
localVarRequest = localVarRequest.WithContext(ctx)
// Walk through any authentication.
// OAuth2 authentication
if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok {
// We were able to grab an oauth2 token from the context
var latestToken *oauth2.Token
if latestToken, err = tok.Token(); err != nil {
return nil, err
}
latestToken.SetAuthHeader(localVarRequest)
}
// Basic HTTP Authentication
if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok {
localVarRequest.SetBasicAuth(auth.UserName, auth.Password)
}
// AccessToken Authentication
if auth, ok := ctx.Value(ContextAccessToken).(string); ok {
localVarRequest.Header.Add("Authorization", "Bearer "+auth)
}
}
for header, value := range c.cfg.DefaultHeader {
localVarRequest.Header.Add(header, value)
}
return localVarRequest, nil
}
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
if strings.Contains(contentType, "application/xml") {
if err = xml.Unmarshal(b, v); err != nil {
return err
}
return nil
} else if strings.Contains(contentType, "application/json") || strings.Contains(contentType, "application/vnd.api+json") {
if err = json.Unmarshal(b, v); err != nil {
return err
}
return nil
}
return errors.New("undefined response type")
}
// Add a file to the multipart request
func addFile(w *multipart.Writer, fieldName, path string) error {
file, err := os.Open(path)
if err != nil {
return err
}
defer file.Close()
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
if err != nil {
return err
}
_, err = io.Copy(part, file)
return err
}
// Prevent trying to import "fmt"
func reportError(format string, a ...interface{}) error {
return fmt.Errorf(format, a...)
}
// Set request body from an interface{}
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
if bodyBuf == nil {
bodyBuf = &bytes.Buffer{}
}
if reader, ok := body.(io.Reader); ok {
_, err = bodyBuf.ReadFrom(reader)
} else if b, ok := body.([]byte); ok {
_, err = bodyBuf.Write(b)
} else if s, ok := body.(string); ok {
_, err = bodyBuf.WriteString(s)
} else if s, ok := body.(*string); ok {
_, err = bodyBuf.WriteString(*s)
} else if jsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if xmlCheck.MatchString(contentType) {
xml.NewEncoder(bodyBuf).Encode(body)
}
if err != nil {
return nil, err
}
if bodyBuf.Len() == 0 {
err = fmt.Errorf("Invalid body type %s\n", contentType)
return nil, err
}
return bodyBuf, nil
}
// detectContentType method is used to figure out `Request.Body` content type for request header
func detectContentType(body interface{}) string {
contentType := "text/plain; charset=utf-8"
kind := reflect.TypeOf(body).Kind()
switch kind {
case reflect.Struct, reflect.Map, reflect.Ptr:
contentType = "application/json; charset=utf-8"
case reflect.String:
contentType = "text/plain; charset=utf-8"
default:
if b, ok := body.([]byte); ok {
contentType = http.DetectContentType(b)
} else if kind == reflect.Slice {
contentType = "application/json; charset=utf-8"
}
}
return contentType
}
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
type cacheControl map[string]string
func parseCacheControl(headers http.Header) cacheControl {
cc := cacheControl{}
ccHeader := headers.Get("Cache-Control")
for _, part := range strings.Split(ccHeader, ",") {
part = strings.Trim(part, " ")
if part == "" {
continue
}
if strings.ContainsRune(part, '=') {
keyval := strings.Split(part, "=")
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
} else {
cc[part] = ""
}
}
return cc
}
// CacheExpires helper function to determine remaining time before repeating a request.
func CacheExpires(r *http.Response) time.Time {
// Figure out when the cache expires.
var expires time.Time
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
if err != nil {
return time.Now()
}
respCacheControl := parseCacheControl(r.Header)
if maxAge, ok := respCacheControl["max-age"]; ok {
lifetime, err := time.ParseDuration(maxAge + "s")
if err != nil {
expires = now
}
expires = now.Add(lifetime)
} else {
expiresHeader := r.Header.Get("Expires")
if expiresHeader != "" {
expires, err = time.Parse(time.RFC1123, expiresHeader)
if err != nil {
expires = now
}
}
}
return expires
}
func strlen(s string) int {
return utf8.RuneCountInString(s)
}
// GenericSwaggerError Provides access to the body, error and model on returned errors.
type GenericSwaggerError struct {
body []byte
error string
model interface{}
}
// Error returns non-empty string if there was an error.
func (e GenericSwaggerError) Error() string {
return e.error
}
// Body returns the raw bytes of the response
func (e GenericSwaggerError) Body() []byte {
return e.body
}
// Model returns the unpacked model of the error
func (e GenericSwaggerError) Model() interface{} {
return e.model
}

72
firefly3/configuration.go Normal file

@ -0,0 +1,72 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"net/http"
)
// contextKeys are used to identify the type of value in the context.
// Since these are string, it is possible to get a short description of the
// context key for logging and debugging using key.String().
type contextKey string
func (c contextKey) String() string {
return "auth " + string(c)
}
var (
// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
ContextOAuth2 = contextKey("token")
// ContextBasicAuth takes BasicAuth as authentication for the request.
ContextBasicAuth = contextKey("basic")
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAccessToken = contextKey("accesstoken")
// ContextAPIKey takes an APIKey as authentication for the request
ContextAPIKey = contextKey("apikey")
)
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type BasicAuth struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
}
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIKey struct {
Key string
Prefix string
}
type Configuration struct {
BasePath string `json:"basePath,omitempty"`
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
HTTPClient *http.Client
}
func NewConfiguration() *Configuration {
cfg := &Configuration{
BasePath: "https://demo.firefly-iii.org/firefly3",
DefaultHeader: make(map[string]string),
UserAgent: "Swagger-Codegen/1.0.0/go",
}
return cfg
}
func (c *Configuration) AddDefaultHeader(key string, value string) {
c.DefaultHeader[key] = value
}

52
firefly3/git_push.sh Normal file

@ -0,0 +1,52 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

62
firefly3/model_account.go Normal file

@ -0,0 +1,62 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"time"
)
type Account struct {
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
// If omitted, defaults to true.
Active bool `json:"active,omitempty"`
// Order of the account. Is NULL if account is not asset or liability.
Order int32 `json:"order,omitempty"`
Name string `json:"name"`
Type_ *ShortAccountTypeProperty `json:"type"`
AccountRole *AccountRoleProperty `json:"account_role,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
CurrencyId string `json:"currency_id,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
CurrencyCode string `json:"currency_code,omitempty"`
CurrencySymbol string `json:"currency_symbol,omitempty"`
CurrencyDecimalPlaces int32 `json:"currency_decimal_places,omitempty"`
CurrentBalance string `json:"current_balance,omitempty"`
// The timestamp for this date is always 23:59:59, to indicate it's the balance at the very END of that particular day.
CurrentBalanceDate time.Time `json:"current_balance_date,omitempty"`
Iban string `json:"iban,omitempty"`
Bic string `json:"bic,omitempty"`
AccountNumber string `json:"account_number,omitempty"`
// Represents the opening balance, the initial amount this account holds.
OpeningBalance string `json:"opening_balance,omitempty"`
// Represents the current debt for liabilities.
CurrentDebt string `json:"current_debt,omitempty"`
// Represents the date of the opening balance.
OpeningBalanceDate time.Time `json:"opening_balance_date,omitempty"`
VirtualBalance string `json:"virtual_balance,omitempty"`
// If omitted, defaults to true.
IncludeNetWorth bool `json:"include_net_worth,omitempty"`
CreditCardType *CreditCardTypeProperty `json:"credit_card_type,omitempty"`
// Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank.
MonthlyPaymentDate time.Time `json:"monthly_payment_date,omitempty"`
LiabilityType *LiabilityTypeProperty `json:"liability_type,omitempty"`
LiabilityDirection *LiabilityDirectionProperty `json:"liability_direction,omitempty"`
// Mandatory when type is liability. Interest percentage.
Interest string `json:"interest,omitempty"`
InterestPeriod *InterestPeriodProperty `json:"interest_period,omitempty"`
Notes string `json:"notes,omitempty"`
// Latitude of the accounts's location, if applicable. Can be used to draw a map.
Latitude float64 `json:"latitude,omitempty"`
// Latitude of the accounts's location, if applicable. Can be used to draw a map.
Longitude float64 `json:"longitude,omitempty"`
// Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels.
ZoomLevel int32 `json:"zoom_level,omitempty"`
}

@ -0,0 +1,15 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AccountArray struct {
Data []AccountRead `json:"data"`
Meta *Meta `json:"meta"`
}

@ -0,0 +1,17 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AccountRead struct {
// Immutable value
Type_ string `json:"type"`
Id string `json:"id"`
Attributes *Account `json:"attributes"`
}

@ -0,0 +1,23 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
// AccountRoleProperty : Is only mandatory when the type is asset.
type AccountRoleProperty string
// List of AccountRoleProperty
const (
DEFAULT_ASSET_AccountRoleProperty AccountRoleProperty = "defaultAsset"
SHARED_ASSET_AccountRoleProperty AccountRoleProperty = "sharedAsset"
SAVING_ASSET_AccountRoleProperty AccountRoleProperty = "savingAsset"
CC_ASSET_AccountRoleProperty AccountRoleProperty = "ccAsset"
CASH_WALLET_ASSET_AccountRoleProperty AccountRoleProperty = "cashWalletAsset"
NULL_AccountRoleProperty AccountRoleProperty = ""
)

@ -0,0 +1,21 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AccountSearchFieldFilter string
// List of AccountSearchFieldFilter
const (
ALL_AccountSearchFieldFilter AccountSearchFieldFilter = "all"
IBAN_AccountSearchFieldFilter AccountSearchFieldFilter = "iban"
NAME_AccountSearchFieldFilter AccountSearchFieldFilter = "name"
NUMBER_AccountSearchFieldFilter AccountSearchFieldFilter = "number"
ID_AccountSearchFieldFilter AccountSearchFieldFilter = "id"
)

@ -0,0 +1,14 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AccountSingle struct {
Data *AccountRead `json:"data"`
}

@ -0,0 +1,53 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"time"
)
type AccountStore struct {
Name string `json:"name"`
Type_ *ShortAccountTypeProperty `json:"type"`
Iban string `json:"iban,omitempty"`
Bic string `json:"bic,omitempty"`
AccountNumber string `json:"account_number,omitempty"`
// Represents the opening balance, the initial amount this account holds.
OpeningBalance string `json:"opening_balance,omitempty"`
// Represents the date of the opening balance.
OpeningBalanceDate time.Time `json:"opening_balance_date,omitempty"`
VirtualBalance string `json:"virtual_balance,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
CurrencyId string `json:"currency_id,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
CurrencyCode string `json:"currency_code,omitempty"`
// If omitted, defaults to true.
Active bool `json:"active,omitempty"`
// Order of the account
Order int32 `json:"order,omitempty"`
// If omitted, defaults to true.
IncludeNetWorth bool `json:"include_net_worth,omitempty"`
AccountRole *AccountRoleProperty `json:"account_role,omitempty"`
CreditCardType *CreditCardTypeProperty `json:"credit_card_type,omitempty"`
// Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank.
MonthlyPaymentDate time.Time `json:"monthly_payment_date,omitempty"`
LiabilityType *LiabilityTypeProperty `json:"liability_type,omitempty"`
LiabilityDirection *LiabilityDirectionProperty `json:"liability_direction,omitempty"`
// Mandatory when type is liability. Interest percentage.
Interest string `json:"interest,omitempty"`
InterestPeriod *InterestPeriodProperty `json:"interest_period,omitempty"`
Notes string `json:"notes,omitempty"`
// Latitude of the accounts's location, if applicable. Can be used to draw a map.
Latitude float64 `json:"latitude,omitempty"`
// Latitude of the accounts's location, if applicable. Can be used to draw a map.
Longitude float64 `json:"longitude,omitempty"`
// Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels.
ZoomLevel int32 `json:"zoom_level,omitempty"`
}

@ -0,0 +1,37 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AccountTypeFilter string
// List of AccountTypeFilter
const (
ALL_AccountTypeFilter AccountTypeFilter = "all"
ASSET_AccountTypeFilter AccountTypeFilter = "asset"
CASH_AccountTypeFilter AccountTypeFilter = "cash"
EXPENSE_AccountTypeFilter AccountTypeFilter = "expense"
REVENUE_AccountTypeFilter AccountTypeFilter = "revenue"
SPECIAL_AccountTypeFilter AccountTypeFilter = "special"
HIDDEN_AccountTypeFilter AccountTypeFilter = "hidden"
LIABILITY_AccountTypeFilter AccountTypeFilter = "liability"
LIABILITIES_AccountTypeFilter AccountTypeFilter = "liabilities"
DEFAULT_ACCOUNT_AccountTypeFilter AccountTypeFilter = "Default account"
CASH_ACCOUNT_AccountTypeFilter AccountTypeFilter = "Cash account"
ASSET_ACCOUNT_AccountTypeFilter AccountTypeFilter = "Asset account"
EXPENSE_ACCOUNT_AccountTypeFilter AccountTypeFilter = "Expense account"
REVENUE_ACCOUNT_AccountTypeFilter AccountTypeFilter = "Revenue account"
INITIAL_BALANCE_ACCOUNT_AccountTypeFilter AccountTypeFilter = "Initial balance account"
BENEFICIARY_ACCOUNT_AccountTypeFilter AccountTypeFilter = "Beneficiary account"
IMPORT_ACCOUNT_AccountTypeFilter AccountTypeFilter = "Import account"
RECONCILIATION_ACCOUNT_AccountTypeFilter AccountTypeFilter = "Reconciliation account"
LOAN_AccountTypeFilter AccountTypeFilter = "Loan"
DEBT_AccountTypeFilter AccountTypeFilter = "Debt"
MORTGAGE_AccountTypeFilter AccountTypeFilter = "Mortgage"
)

@ -0,0 +1,28 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AccountTypeProperty string
// List of AccountTypeProperty
const (
DEFAULT_ACCOUNT_AccountTypeProperty AccountTypeProperty = "Default account"
CASH_ACCOUNT_AccountTypeProperty AccountTypeProperty = "Cash account"
ASSET_ACCOUNT_AccountTypeProperty AccountTypeProperty = "Asset account"
EXPENSE_ACCOUNT_AccountTypeProperty AccountTypeProperty = "Expense account"
REVENUE_ACCOUNT_AccountTypeProperty AccountTypeProperty = "Revenue account"
INITIAL_BALANCE_ACCOUNT_AccountTypeProperty AccountTypeProperty = "Initial balance account"
BENEFICIARY_ACCOUNT_AccountTypeProperty AccountTypeProperty = "Beneficiary account"
IMPORT_ACCOUNT_AccountTypeProperty AccountTypeProperty = "Import account"
RECONCILIATION_ACCOUNT_AccountTypeProperty AccountTypeProperty = "Reconciliation account"
LOAN_AccountTypeProperty AccountTypeProperty = "Loan"
DEBT_AccountTypeProperty AccountTypeProperty = "Debt"
MORTGAGE_AccountTypeProperty AccountTypeProperty = "Mortgage"
)

@ -0,0 +1,49 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"time"
)
type AccountUpdate struct {
Name string `json:"name"`
Iban string `json:"iban,omitempty"`
Bic string `json:"bic,omitempty"`
AccountNumber string `json:"account_number,omitempty"`
OpeningBalance string `json:"opening_balance,omitempty"`
OpeningBalanceDate time.Time `json:"opening_balance_date,omitempty"`
VirtualBalance string `json:"virtual_balance,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
CurrencyId string `json:"currency_id,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
CurrencyCode string `json:"currency_code,omitempty"`
// If omitted, defaults to true.
Active bool `json:"active,omitempty"`
// Order of the account
Order int32 `json:"order,omitempty"`
// If omitted, defaults to true.
IncludeNetWorth bool `json:"include_net_worth,omitempty"`
AccountRole *AccountRoleProperty `json:"account_role,omitempty"`
CreditCardType *CreditCardTypeProperty `json:"credit_card_type,omitempty"`
// Mandatory when the account_role is ccAsset. Moment at which CC payment installments are asked for by the bank.
MonthlyPaymentDate time.Time `json:"monthly_payment_date,omitempty"`
LiabilityType *LiabilityTypeProperty `json:"liability_type,omitempty"`
// Mandatory when type is liability. Interest percentage.
Interest string `json:"interest,omitempty"`
InterestPeriod *InterestPeriodProperty `json:"interest_period,omitempty"`
Notes string `json:"notes,omitempty"`
// Latitude of the account's location, if applicable. Can be used to draw a map. If omitted, the existing location will be kept. If submitted as NULL, the current location will be removed.
Latitude float64 `json:"latitude,omitempty"`
// Latitude of the account's location, if applicable. Can be used to draw a map. If omitted, the existing location will be kept. If submitted as NULL, the current location will be removed.
Longitude float64 `json:"longitude,omitempty"`
// Zoom level for the map, if drawn. This to set the box right. Unfortunately this is a proprietary value because each map provider has different zoom levels. If omitted, the existing location will be kept. If submitted as NULL, the current location will be removed.
ZoomLevel int32 `json:"zoom_level,omitempty"`
}

@ -0,0 +1,23 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
// AttachableType : The object class to which the attachment must be linked.
type AttachableType string
// List of AttachableType
const (
ACCOUNT_AttachableType AttachableType = "Account"
BUDGET_AttachableType AttachableType = "Budget"
BILL_AttachableType AttachableType = "Bill"
TRANSACTION_JOURNAL_AttachableType AttachableType = "TransactionJournal"
PIGGY_BANK_AttachableType AttachableType = "PiggyBank"
TAG_AttachableType AttachableType = "Tag"
)

@ -0,0 +1,31 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"time"
)
type Attachment struct {
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
AttachableType *AttachableType `json:"attachable_type"`
// ID of the model this attachment is linked to.
AttachableId string `json:"attachable_id"`
// MD5 hash of the file for basic duplicate detection.
Md5 string `json:"md5,omitempty"`
Filename string `json:"filename"`
DownloadUrl string `json:"download_url,omitempty"`
UploadUrl string `json:"upload_url,omitempty"`
Title string `json:"title,omitempty"`
Notes string `json:"notes,omitempty"`
Mime string `json:"mime,omitempty"`
Size int32 `json:"size,omitempty"`
}

@ -0,0 +1,15 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AttachmentArray struct {
Data []AttachmentRead `json:"data"`
Meta *Meta `json:"meta"`
}

@ -0,0 +1,18 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AttachmentRead struct {
// Immutable value
Type_ string `json:"type"`
Id string `json:"id"`
Attributes *Attachment `json:"attributes"`
Links *ObjectLink `json:"links"`
}

@ -0,0 +1,14 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AttachmentSingle struct {
Data *AttachmentRead `json:"data"`
}

@ -0,0 +1,19 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AttachmentStore struct {
Filename string `json:"filename"`
AttachableType *AttachableType `json:"attachable_type"`
// ID of the model this attachment is linked to.
AttachableId string `json:"attachable_id"`
Title string `json:"title,omitempty"`
Notes string `json:"notes,omitempty"`
}

@ -0,0 +1,16 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AttachmentUpdate struct {
Filename string `json:"filename,omitempty"`
Title string `json:"title,omitempty"`
Notes string `json:"notes,omitempty"`
}

@ -0,0 +1,24 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
// AutoBudgetPeriod : Period for the auto budget
type AutoBudgetPeriod string
// List of AutoBudgetPeriod
const (
DAILY_AutoBudgetPeriod AutoBudgetPeriod = "daily"
WEEKLY_AutoBudgetPeriod AutoBudgetPeriod = "weekly"
MONTHLY_AutoBudgetPeriod AutoBudgetPeriod = "monthly"
QUARTERLY_AutoBudgetPeriod AutoBudgetPeriod = "quarterly"
HALF_YEAR_AutoBudgetPeriod AutoBudgetPeriod = "half-year"
YEARLY_AutoBudgetPeriod AutoBudgetPeriod = "yearly"
NULL_AutoBudgetPeriod AutoBudgetPeriod = ""
)

@ -0,0 +1,21 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
// AutoBudgetType : The type of auto-budget that Firefly III must create.
type AutoBudgetType string
// List of AutoBudgetType
const (
RESET_AutoBudgetType AutoBudgetType = "reset"
ROLLOVER_AutoBudgetType AutoBudgetType = "rollover"
NONE_AutoBudgetType AutoBudgetType = "none"
NULL_AutoBudgetType AutoBudgetType = ""
)

@ -0,0 +1,30 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteAccount struct {
Id string `json:"id"`
// Name of the account found by an auto-complete search.
Name string `json:"name"`
// Asset accounts and liabilities have a second field with the given date's account balance.
NameWithBalance string `json:"name_with_balance"`
// Account type of the account found by the auto-complete search.
Type_ string `json:"type"`
// ID for the currency used by this account.
CurrencyId string `json:"currency_id"`
// Currency name for the currency used by this account.
CurrencyName string `json:"currency_name"`
// Currency code for the currency used by this account.
CurrencyCode string `json:"currency_code"`
// Currency symbol for the currency used by this account.
CurrencySymbol string `json:"currency_symbol"`
// Number of decimal places for the currency used by this account.
CurrencyDecimalPlaces int32 `json:"currency_decimal_places"`
}

@ -0,0 +1,18 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteBill struct {
Id string `json:"id"`
// Name of the bill found by an auto-complete search.
Name string `json:"name"`
// Is the bill active or not?
Active bool `json:"active,omitempty"`
}

@ -0,0 +1,16 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteBudget struct {
Id string `json:"id"`
// Name of the budget found by an auto-complete search.
Name string `json:"name"`
}

@ -0,0 +1,16 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteCategory struct {
Id string `json:"id"`
// Name of the category found by an auto-complete search.
Name string `json:"name"`
}

@ -0,0 +1,20 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteCurrency struct {
Id string `json:"id"`
// Currency name.
Name string `json:"name"`
// Currency code.
Code string `json:"code"`
Symbol string `json:"symbol"`
DecimalPlaces int32 `json:"decimal_places"`
}

@ -0,0 +1,20 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteCurrencyCode struct {
Id string `json:"id"`
// Currency name with the code between brackets.
Name string `json:"name"`
// Currency code.
Code string `json:"code"`
Symbol string `json:"symbol"`
DecimalPlaces int32 `json:"decimal_places"`
}

@ -0,0 +1,18 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteObjectGroup struct {
Id string `json:"id"`
// Title of the object group found by an auto-complete search.
Title string `json:"title"`
// Title of the object group found by an auto-complete search.
Name string `json:"name"`
}

@ -0,0 +1,28 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompletePiggy struct {
Id string `json:"id"`
// Name of the piggy bank found by an auto-complete search.
Name string `json:"name"`
// Currency ID for this piggy bank.
CurrencyId string `json:"currency_id,omitempty"`
// Currency code for this piggy bank.
CurrencyCode string `json:"currency_code,omitempty"`
CurrencySymbol string `json:"currency_symbol,omitempty"`
// Currency name for the currency used by this account.
CurrencyName string `json:"currency_name,omitempty"`
CurrencyDecimalPlaces int32 `json:"currency_decimal_places,omitempty"`
// The group ID of the group this object is part of. NULL if no group.
ObjectGroupId string `json:"object_group_id,omitempty"`
// The name of the group. NULL if no group.
ObjectGroupTitle string `json:"object_group_title,omitempty"`
}

@ -0,0 +1,28 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompletePiggyBalance struct {
Id string `json:"id"`
// Name of the piggy bank found by an auto-complete search.
Name string `json:"name"`
// Name of the piggy bank found by an auto-complete search with the current balance formatted nicely.
NameWithBalance string `json:"name_with_balance,omitempty"`
// Currency ID for this piggy bank.
CurrencyId string `json:"currency_id,omitempty"`
// Currency code for this piggy bank.
CurrencyCode string `json:"currency_code,omitempty"`
CurrencySymbol string `json:"currency_symbol,omitempty"`
CurrencyDecimalPlaces int32 `json:"currency_decimal_places,omitempty"`
// The group ID of the group this object is part of. NULL if no group.
ObjectGroupId string `json:"object_group_id,omitempty"`
// The name of the group. NULL if no group.
ObjectGroupTitle string `json:"object_group_title,omitempty"`
}

@ -0,0 +1,18 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteRecurrence struct {
Id string `json:"id"`
// Name of the recurrence found by an auto-complete search.
Name string `json:"name"`
// Description of the recurrence found by auto-complete.
Description string `json:"description,omitempty"`
}

@ -0,0 +1,18 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteRule struct {
Id string `json:"id"`
// Name of the rule found by an auto-complete search.
Name string `json:"name"`
// Description of the rule found by auto-complete.
Description string `json:"description,omitempty"`
}

@ -0,0 +1,18 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteRuleGroup struct {
Id string `json:"id"`
// Name of the rule group found by an auto-complete search.
Name string `json:"name"`
// Description of the rule group found by auto-complete.
Description string `json:"description,omitempty"`
}

@ -0,0 +1,18 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteTag struct {
Id string `json:"id"`
// Name of the tag found by an auto-complete search.
Name string `json:"name"`
// Name of the tag found by an auto-complete search.
Tag string `json:"tag"`
}

@ -0,0 +1,21 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteTransaction struct {
// The ID of a transaction journal (basically a single split).
Id string `json:"id"`
// The ID of the underlying transaction group.
TransactionGroupId string `json:"transaction_group_id,omitempty"`
// Transaction description
Name string `json:"name"`
// Transaction description
Description string `json:"description"`
}

@ -0,0 +1,21 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteTransactionId struct {
// The ID of a transaction journal (basically a single split).
Id string `json:"id"`
// The ID of the underlying transaction group.
TransactionGroupId string `json:"transaction_group_id,omitempty"`
// Transaction description with ID in the name.
Name string `json:"name"`
// Transaction description with ID in the name.
Description string `json:"description"`
}

@ -0,0 +1,18 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AutocompleteTransactionType struct {
Id string `json:"id"`
// Type of the object found by an auto-complete search.
Name string `json:"name"`
// Name of the object found by an auto-complete search.
Type_ string `json:"type"`
}

@ -0,0 +1,32 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"time"
)
type AvailableBudget struct {
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Use either currency_id or currency_code.
CurrencyId string `json:"currency_id,omitempty"`
// Use either currency_id or currency_code.
CurrencyCode string `json:"currency_code,omitempty"`
CurrencySymbol string `json:"currency_symbol,omitempty"`
CurrencyDecimalPlaces int32 `json:"currency_decimal_places,omitempty"`
Amount string `json:"amount"`
// Start date of the available budget.
Start time.Time `json:"start"`
// End date of the available budget.
End time.Time `json:"end"`
SpentInBudgets []BudgetSpent `json:"spent_in_budgets,omitempty"`
SpentOutsideBudget []BudgetSpent `json:"spent_outside_budget,omitempty"`
}

@ -0,0 +1,15 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AvailableBudgetArray struct {
Data []AvailableBudgetRead `json:"data"`
Meta *Meta `json:"meta"`
}

@ -0,0 +1,17 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AvailableBudgetRead struct {
// Immutable value
Type_ string `json:"type"`
Id string `json:"id"`
Attributes *AvailableBudget `json:"attributes"`
}

@ -0,0 +1,14 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type AvailableBudgetSingle struct {
Data *AvailableBudgetRead `json:"data"`
}

@ -0,0 +1,15 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BadRequestResponse struct {
Message string `json:"message,omitempty"`
Exception string `json:"exception,omitempty"`
}

@ -0,0 +1,31 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BasicSummaryEntry struct {
// This is a reference to the type of info shared, not influenced by translations or user preferences. The EUR value is a reference to the currency code. Possibilities are: balance-in-ABC, spent-in-ABC, earned-in-ABC, bills-paid-in-ABC, bills-unpaid-in-ABC, left-to-spend-in-ABC and net-worth-in-ABC.
Key string `json:"key,omitempty"`
// A translated title for the information shared.
Title string `json:"title,omitempty"`
// The amount as a float.
MonetaryValue float64 `json:"monetary_value,omitempty"`
// The currency ID of the associated currency.
CurrencyId string `json:"currency_id,omitempty"`
CurrencyCode string `json:"currency_code,omitempty"`
CurrencySymbol string `json:"currency_symbol,omitempty"`
// Number of decimals for the associated currency.
CurrencyDecimalPlaces int32 `json:"currency_decimal_places,omitempty"`
// The amount formatted according to the users locale
ValueParsed string `json:"value_parsed,omitempty"`
// Reference to a font-awesome icon without the fa- part.
LocalIcon string `json:"local_icon,omitempty"`
// A short explanation of the amounts origin. Already formatted according to the locale of the user or translated, if relevant.
SubTitle string `json:"sub_title,omitempty"`
}

55
firefly3/model_bill.go Normal file

@ -0,0 +1,55 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"time"
)
type Bill struct {
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Use either currency_id or currency_code
CurrencyId string `json:"currency_id,omitempty"`
// Use either currency_id or currency_code
CurrencyCode string `json:"currency_code,omitempty"`
CurrencySymbol string `json:"currency_symbol,omitempty"`
CurrencyDecimalPlaces int32 `json:"currency_decimal_places,omitempty"`
Name string `json:"name"`
AmountMin string `json:"amount_min"`
AmountMax string `json:"amount_max"`
Date time.Time `json:"date"`
// The date after which this bill is no longer valid or applicable
EndDate time.Time `json:"end_date,omitempty"`
// The date before which the bill must be renewed (or cancelled)
ExtensionDate time.Time `json:"extension_date,omitempty"`
RepeatFreq *BillRepeatFrequency `json:"repeat_freq"`
// How often the bill must be skipped. 1 means a bi-monthly bill.
Skip int32 `json:"skip,omitempty"`
// If the bill is active.
Active bool `json:"active,omitempty"`
// Order of the bill.
Order int32 `json:"order,omitempty"`
Notes string `json:"notes,omitempty"`
// When the bill is expected to be due.
NextExpectedMatch time.Time `json:"next_expected_match,omitempty"`
// Formatted (locally) when the bill is due.
NextExpectedMatchDiff string `json:"next_expected_match_diff,omitempty"`
// The group ID of the group this object is part of. NULL if no group.
ObjectGroupId string `json:"object_group_id,omitempty"`
// The order of the group. At least 1, for the highest sorting.
ObjectGroupOrder int32 `json:"object_group_order,omitempty"`
// The name of the group. NULL if no group.
ObjectGroupTitle string `json:"object_group_title,omitempty"`
// Array of future dates when the bill is expected to be paid. Autogenerated.
PayDates []time.Time `json:"pay_dates,omitempty"`
// Array of past transactions when the bill was paid.
PaidDates []BillPaidDates `json:"paid_dates,omitempty"`
}

@ -0,0 +1,15 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BillArray struct {
Data []BillRead `json:"data"`
Meta *Meta `json:"meta"`
}

@ -0,0 +1,23 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"time"
)
type BillPaidDates struct {
// Transaction group ID of the paid bill.
TransactionGroupId string `json:"transaction_group_id,omitempty"`
// Transaction journal ID of the paid bill.
TransactionJournalId string `json:"transaction_journal_id,omitempty"`
// Date the bill was paid.
Date time.Time `json:"date,omitempty"`
}

@ -0,0 +1,17 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BillRead struct {
// Immutable value
Type_ string `json:"type"`
Id string `json:"id"`
Attributes *Bill `json:"attributes"`
}

@ -0,0 +1,22 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
// BillRepeatFrequency : How often the bill must be paid.
type BillRepeatFrequency string
// List of BillRepeatFrequency
const (
WEEKLY_BillRepeatFrequency BillRepeatFrequency = "weekly"
MONTHLY_BillRepeatFrequency BillRepeatFrequency = "monthly"
QUARTERLY_BillRepeatFrequency BillRepeatFrequency = "quarterly"
HALF_YEAR_BillRepeatFrequency BillRepeatFrequency = "half-year"
YEARLY_BillRepeatFrequency BillRepeatFrequency = "yearly"
)

@ -0,0 +1,14 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BillSingle struct {
Data *BillRead `json:"data"`
}

@ -0,0 +1,39 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"time"
)
type BillStore struct {
// Use either currency_id or currency_code
CurrencyId string `json:"currency_id,omitempty"`
// Use either currency_id or currency_code
CurrencyCode string `json:"currency_code,omitempty"`
Name string `json:"name"`
AmountMin string `json:"amount_min"`
AmountMax string `json:"amount_max"`
Date time.Time `json:"date"`
// The date after which this bill is no longer valid or applicable
EndDate time.Time `json:"end_date,omitempty"`
// The date before which the bill must be renewed (or cancelled)
ExtensionDate time.Time `json:"extension_date,omitempty"`
RepeatFreq *BillRepeatFrequency `json:"repeat_freq"`
// How often the bill must be skipped. 1 means a bi-monthly bill.
Skip int32 `json:"skip,omitempty"`
// If the bill is active.
Active bool `json:"active,omitempty"`
Notes string `json:"notes,omitempty"`
// The group ID of the group this object is part of. NULL if no group.
ObjectGroupId string `json:"object_group_id,omitempty"`
// The name of the group. NULL if no group.
ObjectGroupTitle string `json:"object_group_title,omitempty"`
}

@ -0,0 +1,39 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"time"
)
type BillUpdate struct {
// Use either currency_id or currency_code
CurrencyId string `json:"currency_id,omitempty"`
// Use either currency_id or currency_code
CurrencyCode string `json:"currency_code,omitempty"`
Name string `json:"name"`
AmountMin string `json:"amount_min,omitempty"`
AmountMax string `json:"amount_max,omitempty"`
Date time.Time `json:"date,omitempty"`
// The date after which this bill is no longer valid or applicable
EndDate time.Time `json:"end_date,omitempty"`
// The date before which the bill must be renewed (or cancelled)
ExtensionDate time.Time `json:"extension_date,omitempty"`
RepeatFreq *BillRepeatFrequency `json:"repeat_freq,omitempty"`
// How often the bill must be skipped. 1 means a bi-monthly bill.
Skip int32 `json:"skip,omitempty"`
// If the bill is active.
Active bool `json:"active,omitempty"`
Notes string `json:"notes,omitempty"`
// The group ID of the group this object is part of. NULL if no group.
ObjectGroupId string `json:"object_group_id,omitempty"`
// The name of the group. NULL if no group.
ObjectGroupTitle string `json:"object_group_title,omitempty"`
}

32
firefly3/model_budget.go Normal file

@ -0,0 +1,32 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"time"
)
type Budget struct {
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Name string `json:"name"`
Active bool `json:"active,omitempty"`
Notes string `json:"notes,omitempty"`
Order int32 `json:"order,omitempty"`
AutoBudgetType *AutoBudgetType `json:"auto_budget_type,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
AutoBudgetCurrencyId string `json:"auto_budget_currency_id,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
AutoBudgetCurrencyCode string `json:"auto_budget_currency_code,omitempty"`
AutoBudgetAmount string `json:"auto_budget_amount,omitempty"`
AutoBudgetPeriod *AutoBudgetPeriod `json:"auto_budget_period,omitempty"`
// Information on how much was spent in this budget. Is only filled in when the start and end date are submitted.
Spent []BudgetSpent `json:"spent,omitempty"`
}

@ -0,0 +1,15 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BudgetArray struct {
Data []BudgetRead `json:"data"`
Meta *Meta `json:"meta"`
}

@ -0,0 +1,36 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"time"
)
type BudgetLimit struct {
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
// Start date of the budget limit.
Start time.Time `json:"start"`
// End date of the budget limit.
End time.Time `json:"end"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
CurrencyId string `json:"currency_id,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
CurrencyCode string `json:"currency_code,omitempty"`
CurrencyName string `json:"currency_name,omitempty"`
CurrencySymbol string `json:"currency_symbol,omitempty"`
CurrencyDecimalPlaces int32 `json:"currency_decimal_places,omitempty"`
// The budget ID of the associated budget.
BudgetId string `json:"budget_id"`
// Period of the budget limit. Only used when auto-generated by auto-budget.
Period string `json:"period,omitempty"`
Amount string `json:"amount"`
Spent string `json:"spent,omitempty"`
}

@ -0,0 +1,15 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BudgetLimitArray struct {
Data []BudgetLimitRead `json:"data"`
Meta *Meta `json:"meta"`
}

@ -0,0 +1,17 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BudgetLimitRead struct {
// Immutable value
Type_ string `json:"type"`
Id string `json:"id"`
Attributes *BudgetLimit `json:"attributes"`
}

@ -0,0 +1,14 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BudgetLimitSingle struct {
Data *BudgetLimitRead `json:"data"`
}

@ -0,0 +1,26 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BudgetLimitStore struct {
// Use either currency_id or currency_code. Defaults to the user's default currency.
CurrencyId string `json:"currency_id,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
CurrencyCode string `json:"currency_code,omitempty"`
// The budget ID of the associated budget.
BudgetId string `json:"budget_id"`
// Start date of the budget limit.
Start string `json:"start"`
// Period of the budget limit. Only used when auto-generated by auto-budget.
Period string `json:"period,omitempty"`
// End date of the budget limit.
End string `json:"end"`
Amount string `json:"amount"`
}

@ -0,0 +1,17 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BudgetRead struct {
// Immutable value
Type_ string `json:"type"`
Id string `json:"id"`
Attributes *Budget `json:"attributes"`
}

@ -0,0 +1,14 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BudgetSingle struct {
Data *BudgetRead `json:"data"`
}

@ -0,0 +1,20 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BudgetSpent struct {
// The amount spent.
Sum string `json:"sum,omitempty"`
CurrencyId string `json:"currency_id,omitempty"`
CurrencyCode string `json:"currency_code,omitempty"`
CurrencySymbol string `json:"currency_symbol,omitempty"`
// Number of decimals supported by the currency
CurrencyDecimalPlaces int32 `json:"currency_decimal_places,omitempty"`
}

@ -0,0 +1,24 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BudgetStore struct {
Name string `json:"name"`
Active bool `json:"active,omitempty"`
Order int32 `json:"order,omitempty"`
Notes string `json:"notes,omitempty"`
AutoBudgetType *AutoBudgetType `json:"auto_budget_type,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
AutoBudgetCurrencyId string `json:"auto_budget_currency_id,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
AutoBudgetCurrencyCode string `json:"auto_budget_currency_code,omitempty"`
AutoBudgetAmount string `json:"auto_budget_amount,omitempty"`
AutoBudgetPeriod *AutoBudgetPeriod `json:"auto_budget_period,omitempty"`
}

@ -0,0 +1,24 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type BudgetUpdate struct {
Name string `json:"name"`
Active bool `json:"active,omitempty"`
Order int32 `json:"order,omitempty"`
Notes string `json:"notes,omitempty"`
AutoBudgetType *AutoBudgetType `json:"auto_budget_type,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
AutoBudgetCurrencyId string `json:"auto_budget_currency_id,omitempty"`
// Use either currency_id or currency_code. Defaults to the user's default currency.
AutoBudgetCurrencyCode string `json:"auto_budget_currency_code,omitempty"`
AutoBudgetAmount string `json:"auto_budget_amount,omitempty"`
AutoBudgetPeriod *AutoBudgetPeriod `json:"auto_budget_period,omitempty"`
}

@ -0,0 +1,23 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
import (
"time"
)
type Category struct {
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
Name string `json:"name"`
Notes string `json:"notes,omitempty"`
Spent []CategorySpent `json:"spent,omitempty"`
Earned []CategoryEarned `json:"earned,omitempty"`
}

@ -0,0 +1,15 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type CategoryArray struct {
Data []CategoryRead `json:"data"`
Meta *Meta `json:"meta"`
}

@ -0,0 +1,20 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type CategoryEarned struct {
CurrencyId string `json:"currency_id,omitempty"`
CurrencyCode string `json:"currency_code,omitempty"`
CurrencySymbol string `json:"currency_symbol,omitempty"`
// Number of decimals supported by the currency
CurrencyDecimalPlaces int32 `json:"currency_decimal_places,omitempty"`
// The amount earned.
Sum string `json:"sum,omitempty"`
}

@ -0,0 +1,17 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type CategoryRead struct {
// Immutable value
Type_ string `json:"type"`
Id string `json:"id"`
Attributes *Category `json:"attributes"`
}

@ -0,0 +1,14 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type CategorySingle struct {
Data *CategoryRead `json:"data"`
}

@ -0,0 +1,20 @@
/*
* Firefly III API v2.0.12
*
* This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-03-16T05:34:43+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that.
*
* API version: 2.0.12
* Contact: james@firefly-iii.org
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package firefly3
type CategorySpent struct {
CurrencyId string `json:"currency_id,omitempty"`
CurrencyCode string `json:"currency_code,omitempty"`
CurrencySymbol string `json:"currency_symbol,omitempty"`
// Number of decimals supported by the currency
CurrencyDecimalPlaces int32 `json:"currency_decimal_places,omitempty"`
// The amount spent.
Sum string `json:"sum,omitempty"`
}

Some files were not shown because too many files have changed in this diff Show More