package
0.0.0-20241006083107-3e14ff0db0d8
Repository: https://github.com/esteanes/expense-manager.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# 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

ClassMethodHTTP requestDescription
AccountsAPIAccountsGetGet /accountsList accounts
AccountsAPIAccountsIdGetGet /accounts/{id}Retrieve account
AttachmentsAPIAttachmentsGetGet /attachmentsList attachments
AttachmentsAPIAttachmentsIdGetGet /attachments/{id}Retrieve attachment
CategoriesAPICategoriesGetGet /categoriesList categories
CategoriesAPICategoriesIdGetGet /categories/{id}Retrieve category
CategoriesAPITransactionsTransactionIdRelationshipsCategoryPatchPatch /transactions/{transactionId}/relationships/categoryCategorize transaction
TagsAPITagsGetGet /tagsList tags
TagsAPITransactionsTransactionIdRelationshipsTagsDeleteDelete /transactions/{transactionId}/relationships/tagsRemove tags from transaction
TagsAPITransactionsTransactionIdRelationshipsTagsPostPost /transactions/{transactionId}/relationships/tagsAdd tags to transaction
TransactionsAPIAccountsAccountIdTransactionsGetGet /accounts/{accountId}/transactionsList transactions by account
TransactionsAPITransactionsGetGet /transactionsList transactions
TransactionsAPITransactionsIdGetGet /transactions/{id}Retrieve transaction
UtilityEndpointsAPIUtilPingGetGet /util/pingPing
WebhooksAPIWebhooksGetGet /webhooksList webhooks
WebhooksAPIWebhooksIdDeleteDelete /webhooks/{id}Delete webhook
WebhooksAPIWebhooksIdGetGet /webhooks/{id}Retrieve webhook
WebhooksAPIWebhooksPostPost /webhooksCreate webhook
WebhooksAPIWebhooksWebhookIdLogsGetGet /webhooks/{webhookId}/logsList webhook logs
WebhooksAPIWebhooksWebhookIdPingPostPost /webhooks/{webhookId}/pingPing webhook

Documentation For Models

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

Author