Skip to main content

Crate rust_ynab

Crate rust_ynab 

Source
Expand description

A Rust client for the YNAB API.

§Quick Start

use rust_ynab::{Client, PlanId};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new(&std::env::var("YNAB_TOKEN")?)?;
    let plans = client.get_plans().include_accounts().send().await?;
    for plan in plans {
        println!("{}", plan.name);
    }
    Ok(())
}

Modules§

display

Structs§

Account
A plan account. Amounts are in milliunits (divide by 1000 for display).
ApiError
Category
A budget category. Amounts (assigned, activity, available, etc.) are specific to the current plan month (UTC) and are in milliunits (divide by 1000 for display).
CategoryGroup
A group of budget categories.
Client
Client is the YNAB API client. Use Client::new() to create one.
CurrencyFormat
DateFormat
ExistingTransaction
Request body for updating an existing transaction (PUT single).
MoneyMovement
A movement of money between categories. Amounts are in milliunits (divide by 1000 for display).
MoneyMovementGroup
A group of related money movements.
Month
A plan month. This is where Ready to Assign, Age of Money, and category amounts (assigned, activity, available) are available. Amounts are in milliunits (divide by 1000 for display).
NewCategory
The category to create.
NewTransaction
Request body for creating a new transaction.
Payee
A payee for a plan.
PayeeLocation
A GPS location stored when a transaction is entered on a mobile device. Locations will not be available for all payees.
Plan
Summary information for a plan.
PlanSettings
Date and currency format settings for a plan.
PostPayee
Request body for creating a new payee. Name is required and must not exceed 500 characters.
SaveAccount
The account to create.
SaveCategory
The category to update. Only specified (non-None) fields will be changed.
SaveCategoryGroup
The category group to create or update.
SaveMonthCategory
The month category to update. Only budgeted (assigned) can be changed.
SavePayee
Request body for updating an existing payee. All fields are optional; omitted fields are not changed.
SaveScheduledTransaction
Request body for creating or updating a scheduled transaction.
SaveSubTransaction
A subtransaction within a split transaction to be created or updated.
SaveTransactionWithIdOrImportId
Request body for a single transaction within a batch update (PATCH). Either id or import_id must be specified to identify the transaction.
SaveTransactionsResponse
Response from creating or batch-updating transactions.
ScheduledSubtransaction
A line item within a split scheduled transaction. Amounts are in milliunits (divide by 1000 for display).
ScheduledTransaction
A scheduled transaction. Amounts are in milliunits (divide by 1000 for display).
Subtransaction
A line item within a split transaction. Amounts are in milliunits (divide by 1000 for display).
Transaction
A plan transaction, excluding any pending transactions. Amounts are in milliunits (divide by 1000 for display).
User
The authenticated YNAB user.

Enums§

AccountType
The type of account.
ClearedStatus
The cleared status of a transaction.
Error
FlagColor
The color of a transaction flag.
Frequency
The recurrence frequency of a scheduled transaction.
GoalType
The type of savings or spending goal assigned to a category.
PlanId
Identifies a plan for use in API requests.
SaveAccountType
The type of account to create or update.
TransactionType

Functions§

milliunits_to_amount
Converts a YNAB milliunit amount to a dollar amount.