Documentation ¶
Index ¶
- Variables
- func StringVal(p *string) string
- type Account
- type AccountResponse
- type AccountWrapper
- type AccountsResponse
- type AccountsService
- type AccountsWrapper
- type ApiError
- type BudgetDetail
- type BudgetDetailResponse
- type BudgetDetailWrapper
- type BudgetSummary
- type BudgetSummaryResponse
- type BudgetSummaryWrapper
- type BudgetsService
- type BulkIdWrapper
- type BulkIds
- type BulkResponse
- type BulkTransactions
- type CategoriesResponse
- type CategoriesService
- type Category
- type CategoryGroup
- type CategoryGroupWithCategories
- type CategoryGroupsWrapper
- type CategoryResponse
- type CategoryWrapper
- type Client
- type CurrencyFormat
- type DateFormat
- type ErrorResponse
- type HybridTransaction
- type HybridTransactionsResponse
- type HybridTransactionsWrapper
- type MonthDetail
- type MonthDetailResponse
- type MonthDetailWrapper
- type MonthSummariesResponse
- type MonthSummariesWrapper
- type MonthSummary
- type MonthsService
- type Payee
- type PayeeLocation
- type PayeeLocationResponse
- type PayeeLocationWrapper
- type PayeeLocationsResponse
- type PayeeLocationsService
- type PayeeLocationsWrapper
- type PayeeResponse
- type PayeeWrapper
- type PayeesResponse
- type PayeesService
- type PayeesWrapper
- type SaveTransaction
- type SaveTransactionWrapper
- type ScheduledSubTransaction
- type ScheduledTransactionDetail
- type ScheduledTransactionResponse
- type ScheduledTransactionSummary
- type ScheduledTransactionWrapper
- type ScheduledTransactionsResponse
- type ScheduledTransactionsService
- type ScheduledTransactionsWrapper
- type SubTransaction
- type TransactionDetail
- type TransactionResponse
- type TransactionSummary
- type TransactionWrapper
- type TransactionsResponse
- type TransactionsService
- func (ts *TransactionsService) Create(budgetId string, transaction *SaveTransaction) (TransactionDetail, error)
- func (ts *TransactionsService) CreateBulk(budgetId string, transactions []SaveTransaction) ([]TransactionDetail, error)
- func (ts *TransactionsService) Edit(budgetId string, transactionId string, transaction *SaveTransaction) (TransactionDetail, error)
- func (ts *TransactionsService) Get(budgetId string, transactionId string) (TransactionDetail, error)
- func (ts *TransactionsService) GetByAccount(budgetId string, accountId string) ([]TransactionDetail, error)
- func (ts *TransactionsService) GetByCategory(budgetId string, categoryId string) ([]HybridTransaction, error)
- func (ts *TransactionsService) GetByPayee(budgetId string, payeeId string) ([]HybridTransaction, error)
- func (ts *TransactionsService) List(budgetId string) ([]TransactionDetail, error)
- type TransactionsWrapper
- type User
- type UserResponse
- type UserService
- type UserWrapper
Constants ¶
This section is empty.
Variables ¶
var DefaultBaseURL = "https://api.youneedabudget.com/v1/"
var Endpoint = oauth2.Endpoint{
AuthURL: "https://app.youneedabudget.com/oauth/authorize",
TokenURL: "https://app.youneedabudget.com/oauth/token",
}
Endpoint is YNAB's OAuth 2.0 endpoint.
Functions ¶
Types ¶
type Account ¶
type Account struct { Id string `json:"id"` Name string `json:"name"` Type string `json:"type"` OnBudget bool `json:"on_budget"` Closed bool `json:"closed"` Note *string `json:"note"` Balance int `json:"balance"` ClearedBalance int `json:"cleared_balance"` UnclearedBalance int `json:"uncleared_balance"` }
type AccountResponse ¶
type AccountResponse struct {
Data AccountWrapper `json:"data"`
}
type AccountWrapper ¶
type AccountWrapper struct {
Account Account `json:"account"`
}
type AccountsResponse ¶
type AccountsResponse struct {
Data AccountsWrapper `json:"data"`
}
type AccountsService ¶
type AccountsService service
func (*AccountsService) Get ¶
func (as *AccountsService) Get(budgetId string, accountId string) (Account, error)
type AccountsWrapper ¶
type AccountsWrapper struct {
Accounts []Account `json:"accounts"`
}
type BudgetDetail ¶
type BudgetDetail struct { BudgetSummary Accounts []Account `json:"accounts"` Payees []Payee `json:"payees"` PayeeLocations []PayeeLocation `json:"payee_locations"` CategoryGroups []CategoryGroup `json:"category_groups"` Categories []Category `json:"categories"` Months []MonthDetail `json:"months"` Transactions []TransactionSummary `json:"transactions"` Subtransactions []SubTransaction `json:"subtransactions"` ScheduledTransactions []ScheduledTransactionSummary `json:"scheduled_transactions"` ScheduledSubtransactions []ScheduledSubTransaction `json:"scheduled_subtransactions"` }
type BudgetDetailResponse ¶
type BudgetDetailResponse struct {
Data BudgetDetailWrapper `json:"data"`
}
type BudgetDetailWrapper ¶
type BudgetDetailWrapper struct { Budget BudgetDetail `json:"budget"` ServerKnowledge int `json:"server_knowledge"` }
type BudgetSummary ¶
type BudgetSummary struct { Id string `json:"id"` Name string `json:"name"` LastModifiedOn *string `json:"last_modified_on"` DateFormat DateFormat `json:"date_format"` CurrencyFormat CurrencyFormat `json:"currency_format"` }
type BudgetSummaryResponse ¶
type BudgetSummaryResponse struct {
Data BudgetSummaryWrapper `json:"data"`
}
type BudgetSummaryWrapper ¶
type BudgetSummaryWrapper struct {
Budgets []BudgetSummary `json:"budgets"`
}
type BudgetsService ¶
type BudgetsService service
func (*BudgetsService) Get ¶
func (bs *BudgetsService) Get(id string) (BudgetDetail, error)
func (*BudgetsService) List ¶
func (bs *BudgetsService) List() ([]BudgetSummary, error)
type BulkIdWrapper ¶
type BulkIdWrapper struct {
Bulk BulkIds `json:"bulk"`
}
type BulkResponse ¶
type BulkResponse struct {
Data BulkIdWrapper `json:"data"`
}
type BulkTransactions ¶
type BulkTransactions struct {
Transactions []SaveTransaction `json:"transactions"`
}
type CategoriesResponse ¶
type CategoriesResponse struct {
Data CategoryGroupsWrapper `json:"data"`
}
type CategoriesService ¶
type CategoriesService service
func (*CategoriesService) Get ¶
func (cs *CategoriesService) Get(budgetId string, categoryId string) (Category, error)
https://api.youneedabudget.com/v1#/Categories/getCategoryById
func (*CategoriesService) List ¶
func (cs *CategoriesService) List(budgetId string) ([]CategoryGroupWithCategories, error)
type CategoryGroup ¶
type CategoryGroupWithCategories ¶
type CategoryGroupWithCategories struct { CategoryGroup Categories []Category `json:"categories"` }
type CategoryGroupsWrapper ¶
type CategoryGroupsWrapper struct {
CategoryGroups []CategoryGroupWithCategories `json:"category_groups"`
}
type CategoryResponse ¶
type CategoryResponse struct {
Data CategoryWrapper `json:"data"`
}
type CategoryWrapper ¶
type CategoryWrapper struct {
Category Category `json:"category"`
}
type Client ¶
type Client struct { BaseURL *url.URL AccountsService *AccountsService BudgetService *BudgetsService CategoriesService *CategoriesService MonthsService *MonthsService PayeeLocationsService *PayeeLocationsService PayeesService *PayeesService ScheduledTransactionsService *ScheduledTransactionsService TransactionsService *TransactionsService UserService *UserService // contains filtered or unexported fields }
func NewDefaultClient ¶
type CurrencyFormat ¶
type CurrencyFormat struct { IsoCode string `json:"iso_code"` ExampleFormat string `json:"example_format"` DecimalDigits int `json:"decimal_digits"` DecimalSeparator string `json:"decimal_separator"` SymbolFirst bool `json:"symbol_first"` GroupSeparator string `json:"group_separator"` CurrencySymbol string `json:"currency_symbol"` DisplaySymbol bool `json:"display_symbol"` }
type DateFormat ¶
type DateFormat struct {
Format string `json:"format"`
}
type ErrorResponse ¶
func (ErrorResponse) Error ¶
func (r ErrorResponse) Error() string
type HybridTransaction ¶
type HybridTransactionsResponse ¶
type HybridTransactionsResponse struct {
Data HybridTransactionsWrapper `json:"data"`
}
type HybridTransactionsWrapper ¶
type HybridTransactionsWrapper struct {
Transactions []HybridTransaction `json:"transactions"`
}
type MonthDetail ¶
type MonthDetail struct { MonthSummary Categories []Category `json:"categories"` }
type MonthDetailResponse ¶
type MonthDetailResponse struct {
Data MonthDetailWrapper `json:"data"`
}
type MonthDetailWrapper ¶
type MonthDetailWrapper struct {
Month MonthDetail `json:"month"`
}
type MonthSummariesResponse ¶
type MonthSummariesResponse struct {
Data MonthSummariesWrapper `json:"data"`
}
type MonthSummariesWrapper ¶
type MonthSummariesWrapper struct {
Months []MonthSummary `json:"months"`
}
type MonthSummary ¶
type MonthsService ¶
type MonthsService service
func (*MonthsService) Get ¶
func (ms *MonthsService) Get(budgetId string, month string) (MonthDetail, error)
func (*MonthsService) List ¶
func (ms *MonthsService) List(budgetId string) ([]MonthSummary, error)
type PayeeLocation ¶
type PayeeLocationResponse ¶
type PayeeLocationResponse struct {
Data PayeeLocationWrapper `json:"data"`
}
type PayeeLocationWrapper ¶
type PayeeLocationWrapper struct {
PayeeLocation PayeeLocation `json:"payee_location"`
}
type PayeeLocationsResponse ¶
type PayeeLocationsResponse struct {
Data PayeeLocationsWrapper `json:"data"`
}
type PayeeLocationsService ¶
type PayeeLocationsService service
func (*PayeeLocationsService) Get ¶
func (pls *PayeeLocationsService) Get(budgetId string, payeeLocationId string) (PayeeLocation, error)
https://api.youneedabudget.com/v1#/Payee_Locations/getPayeeLocationById
func (*PayeeLocationsService) GetByPayee ¶
func (pls *PayeeLocationsService) GetByPayee(budgetId string, payeeId string) ([]PayeeLocation, error)
https://api.youneedabudget.com/v1#/Payee_Locations/getPayeeLocationsByPayee
func (*PayeeLocationsService) List ¶
func (pls *PayeeLocationsService) List(budgetId string) ([]PayeeLocation, error)
https://api.youneedabudget.com/v1#/Payee_Locations/getPayeeLocations
type PayeeLocationsWrapper ¶
type PayeeLocationsWrapper struct {
PayeeLocations []PayeeLocation `json:"payee_locations"`
}
type PayeeResponse ¶
type PayeeResponse struct {
Data PayeeWrapper `json:"data"`
}
type PayeeWrapper ¶
type PayeeWrapper struct {
Payee Payee `json:"payee"`
}
type PayeesResponse ¶
type PayeesResponse struct {
Data PayeesWrapper `json:"data"`
}
type PayeesService ¶
type PayeesService service
func (*PayeesService) Get ¶
func (ps *PayeesService) Get(budgetId string, payeeId string) (Payee, error)
type PayeesWrapper ¶
type PayeesWrapper struct {
Payees []Payee `json:"payees"`
}
type SaveTransaction ¶
type SaveTransaction struct { AccountId string `json:"account_id"` Date string `json:"date"` Amount int `json:"amount"` PayeeId string `json:"payee_id,omitempty"` PayeeName string `json:"payee_name,omitempty"` CategoryId string `json:"category_id,omitempty"` Memo string `json:"memo,omitempty"` Cleared string `json:"cleared,omitempty"` Approved bool `json:"approved,omitempty"` FlagColor string `json:"flag_color,omitempty"` ImportId string `json:"import_id,omitempty"` }
func NewSaveTransaction ¶
func NewSaveTransaction(accountId string, date string, amount int) *SaveTransaction
type SaveTransactionWrapper ¶
type SaveTransactionWrapper struct {
Transaction *SaveTransaction `json:"transaction"`
}
type ScheduledSubTransaction ¶
type ScheduledSubTransaction struct { Id string `json:"id"` ScheduledTransactionId string `json:"scheduled_transaction_id"` Amount int `json:"amount"` Memo *string `json:"memo"` PayeeId *string `json:"payee_id"` CategoryId *string `json:"category_id"` TransferAccountId *string `json:"transfer_account_id"` }
type ScheduledTransactionDetail ¶
type ScheduledTransactionDetail struct { ScheduledTransactionSummary AccountName string `json:"account_name"` PayeeName string `json:"payee_name"` CategoryName string `json:"category_name"` SubTransactions []ScheduledSubTransaction `json:"subtransactions"` }
type ScheduledTransactionResponse ¶
type ScheduledTransactionResponse struct {
Data ScheduledTransactionWrapper `json:"data"`
}
type ScheduledTransactionSummary ¶
type ScheduledTransactionSummary struct { Id string `json:"id"` DateFirst string `json:"date_first"` DateNext string `json:"date_next"` Frequency string `json:"frequency"` Amount int `json:"amount"` Memo *string `json:"memo"` FlagColor *string `json:"flag_color"` AccountId string `json:"account_id"` PayeeId *string `json:"payee_id"` CategoryId *string `json:"category_id"` TransferAccountId *string `json:"transfer_account_id"` }
type ScheduledTransactionWrapper ¶
type ScheduledTransactionWrapper struct {
ScheduledTransaction ScheduledTransactionDetail `json:"scheduled_transaction"`
}
type ScheduledTransactionsResponse ¶
type ScheduledTransactionsResponse struct {
Data ScheduledTransactionsWrapper `json:"data"`
}
type ScheduledTransactionsService ¶
type ScheduledTransactionsService service
func (*ScheduledTransactionsService) Get ¶
func (sts *ScheduledTransactionsService) Get(budgetId string, scheduledTransactionId string) (ScheduledTransactionDetail, error)
https://api.youneedabudget.com/v1#/Scheduled_Transactions/getScheduledTransactionById
func (*ScheduledTransactionsService) List ¶
func (sts *ScheduledTransactionsService) List(budgetId string) ([]ScheduledTransactionDetail, error)
https://api.youneedabudget.com/v1#/Scheduled_Transactions/getScheduledTransactions
type ScheduledTransactionsWrapper ¶
type ScheduledTransactionsWrapper struct {
ScheduledTransactions []ScheduledTransactionDetail `json:"scheduled_transactions"`
}
type SubTransaction ¶
type TransactionDetail ¶
type TransactionDetail struct { TransactionSummary AccountName string `json:"account_name"` PayeeName string `json:"payee_name"` CategoryName string `json:"category_name"` SubTransactions []SubTransaction `json:"subtransactions"` }
type TransactionResponse ¶
type TransactionResponse struct {
Data TransactionWrapper `json:"data"`
}
type TransactionSummary ¶
type TransactionSummary struct { Id string `json:"id"` Date string `json:"date"` Amount int `json:"amount"` Memo *string `json:"memo"` Cleared string `json:"cleared"` Approved bool `json:"approved"` FlagColor *string `json:"flag_color"` AccountId string `json:"account_id"` PayeeId *string `json:"payee_id"` CategoryId *string `json:"category_id"` TransferAccountId *string `json:"transfer_account_id"` ImportId *string `json:"import_id"` }
type TransactionWrapper ¶
type TransactionWrapper struct {
Transaction TransactionDetail `json:"transaction"`
}
type TransactionsResponse ¶
type TransactionsResponse struct {
Data TransactionsWrapper `json:"data"`
}
type TransactionsService ¶
type TransactionsService service
func (*TransactionsService) Create ¶
func (ts *TransactionsService) Create(budgetId string, transaction *SaveTransaction) (TransactionDetail, error)
https://api.youneedabudget.com/v1#/Transactions/createTransaction
func (*TransactionsService) CreateBulk ¶
func (ts *TransactionsService) CreateBulk(budgetId string, transactions []SaveTransaction) ([]TransactionDetail, error)
https://api.youneedabudget.com/v1#/Transactions/bulkCreateTransactions
func (*TransactionsService) Edit ¶
func (ts *TransactionsService) Edit(budgetId string, transactionId string, transaction *SaveTransaction) (TransactionDetail, error)
https://api.youneedabudget.com/v1#/Transactions/updateTransaction
func (*TransactionsService) Get ¶
func (ts *TransactionsService) Get(budgetId string, transactionId string) (TransactionDetail, error)
https://api.youneedabudget.com/v1#/Transactions/getTransactionsById
func (*TransactionsService) GetByAccount ¶
func (ts *TransactionsService) GetByAccount(budgetId string, accountId string) ([]TransactionDetail, error)
https://api.youneedabudget.com/v1#/Transactions/getTransactionsByAccount
func (*TransactionsService) GetByCategory ¶
func (ts *TransactionsService) GetByCategory(budgetId string, categoryId string) ([]HybridTransaction, error)
https://api.youneedabudget.com/v1#/Transactions/getTransactionsByCategory
func (*TransactionsService) GetByPayee ¶
func (ts *TransactionsService) GetByPayee(budgetId string, payeeId string) ([]HybridTransaction, error)
https://api.youneedabudget.com/v1#/Transactions/getTransactionsByPayee
func (*TransactionsService) List ¶
func (ts *TransactionsService) List(budgetId string) ([]TransactionDetail, error)
https://api.youneedabudget.com/v1#/Transactions/getTransactions
type TransactionsWrapper ¶
type TransactionsWrapper struct {
Transactions []TransactionDetail `json:"transactions"`
}
type UserResponse ¶
type UserResponse struct {
Data UserWrapper `json:"data"`
}
type UserService ¶
type UserService service
func (*UserService) Get ¶
func (us *UserService) Get() (User, error)
type UserWrapper ¶
type UserWrapper struct {
User User `json:"user"`
}