ynab

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	ID     string `json:"id,omitempty"`
	Name   string `json:"name,omitempty"`
	Detail string `json:"detail,omitempty"`
}

func (APIError) Error

func (e APIError) Error() string

type Account

type Account struct {
	ID                  string `json:"id,omitempty"`
	Name                string `json:"name,omitempty"`
	Type                string `json:"type,omitempty"`
	OnBudget            bool   `json:"on_budget,omitempty"`
	Closed              bool   `json:"closed,omitempty"`
	Note                string `json:"note,omitempty"`
	Balance             int64  `json:"balance,omitempty"`
	ClearedBalance      int64  `json:"cleared_balance,omitempty"`
	UnclearedBalance    int64  `json:"uncleared_balance,omitempty"`
	TransferPayeeID     string `json:"transfer_payee_id,omitempty"`
	DirectImportLinked  bool   `json:"direct_import_linked,omitempty"`
	DirectImportInError bool   `json:"direct_import_in_error,omitempty"`
	Deleted             bool   `json:"deleted,omitempty"`
}

type Balance

type Balance struct {
	Date        string
	Amount      int64
	AccountID   string
	AccountName string
}

func RunningBalance

func RunningBalance(txs []Transaction) ([]Balance, error)

type Budget

type Budget struct {
	ID             string         `json:"id,omitempty"`
	Name           string         `json:"name,omitempty"`
	Accounts       []Account      `json:"accounts,omitempty"`
	CurrencyFormat CurrencyFormat `json:"currency_format"`
}

type CacheClient

type CacheClient struct {
	*Client
	// contains filtered or unexported fields
}

func NewCacheClient

func NewCacheClient(client *Client) *CacheClient

func (*CacheClient) Budget added in v0.1.2

func (c *CacheClient) Budget(ctx context.Context, budgetID string) (Budget, error)

func (*CacheClient) Budgets

func (c *CacheClient) Budgets(ctx context.Context, includeAccounts bool) ([]Budget, error)

func (*CacheClient) Categories

func (c *CacheClient) Categories(ctx context.Context, budgetID string) ([]CategoryGroup, error)

func (*CacheClient) Transactions

func (c *CacheClient) Transactions(ctx context.Context, budgetID, accountID, sinceDate string) ([]Transaction, error)

type Category

type Category struct {
	ID                      string `json:"id,omitempty"`
	CategoryGroupID         string `json:"category_group_id,omitempty"`
	Name                    string `json:"name,omitempty"`
	OriginalCategoryGroupID string `json:"original_category_group_id,omitempty"`
	Budgeted                int64  `json:"budgeted,omitempty"`
	Activity                int64  `json:"activity,omitempty"`
	Balance                 int64  `json:"balance,omitempty"`
}

type CategoryGroup

type CategoryGroup struct {
	ID         string     `json:"id,omitempty"`
	Name       string     `json:"name,omitempty"`
	Hidden     bool       `json:"hidden,omitempty"`
	Deleted    bool       `json:"deleted,omitempty"`
	Categories []Category `json:"categories,omitempty"`
}

type Client

type Client struct {
	BaseURL string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiToken string) *Client

func (*Client) Accounts

func (c *Client) Accounts(ctx context.Context, budgetID string) ([]Account, error)

func (*Client) Budget added in v0.1.2

func (c *Client) Budget(ctx context.Context, budgetID string) (Budget, error)

func (*Client) Budgets

func (c *Client) Budgets(ctx context.Context, includeAccounts bool) ([]Budget, error)

func (*Client) Categories

func (c *Client) Categories(ctx context.Context, budgetID string) ([]CategoryGroup, error)

func (*Client) Test

func (c *Client) Test(ctx context.Context) error

func (*Client) Transactions

func (c *Client) Transactions(ctx context.Context, budgetID, accountID, sinceDate string) ([]Transaction, error)

type CurrencyFormat added in v0.1.2

type CurrencyFormat struct {
	ISOCode       string `json:"iso_code"`
	DecimalDigits int    `json:"decimal_digits"`
}

type Subtransaction

type Subtransaction struct {
	ID                    string `json:"id,omitempty"`
	TransactionID         string `json:"transaction_id,omitempty"`
	Amount                int64  `json:"amount,omitempty"`
	Memo                  string `json:"memo,omitempty"`
	PayeeID               string `json:"payee_id,omitempty"`
	PayeeName             string `json:"payee_name,omitempty"`
	CategoryID            string `json:"category_id,omitempty"`
	CategoryName          string `json:"category_name,omitempty"`
	TransferAccountID     string `json:"transfer_account_id,omitempty"`
	TransferTransactionID string `json:"transfer_transaction_id,omitempty"`
	Deleted               bool   `json:"deleted,omitempty"`
}

type Transaction

type Transaction struct {
	ID                    string        `json:"id,omitempty"`
	Date                  string        `json:"date,omitempty"`
	Amount                int64         `json:"amount,omitempty"`
	Memo                  string        `json:"memo,omitempty"`
	Cleared               string        `json:"cleared,omitempty"`
	Approved              bool          `json:"approved,omitempty"`
	FlagColor             string        `json:"flag_color,omitempty"`
	AccountID             string        `json:"account_id,omitempty"`
	PayeeID               string        `json:"payee_id,omitempty"`
	CategoryID            string        `json:"category_id,omitempty"`
	TransferAccountID     string        `json:"transfer_account_id,omitempty"`
	TransferTransactionID string        `json:"transfer_transaction_id,omitempty"`
	MatchedTransactionID  string        `json:"matched_transaction_id,omitempty"`
	ImportID              string        `json:"import_id,omitempty"`
	Deleted               bool          `json:"deleted,omitempty"`
	AccountName           string        `json:"account_name,omitempty"`
	PayeeName             string        `json:"payee_name,omitempty"`
	CategoryName          string        `json:"category_name,omitempty"`
	Subtransactions       []Transaction `json:"subtransactions,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL