Categorygithub.com/satraul/gofirefly
repositorypackage
1.0.0
Repository: https://github.com/satraul/gofirefly.git
Documentation: pkg.go.dev

# README

Go API client for firefly

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 2021-09-25T14:21:28+00:00

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.5.4
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://firefly-iii.org

Installation

Install the package in your project:

go get github.com/satraul/gofirefly

Add the following import:

import (
	"github.com/satraul/gofirefly"
)

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identifield by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
AboutApiGetAboutGet /api/v1/aboutSystem information end point.
AboutApiGetCronGet /api/v1/cron/{cliToken}Cron job endpoint
AboutApiGetCurrentUserGet /api/v1/about/userCurrently authenticated user endpoint.
AccountsApiDeleteAccountDelete /api/v1/accounts/{id}Permanently delete account.
AccountsApiGetAccountGet /api/v1/accounts/{id}Get single account.
AccountsApiListAccountGet /api/v1/accountsList all accounts.
AccountsApiListAttachmentByAccountGet /api/v1/accounts/{id}/attachmentsLists all attachments.
AccountsApiListPiggyBankByAccountGet /api/v1/accounts/{id}/piggy_banksList all piggy banks related to the account.
AccountsApiListTransactionByAccountGet /api/v1/accounts/{id}/transactionsList all transactions related to the account.
AccountsApiStoreAccountPost /api/v1/accountsCreate new account.
AccountsApiUpdateAccountPut /api/v1/accounts/{id}Update existing account.
AttachmentsApiDeleteAttachmentDelete /api/v1/attachments/{id}Delete an attachment.
AttachmentsApiDownloadAttachmentGet /api/v1/attachments/{id}/downloadDownload a single attachment.
AttachmentsApiGetAttachmentGet /api/v1/attachments/{id}Get a single attachment.
AttachmentsApiListAttachmentGet /api/v1/attachmentsList all attachments.
AttachmentsApiStoreAttachmentPost /api/v1/attachmentsStore a new attachment.
AttachmentsApiUpdateAttachmentPut /api/v1/attachments/{id}Update existing attachment.
AttachmentsApiUploadAttachmentPost /api/v1/attachments/{id}/uploadUpload an attachment.
AutocompleteApiGetAccountsACGet /api/v1/autocomplete/accountsReturns all accounts of the user returned in a basic auto-complete array.
AutocompleteApiGetBillsACGet /api/v1/autocomplete/billsReturns all bills of the user returned in a basic auto-complete array.
AutocompleteApiGetBudgetsACGet /api/v1/autocomplete/budgetsReturns all budgets of the user returned in a basic auto-complete array.
AutocompleteApiGetCategoriesACGet /api/v1/autocomplete/categoriesReturns all categories of the user returned in a basic auto-complete array.
AutocompleteApiGetCurrenciesACGet /api/v1/autocomplete/currenciesReturns all currencies of the user returned in a basic auto-complete array.
AutocompleteApiGetCurrenciesCodeACGet /api/v1/autocomplete/currencies-with-codeReturns all currencies of the user returned in a basic auto-complete array. This endpoint is DEPRECATED and I suggest you DO NOT use it.
AutocompleteApiGetObjectGroupsACGet /api/v1/autocomplete/object-groupsReturns all object groups of the user returned in a basic auto-complete array.
AutocompleteApiGetPiggiesACGet /api/v1/autocomplete/piggy-banksReturns all piggy banks of the user returned in a basic auto-complete array.
AutocompleteApiGetPiggiesBalanceACGet /api/v1/autocomplete/piggy-banks-with-balanceReturns all piggy banks of the user returned in a basic auto-complete array complemented with balance information.
AutocompleteApiGetRecurringACGet /api/v1/autocomplete/recurringReturns all recurring transactions of the user returned in a basic auto-complete array.
AutocompleteApiGetRuleGroupsACGet /api/v1/autocomplete/rule-groupsReturns all rule groups of the user returned in a basic auto-complete array.
AutocompleteApiGetRulesACGet /api/v1/autocomplete/rulesReturns all rules of the user returned in a basic auto-complete array.
AutocompleteApiGetTagACGet /api/v1/autocomplete/tagsReturns all tags of the user returned in a basic auto-complete array.
AutocompleteApiGetTransactionTypesACGet /api/v1/autocomplete/transaction-typesReturns all transaction types returned in a basic auto-complete array. English only.
AutocompleteApiGetTransactionsACGet /api/v1/autocomplete/transactionsReturns all transaction descriptions of the user returned in a basic auto-complete array.
AutocompleteApiGetTransactionsIDACGet /api/v1/autocomplete/transactions-with-idReturns 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.
AvailableBudgetsApiDeleteAvailableBudgetDelete /api/v1/available_budgets/{id}Delete an available budget.
AvailableBudgetsApiGetAvailableBudgetGet /api/v1/available_budgets/{id}Get a single available budget.
AvailableBudgetsApiListAvailableBudgetGet /api/v1/available_budgetsList all available budget amounts.
AvailableBudgetsApiStoreAvailableBudgetPost /api/v1/available_budgetsStore a new available budget
AvailableBudgetsApiUpdateAvailableBudgetPut /api/v1/available_budgets/{id}Update existing available budget, to change for example the date range of the amount or the amount itself.
BillsApiDeleteBillDelete /api/v1/bills/{id}Delete a bill.
BillsApiGetBillGet /api/v1/bills/{id}Get a single bill.
BillsApiListAttachmentByBillGet /api/v1/bills/{id}/attachmentsList all attachments uploaded to the bill.
BillsApiListBillGet /api/v1/billsList all bills.
BillsApiListRuleByBillGet /api/v1/bills/{id}/rulesList all rules associated with the bill.
BillsApiListTransactionByBillGet /api/v1/bills/{id}/transactionsList all transactions associated with the bill.
BillsApiStoreBillPost /api/v1/billsStore a new bill
BillsApiUpdateBillPut /api/v1/bills/{id}Update existing bill.
BudgetsApiDeleteBudgetDelete /api/v1/budgets/{id}Delete a budget.
BudgetsApiDeleteBudgetLimitDelete /api/v1/budgets/{id}/limits/{limitId}Delete a budget limit.
BudgetsApiGetBudgetGet /api/v1/budgets/{id}Get a single budget.
BudgetsApiGetBudgetLimitGet /api/v1/budgets/{id}/limits/{limitId}Get single budget limit.
BudgetsApiListAttachmentByBudgetGet /api/v1/budgets/{id}/attachmentsLists all attachments of a budget.
BudgetsApiListBudgetGet /api/v1/budgetsList all budgets.
BudgetsApiListBudgetLimitGet /api/v1/budget-limitsGet list of budget limits by date
BudgetsApiListBudgetLimitByBudgetGet /api/v1/budgets/{id}/limitsGet all limits for a budget.
BudgetsApiListTransactionByBudgetGet /api/v1/budgets/{id}/transactionsAll transactions to a budget.
BudgetsApiListTransactionByBudgetLimitGet /api/v1/budgets/{id}/limits/{limitId}/transactionsList all transactions by a budget limit ID.
BudgetsApiStoreBudgetPost /api/v1/budgetsStore a new budget
BudgetsApiStoreBudgetLimitPost /api/v1/budgets/{id}/limitsStore new budget limit.
BudgetsApiUpdateBudgetPut /api/v1/budgets/{id}Update existing budget.
BudgetsApiUpdateBudgetLimitPut /api/v1/budgets/{id}/limits/{limitId}Update existing budget limit.
CategoriesApiDeleteCategoryDelete /api/v1/categories/{id}Delete a category.
CategoriesApiGetCategoryGet /api/v1/categories/{id}Get a single category.
CategoriesApiListAttachmentByCategoryGet /api/v1/categories/{id}/attachmentsLists all attachments.
CategoriesApiListCategoryGet /api/v1/categoriesList all categories.
CategoriesApiListTransactionByCategoryGet /api/v1/categories/{id}/transactionsList all transactions in a category.
CategoriesApiStoreCategoryPost /api/v1/categoriesStore a new category
CategoriesApiUpdateCategoryPut /api/v1/categories/{id}Update existing category.
ChartsApiGetChartAccountOverviewGet /api/v1/chart/account/overviewDashboard chart with asset account balance information.
ConfigurationApiGetConfigurationGet /api/v1/configurationGet Firefly III system configuration values.
ConfigurationApiGetSingleConfigurationGet /api/v1/configuration/{name}Get a single Firefly III system configuration value
ConfigurationApiSetConfigurationPut /api/v1/configuration/{name}Update configuration value
CurrenciesApiDefaultCurrencyPost /api/v1/currencies/{code}/defaultMake currency default currency.
CurrenciesApiDeleteCurrencyDelete /api/v1/currencies/{code}Delete a currency.
CurrenciesApiDisableCurrencyPost /api/v1/currencies/{code}/disableDisable a currency.
CurrenciesApiEnableCurrencyPost /api/v1/currencies/{code}/enableEnable a single currency.
CurrenciesApiGetCurrencyGet /api/v1/currencies/{code}Get a single currency.
CurrenciesApiGetDefaultCurrencyGet /api/v1/currencies/defaultGet the user's default currency.
CurrenciesApiListAccountByCurrencyGet /api/v1/currencies/{code}/accountsList all accounts with this currency.
CurrenciesApiListAvailableBudgetByCurrencyGet /api/v1/currencies/{code}/available_budgetsList all available budgets with this currency.
CurrenciesApiListBillByCurrencyGet /api/v1/currencies/{code}/billsList all bills with this currency.
CurrenciesApiListBudgetLimitByCurrencyGet /api/v1/currencies/{code}/budget_limitsList all budget limits with this currency
CurrenciesApiListCurrencyGet /api/v1/currenciesList all currencies.
CurrenciesApiListRecurrenceByCurrencyGet /api/v1/currencies/{code}/recurrencesList all recurring transactions with this currency.
CurrenciesApiListRuleByCurrencyGet /api/v1/currencies/{code}/rulesList all rules with this currency.
CurrenciesApiListTransactionByCurrencyGet /api/v1/currencies/{code}/transactionsList all transactions with this currency.
CurrenciesApiStoreCurrencyPost /api/v1/currenciesStore a new currency
CurrenciesApiUpdateCurrencyPut /api/v1/currencies/{code}Update existing currency.
DataApiBulkUpdateTransactionsPost /api/v1/data/bulk/transactionsBulk update transaction properties. For more information, see https://docs.firefly-iii.org/firefly-iii/api/specials
DataApiDestroyDataDelete /api/v1/data/destroyEndpoint to destroy user data
DataApiExportAccountsGet /api/v1/data/export/accountsExport account data from Firefly III
DataApiExportBillsGet /api/v1/data/export/billsExport bills from Firefly III
DataApiExportBudgetsGet /api/v1/data/export/budgetsExport budgets and budget amount data from Firefly III
DataApiExportCategoriesGet /api/v1/data/export/categoriesExport category data from Firefly III
DataApiExportPiggiesGet /api/v1/data/export/piggy-banksExport piggy banks from Firefly III
DataApiExportRecurringGet /api/v1/data/export/recurringExport recurring transaction data from Firefly III
DataApiExportRulesGet /api/v1/data/export/rulesExport rule groups and rule data from Firefly III
DataApiExportTagsGet /api/v1/data/export/tagsExport tag data from Firefly III
DataApiExportTransactionsGet /api/v1/data/export/transactionsExport transaction data from Firefly III
InsightApiInsightExpenseAssetGet /api/v1/insight/expense/assetInsight into expenses, grouped by asset account.
InsightApiInsightExpenseBillGet /api/v1/insight/expense/billInsight into expenses, grouped by bill.
InsightApiInsightExpenseBudgetGet /api/v1/insight/expense/budgetInsight into expenses, grouped by budget.
InsightApiInsightExpenseCategoryGet /api/v1/insight/expense/categoryInsight into expenses, grouped by category.
InsightApiInsightExpenseExpenseGet /api/v1/insight/expense/expenseInsight into expenses, grouped by expense account.
InsightApiInsightExpenseNoBillGet /api/v1/insight/expense/no-billInsight into expenses, without bill.
InsightApiInsightExpenseNoBudgetGet /api/v1/insight/expense/no-budgetInsight into expenses, without budget.
InsightApiInsightExpenseNoCategoryGet /api/v1/insight/expense/no-categoryInsight into expenses, without category.
InsightApiInsightExpenseNoTagGet /api/v1/insight/expense/no-tagInsight into expenses, without tag.
InsightApiInsightExpenseTagGet /api/v1/insight/expense/tagInsight into expenses, grouped by tag.
InsightApiInsightExpenseTotalGet /api/v1/insight/expense/totalInsight into total expenses.
InsightApiInsightIncomeAssetGet /api/v1/insight/income/assetInsight into income, grouped by asset account.
InsightApiInsightIncomeCategoryGet /api/v1/insight/income/categoryInsight into income, grouped by category.
InsightApiInsightIncomeNoCategoryGet /api/v1/insight/income/no-categoryInsight into income, without category.
InsightApiInsightIncomeNoTagGet /api/v1/insight/income/no-tagInsight into income, without tag.
InsightApiInsightIncomeRevenueGet /api/v1/insight/income/revenueInsight into income, grouped by revenue account.
InsightApiInsightIncomeTagGet /api/v1/insight/income/tagInsight into income, grouped by tag.
InsightApiInsightIncomeTotalGet /api/v1/insight/income/totalInsight into total income.
InsightApiInsightTransferCategoryGet /api/v1/insight/transfer/categoryInsight into transfers, grouped by category.
InsightApiInsightTransferNoCategoryGet /api/v1/insight/transfer/no-categoryInsight into transfers, without category.
InsightApiInsightTransferNoTagGet /api/v1/insight/transfer/no-tagInsight into expenses, without tag.
InsightApiInsightTransferTagGet /api/v1/insight/transfer/tagInsight into transfers, grouped by tag.
InsightApiInsightTransferTotalGet /api/v1/insight/transfer/totalInsight into total transfers.
InsightApiInsightTransfersGet /api/v1/insight/transfer/assetInsight into transfers, grouped by account.
LinksApiDeleteLinkTypeDelete /api/v1/link_types/{id}Permanently delete link type.
LinksApiDeleteTransactionLinkDelete /api/v1/transaction_links/{id}Permanently delete link between transactions.
LinksApiGetLinkTypeGet /api/v1/link_types/{id}Get single a link type.
LinksApiGetTransactionLinkGet /api/v1/transaction_links/{id}Get a single link.
LinksApiListLinkTypeGet /api/v1/link_typesList all types of links.
LinksApiListTransactionByLinkTypeGet /api/v1/link_types/{id}/transactionsList all transactions under this link type.
LinksApiListTransactionLinkGet /api/v1/transaction_linksList all transaction links.
LinksApiStoreLinkTypePost /api/v1/link_typesCreate a new link type
LinksApiStoreTransactionLinkPost /api/v1/transaction_linksCreate a new link between transactions
LinksApiUpdateLinkTypePut /api/v1/link_types/{id}Update existing link type.
LinksApiUpdateTransactionLinkPut /api/v1/transaction_links/{id}Update an existing link between transactions.
ObjectGroupsApiDeleteObjectGroupDelete /api/v1/object_groups/{id}Delete a object group.
ObjectGroupsApiGetObjectGroupGet /api/v1/object_groups/{id}Get a single object group.
ObjectGroupsApiListBillByObjectGroupGet /api/v1/object_groups/{id}/billsList all bills with this object group.
ObjectGroupsApiListObjectGroupsGet /api/v1/object_groupsList all oject groups.
ObjectGroupsApiListPiggyBankByObjectGroupGet /api/v1/object_groups/{id}/piggy_banksList all piggy banks related to the object group.
ObjectGroupsApiUpdateObjectGroupPut /api/v1/object_groups/{id}Update existing object group.
PiggyBanksApiDeletePiggyBankDelete /api/v1/piggy_banks/{id}Delete a piggy bank.
PiggyBanksApiGetPiggyBankGet /api/v1/piggy_banks/{id}Get a single piggy bank.
PiggyBanksApiListAttachmentByPiggyBankGet /api/v1/piggy_banks/{id}/attachmentsLists all attachments.
PiggyBanksApiListEventByPiggyBankGet /api/v1/piggy_banks/{id}/eventsList all events linked to a piggy bank.
PiggyBanksApiListPiggyBankGet /api/v1/piggy_banksList all piggy banks.
PiggyBanksApiStorePiggyBankPost /api/v1/piggy_banksStore a new piggy bank
PiggyBanksApiUpdatePiggyBankPut /api/v1/piggy_banks/{id}Update existing piggy bank.
PreferencesApiGetPreferenceGet /api/v1/preferences/{name}Return a single preference.
PreferencesApiListPreferenceGet /api/v1/preferencesList all users preferences.
PreferencesApiStorePreferencePost /api/v1/preferencesStore a new preference for this user.
PreferencesApiUpdatePreferencePut /api/v1/preferences/{name}Update preference
RecurrencesApiDeleteRecurrenceDelete /api/v1/recurrences/{id}Delete a recurring transaction.
RecurrencesApiGetRecurrenceGet /api/v1/recurrences/{id}Get a single recurring transaction.
RecurrencesApiListRecurrenceGet /api/v1/recurrencesList all recurring transactions.
RecurrencesApiListTransactionByRecurrenceGet /api/v1/recurrences/{id}/transactionsList all transactions created by a recurring transaction.
RecurrencesApiStoreRecurrencePost /api/v1/recurrencesStore a new recurring transaction
RecurrencesApiUpdateRecurrencePut /api/v1/recurrences/{id}Update existing recurring transaction.
RuleGroupsApiDeleteRuleGroupDelete /api/v1/rule_groups/{id}Delete a rule group.
RuleGroupsApiFireRuleGroupPost /api/v1/rule_groups/{id}/triggerFire the rule group on your transactions.
RuleGroupsApiGetRuleGroupGet /api/v1/rule_groups/{id}Get a single rule group.
RuleGroupsApiListRuleByGroupGet /api/v1/rule_groups/{id}/rulesList rules in this rule group.
RuleGroupsApiListRuleGroupGet /api/v1/rule_groupsList all rule groups.
RuleGroupsApiStoreRuleGroupPost /api/v1/rule_groupsStore a new rule group.
RuleGroupsApiTestRuleGroupGet /api/v1/rule_groups/{id}/testTest which transactions would be hit by the rule group. No changes will be made.
RuleGroupsApiUpdateRuleGroupPut /api/v1/rule_groups/{id}Update existing rule group.
RulesApiDeleteRuleDelete /api/v1/rules/{id}Delete an rule.
RulesApiFireRulePost /api/v1/rules/{id}/triggerFire the rule on your transactions.
RulesApiGetRuleGet /api/v1/rules/{id}Get a single rule.
RulesApiListRuleGet /api/v1/rulesList all rules.
RulesApiStoreRulePost /api/v1/rulesStore a new rule
RulesApiTestRuleGet /api/v1/rules/{id}/testTest which transactions would be hit by the rule. No changes will be made.
RulesApiUpdateRulePut /api/v1/rules/{id}Update existing rule.
SearchApiSearchAccountsGet /api/v1/search/accountsSearch for accounts
SearchApiSearchTransactionsGet /api/v1/search/transactionsSearch for transactions
SummaryApiGetBasicSummaryGet /api/v1/summary/basicReturns basic sums of the users data.
TagsApiDeleteTagDelete /api/v1/tags/{tag}Delete an tag.
TagsApiGetTagGet /api/v1/tags/{tag}Get a single tag.
TagsApiListAttachmentByTagGet /api/v1/tags/{tag}/attachmentsLists all attachments.
TagsApiListTagGet /api/v1/tagsList all tags.
TagsApiListTransactionByTagGet /api/v1/tags/{tag}/transactionsList all transactions with this tag.
TagsApiStoreTagPost /api/v1/tagsStore a new tag
TagsApiUpdateTagPut /api/v1/tags/{tag}Update existing tag.
TransactionsApiDeleteTransactionDelete /api/v1/transactions/{id}Delete a transaction.
TransactionsApiDeleteTransactionJournalDelete /api/v1/transaction-journals/{id}Delete split from transaction
TransactionsApiGetTransactionGet /api/v1/transactions/{id}Get a single transaction.
TransactionsApiGetTransactionByJournalGet /api/v1/transaction-journals/{id}Get a single transaction, based on one of the underlying transaction journals (transaction splits).
TransactionsApiListAttachmentByTransactionGet /api/v1/transactions/{id}/attachmentsLists all attachments.
TransactionsApiListEventByTransactionGet /api/v1/transactions/{id}/piggy_bank_eventsLists all piggy bank events.
TransactionsApiListLinksByJournalGet /api/v1/transaction-journals/{id}/linksLists all the transaction links for an individual journal (individual split).
TransactionsApiListTransactionGet /api/v1/transactionsList all the user's transactions.
TransactionsApiStoreTransactionPost /api/v1/transactionsStore a new transaction
TransactionsApiUpdateTransactionPut /api/v1/transactions/{id}Update existing transaction.
UsersApiDeleteUserDelete /api/v1/users/{id}Delete a user.
UsersApiGetUserGet /api/v1/users/{id}Get a single user.
UsersApiListUserGet /api/v1/usersList all users.
UsersApiStoreUserPost /api/v1/usersStore a new user
UsersApiUpdateUserPut /api/v1/users/{id}Update an existing user's information.
WebhooksApiDeleteWebhookDelete /api/v1/webhooks/{id}Delete a webhook.
WebhooksApiDeleteWebhookMessageDelete /api/v1/webhooks/{id}/messages/{messageId}Delete a webhook message.
WebhooksApiDeleteWebhookMessageAttemptDelete /api/v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId}Delete a webhook attempt.
WebhooksApiGetSingleWebhookMessageGet /api/v1/webhooks/{id}/messages/{messageId}Get a single message from a webhook.
WebhooksApiGetSingleWebhookMessageAttemptGet /api/v1/webhooks/{id}/messages/{messageId}/attempts/{attemptId}Get a single failed attempt from a single webhook message.
WebhooksApiGetWebhookGet /api/v1/webhooks/{id}Get a single webhook.
WebhooksApiGetWebhookMessageAttemptsGet /api/v1/webhooks/{id}/messages/{messageId}/attemptsGet all the failed attempts of a single webhook message.
WebhooksApiGetWebhookMessagesGet /api/v1/webhooks/{id}/messagesGet all the messages of a single webhook.
WebhooksApiListWebhookGet /api/v1/webhooksList all webhooks.
WebhooksApiStoreWebhookPost /api/v1/webhooksStore a new webhook
WebhooksApiSubmitWebookPost /api/v1/webhooks/{id}/submitSubmit messages for a webhook.
WebhooksApiUpdateWebhookPut /api/v1/webhooks/{id}Update existing webhook.

Documentation For Models

Documentation For Authorization

firefly_iii_auth

Example

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.

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

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARERTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]