freeagent

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BankReviewExplanation added in v0.4.0

type BankReviewExplanation struct {
	ID              string         `json:"id"`
	URL             string         `json:"url"`
	Category        string         `json:"category"`
	Description     string         `json:"description"`
	GrossValue      string         `json:"gross_value"`
	Project         string         `json:"project,omitempty"`
	Type            string         `json:"type,omitempty"`
	Detail          string         `json:"detail,omitempty"`
	MarkedForReview bool           `json:"marked_for_review"`
	HasAttachment   bool           `json:"has_attachment"`
	Attachment      *fa.Attachment `json:"attachment,omitempty"`
}

type BankReviewItem added in v0.4.0

type BankReviewItem struct {
	TransactionID       string                  `json:"transaction_id"`
	TransactionURL      string                  `json:"transaction_url"`
	DatedOn             string                  `json:"dated_on"`
	Amount              string                  `json:"amount"`
	Description         string                  `json:"description"`
	FullDescription     string                  `json:"full_description,omitempty"`
	MarkedForReview     bool                    `json:"marked_for_review"`
	HasExplanation      bool                    `json:"has_explanation"`
	ExplanationURLs     []string                `json:"explanation_urls,omitempty"`
	Explanations        []BankReviewExplanation `json:"explanations,omitempty"`
	Categories          []string                `json:"categories,omitempty"`
	HasAttachment       bool                    `json:"has_attachment"`
	AttachmentFilenames []string                `json:"attachment_filenames,omitempty"`
}

type BankReviewItemResponse added in v0.4.0

type BankReviewItemResponse struct {
	BankReviewItem BankReviewItem `json:"bank_review_item"`
}

type BankReviewItemsResponse added in v0.4.0

type BankReviewItemsResponse struct {
	BankReviewItems []BankReviewItem `json:"bank_review_items"`
}

type Client

type Client struct {
	BaseURL      string
	UserAgent    string
	ClientID     string
	ClientSecret string
	RedirectURI  string
	Profile      string
	Store        storage.TokenStore
	HTTP         *http.Client
	// contains filtered or unexported fields
}

func (*Client) AccessToken

func (c *Client) AccessToken(ctx context.Context) (*storage.Token, error)

func (*Client) ApproveURL

func (c *Client) ApproveURL(state string) (string, error)

func (*Client) BuildBankReviewItems added in v0.4.0

func (c *Client) BuildBankReviewItems(ctx context.Context, transactions []fa.BankTransaction) ([]BankReviewItem, error)

func (*Client) Do

func (c *Client) Do(ctx context.Context, method, path string, body io.Reader, contentType string) ([]byte, int, http.Header, error)

func (*Client) DoJSON

func (c *Client) DoJSON(ctx context.Context, method, path string, payload any) ([]byte, int, http.Header, error)

func (*Client) ExchangeCode

func (c *Client) ExchangeCode(ctx context.Context, code string) (*storage.Token, error)

func (*Client) ExplanationURLsForTransactions added in v0.4.0

func (c *Client) ExplanationURLsForTransactions(ctx context.Context, transactionURLs []string) (map[string][]string, error)

func (*Client) GetBankReviewItem added in v0.4.0

func (c *Client) GetBankReviewItem(ctx context.Context, transactionURL string) (BankReviewItem, error)

func (*Client) GetBankTransaction added in v0.4.0

func (c *Client) GetBankTransaction(ctx context.Context, transactionURL string) (fa.BankTransaction, error)

func (*Client) GetBankTransactionExplanation added in v0.4.0

func (c *Client) GetBankTransactionExplanation(ctx context.Context, explanationURL string) (fa.BankTransactionExplanation, error)

func (*Client) ListBankReviewItems added in v0.4.0

func (c *Client) ListBankReviewItems(ctx context.Context, opts ListBankTransactionsOptions) ([]BankReviewItem, error)

func (*Client) ListBankTransactionExplanations added in v0.4.0

func (c *Client) ListBankTransactionExplanations(ctx context.Context, opts ListBankTransactionExplanationsOptions) ([]fa.BankTransactionExplanation, error)

func (*Client) ListBankTransactions added in v0.4.0

func (c *Client) ListBankTransactions(ctx context.Context, opts ListBankTransactionsOptions) ([]fa.BankTransaction, error)

func (*Client) Refresh

func (c *Client) Refresh(ctx context.Context, refreshToken string) (*storage.Token, error)

func (*Client) ResolveURL

func (c *Client) ResolveURL(path string) (string, error)

func (*Client) UpdateBankTransactionExplanation added in v0.4.0

func (c *Client) UpdateBankTransactionExplanation(ctx context.Context, explanationURL string, input fa.BankTransactionExplanationInput) (fa.BankTransactionExplanation, error)

type ListBankTransactionExplanationsOptions added in v0.4.0

type ListBankTransactionExplanationsOptions struct {
	BankAccount  string
	FromDate     string
	ToDate       string
	UpdatedSince string
}

type ListBankTransactionsOptions added in v0.4.0

type ListBankTransactionsOptions struct {
	BankAccount  string
	FromDate     string
	ToDate       string
	UpdatedSince string
	View         string
	PerPage      int
}

Jump to

Keyboard shortcuts

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