Documentation ¶
Index ¶
- Constants
- func WithHTTPClient(httpClient *http.Client) newClientOption
- func WithHost(host string) newClientOption
- func WithLogger(logger *slog.Logger) newClientOption
- func WithPageSize(pageSize int) newClientOption
- func WithQuiet() newClientOption
- type Account
- type Client
- func (c *Client) GetAccount(ctx context.Context, id string) (*Response[Account], error)
- func (c *Client) ListAccounts(ctx context.Context, params ListAccountsParams) (*Response[[]Account], error)
- func (c *Client) ListTransactions(ctx context.Context, params ListTransactionsParams) (*Response[[]Transaction], error)
- func (c *Client) ListTransactionsForAccount(ctx context.Context, accoundID string, params ListTransactionsParams) (*Response[[]Transaction], error)
- func (c *Client) PaginateAllAccounts(ctx context.Context, params ListAccountsParams) ([]Account, error)
- func (c *Client) PaginateAllTransactions(ctx context.Context, params ListTransactionsParams) ([]Transaction, error)
- func (c *Client) PaginateAllTransactionsForAccount(ctx context.Context, accountID string, params ListTransactionsParams) ([]Transaction, error)
- type ErrorResponse
- type ListAccountsParams
- type ListTransactionsParams
- type Money
- type Response
- type Transaction
Constants ¶
View Source
const ( AccountTypeSaver = "SAVER" AccountTypeTransactional = "TRANSACTIONAL" AccountTypeHomeLoan = "HOME_LOAN" )
View Source
const ( OwnershipTypeIndividual = "INDIVIDUAL" OwnershipTypeJoint = "JOINT" )
View Source
const DefaultHost = "https://api.up.com.au/api/v1"
Variables ¶
This section is empty.
Functions ¶
func WithHTTPClient ¶
func WithLogger ¶
func WithPageSize ¶
func WithPageSize(pageSize int) newClientOption
Types ¶
type Account ¶
type Account struct { Type string `json:"type"` ID string `json:"id"` Attributes struct { DisplayName string `json:"displayName"` AccountType string `json:"accountType"` OwnershipType string `json:"ownershipType"` Balance Money `json:"balance"` CreatedAt time.Time `json:"createdAt"` } `json:"attributes"` }
type Client ¶
type Client struct { Token string PageSize int Host string HTTPClient *http.Client Logger *slog.Logger }
func (*Client) GetAccount ¶
func (*Client) ListAccounts ¶
func (*Client) ListTransactions ¶
func (c *Client) ListTransactions(ctx context.Context, params ListTransactionsParams) (*Response[[]Transaction], error)
func (*Client) ListTransactionsForAccount ¶
func (c *Client) ListTransactionsForAccount(ctx context.Context, accoundID string, params ListTransactionsParams) (*Response[[]Transaction], error)
func (*Client) PaginateAllAccounts ¶
func (*Client) PaginateAllTransactions ¶
func (c *Client) PaginateAllTransactions(ctx context.Context, params ListTransactionsParams) ([]Transaction, error)
func (*Client) PaginateAllTransactionsForAccount ¶
func (c *Client) PaginateAllTransactionsForAccount(ctx context.Context, accountID string, params ListTransactionsParams) ([]Transaction, error)
type ErrorResponse ¶
type ErrorResponse struct { Errors []struct { Status string `json:"status"` Title string `json:"title"` Detail string `json:"detail"` Source *struct { Parameter string `json:"parameter"` Pointer string `json:"pointer"` } `json:"source,omitempty"` } `json:"errors"` }
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type ListAccountsParams ¶
type ListTransactionsParams ¶
type ListTransactionsParams struct { Status string `qparam:"filter[status]"` Since time.Time `qparam:"filter[since]"` Until time.Time `qparam:"filter[until]"` Category string `qparam:"filter[category]"` Tag string `qparam:"filter[tag]"` Before string `qparam:"page[before]"` After string `qparam:"page[after]"` }
type Transaction ¶
type Transaction struct { Type string `json:"type"` ID string `json:"id"` Attributes struct { Status string `json:"status"` RawText *string `json:"rawText,omitempty"` Description string `json:"description"` Message *string `json:"message,omitempty"` IsCategorizable bool `json:"isCategorizable"` HoldInfo *struct { Amount Money `json:"amount"` ForeignAmount *Money `json:"foreignAmount,omitempty"` } `json:"holdInfo,omitempty"` RoundUp *struct { Amount Money `json:"amount"` BoostPortion *Money `json:"boostPortion,omitempty"` } `json:"roundUp,omitempty"` Cashback *struct { Description string `json:"description"` Amount Money `json:"amount"` } `json:"cashback,omitempty"` Amount Money `json:"amount"` ForeignAmount *Money `json:"foreignAmount,omitempty"` CardPurchaseMethod *struct { Method string `json:"method"` CardNumberSuffix *string `json:"cardNumberSuffix,omitempty"` } `json:"cardPurchaseMethod,omitempty"` SettledAt *time.Time `json:"settledAt,omitempty"` CreatedAt time.Time `json:"createdAt"` } `json:"attributes"` }
Click to show internal directories.
Click to hide internal directories.