# Packages
# README
Go API client for upclient
The Up API gives you programmatic access to your balances and transaction data. You can request past transactions or set up webhooks to receive real-time events when new transactions hit your account. It’s new, it’s exciting and it’s just the beginning.
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: v1
- Package version: 1.0.0
- Generator version: 7.7.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://github.com/up-banking/api
Installation
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
Put the package under your project folder and add the following in import:
import upclient "github.com/esteanes/expense-manager/datafetcher/upclient"
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 upclient.ContextServerIndex
of type int
.
ctx := context.WithValue(context.Background(), upclient.ContextServerIndex, 1)
Templated Server URL
Templated server URL is formatted using default variables from configuration or from context value upclient.ContextServerVariables
of type map[string]string
.
ctx := context.WithValue(context.Background(), upclient.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 identified by "{classname}Service.{nickname}"
string.
Similar rules for overriding default operation server index and variables applies by using upclient.ContextOperationServerIndices
and upclient.ContextOperationServerVariables
context maps.
ctx := context.WithValue(context.Background(), upclient.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), upclient.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
Documentation for API Endpoints
All URIs are relative to https://api.up.com.au/api/v1
Class | Method | HTTP request | Description |
---|---|---|---|
AccountsAPI | AccountsGet | Get /accounts | List accounts |
AccountsAPI | AccountsIdGet | Get /accounts/{id} | Retrieve account |
AttachmentsAPI | AttachmentsGet | Get /attachments | List attachments |
AttachmentsAPI | AttachmentsIdGet | Get /attachments/{id} | Retrieve attachment |
CategoriesAPI | CategoriesGet | Get /categories | List categories |
CategoriesAPI | CategoriesIdGet | Get /categories/{id} | Retrieve category |
CategoriesAPI | TransactionsTransactionIdRelationshipsCategoryPatch | Patch /transactions/{transactionId}/relationships/category | Categorize transaction |
TagsAPI | TagsGet | Get /tags | List tags |
TagsAPI | TransactionsTransactionIdRelationshipsTagsDelete | Delete /transactions/{transactionId}/relationships/tags | Remove tags from transaction |
TagsAPI | TransactionsTransactionIdRelationshipsTagsPost | Post /transactions/{transactionId}/relationships/tags | Add tags to transaction |
TransactionsAPI | AccountsAccountIdTransactionsGet | Get /accounts/{accountId}/transactions | List transactions by account |
TransactionsAPI | TransactionsGet | Get /transactions | List transactions |
TransactionsAPI | TransactionsIdGet | Get /transactions/{id} | Retrieve transaction |
UtilityEndpointsAPI | UtilPingGet | Get /util/ping | Ping |
WebhooksAPI | WebhooksGet | Get /webhooks | List webhooks |
WebhooksAPI | WebhooksIdDelete | Delete /webhooks/{id} | Delete webhook |
WebhooksAPI | WebhooksIdGet | Get /webhooks/{id} | Retrieve webhook |
WebhooksAPI | WebhooksPost | Post /webhooks | Create webhook |
WebhooksAPI | WebhooksWebhookIdLogsGet | Get /webhooks/{webhookId}/logs | List webhook logs |
WebhooksAPI | WebhooksWebhookIdPingPost | Post /webhooks/{webhookId}/ping | Ping webhook |
Documentation For Models
- AccountResource
- AccountResourceAttributes
- AccountResourceLinks
- AccountResourceRelationships
- AccountResourceRelationshipsTransactions
- AccountResourceRelationshipsTransactionsLinks
- AccountTypeEnum
- AttachmentResource
- AttachmentResourceAttributes
- AttachmentResourceRelationships
- AttachmentResourceRelationshipsTransaction
- AttachmentResourceRelationshipsTransactionData
- CardPurchaseMethodEnum
- CardPurchaseMethodObject
- CashbackObject
- CategoryInputResourceIdentifier
- CategoryResource
- CategoryResourceAttributes
- CategoryResourceRelationships
- CategoryResourceRelationshipsChildren
- CategoryResourceRelationshipsChildrenDataInner
- CategoryResourceRelationshipsParent
- CategoryResourceRelationshipsParentData
- CreateWebhookRequest
- CreateWebhookResponse
- CustomerObject
- ErrorObject
- ErrorObjectSource
- ErrorResponse
- GetAccountResponse
- GetAttachmentResponse
- GetCategoryResponse
- GetTransactionResponse
- GetWebhookResponse
- HoldInfoObject
- ListAccountsResponse
- ListAccountsResponseLinks
- ListAttachmentsResponse
- ListCategoriesResponse
- ListTagsResponse
- ListTransactionsResponse
- ListWebhookDeliveryLogsResponse
- ListWebhooksResponse
- MoneyObject
- NoteObject
- OwnershipTypeEnum
- PingResponse
- PingResponseMeta
- RoundUpObject
- TagInputResourceIdentifier
- TagResource
- TransactionResource
- TransactionResourceAttributes
- TransactionResourceRelationships
- TransactionResourceRelationshipsAccount
- TransactionResourceRelationshipsAccountData
- TransactionResourceRelationshipsAttachment
- TransactionResourceRelationshipsAttachmentData
- TransactionResourceRelationshipsCategory
- TransactionResourceRelationshipsCategoryLinks
- TransactionResourceRelationshipsTags
- TransactionResourceRelationshipsTagsDataInner
- TransactionResourceRelationshipsTagsLinks
- TransactionResourceRelationshipsTransferAccount
- TransactionResourceRelationshipsTransferAccountData
- TransactionStatusEnum
- UpdateTransactionCategoryRequest
- UpdateTransactionTagsRequest
- WebhookDeliveryLogResource
- WebhookDeliveryLogResourceAttributes
- WebhookDeliveryLogResourceAttributesRequest
- WebhookDeliveryLogResourceAttributesResponse
- WebhookDeliveryLogResourceRelationships
- WebhookDeliveryLogResourceRelationshipsWebhookEvent
- WebhookDeliveryLogResourceRelationshipsWebhookEventData
- WebhookDeliveryStatusEnum
- WebhookEventCallback
- WebhookEventResource
- WebhookEventResourceAttributes
- WebhookEventResourceRelationships
- WebhookEventResourceRelationshipsWebhook
- WebhookEventResourceRelationshipsWebhookData
- WebhookEventTypeEnum
- WebhookInputResource
- WebhookInputResourceAttributes
- WebhookResource
- WebhookResourceAttributes
- WebhookResourceRelationships
Documentation For Authorization
Authentication schemes defined for the API:
bearer_auth
- Type: HTTP Bearer token authentication
Example
auth := context.WithValue(context.Background(), upclient.ContextAccessToken, "BEARER_TOKEN_STRING")
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