pub struct Client { /* private fields */ }
Expand description
A client for interacting with the Up API.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn list_accounts(
&self,
options: &ListAccountsOptions,
) -> Result<ListAccountsResponse, Error>
pub async fn list_accounts( &self, options: &ListAccountsOptions, ) -> Result<ListAccountsResponse, Error>
Retrieve a paginated list of all accounts for the currently
authenticated user. The returned list is paginated and can be scrolled
by following the prev
and next
links where present.
Sourcepub async fn get_account(&self, id: &str) -> Result<GetAccountResponse, Error>
pub async fn get_account(&self, id: &str) -> Result<GetAccountResponse, Error>
Retrieve a specific account by providing its unique identifier.
Source§impl Client
impl Client
Sourcepub async fn list_categories(
&self,
options: &ListCategoriesOptions,
) -> Result<ListCategoriesResponse, Error>
pub async fn list_categories( &self, options: &ListCategoriesOptions, ) -> Result<ListCategoriesResponse, Error>
Retrieve a list of all categories and their ancestry. The returned list is not paginated.
Sourcepub async fn get_category(&self, id: &str) -> Result<GetCategoryResponse, Error>
pub async fn get_category(&self, id: &str) -> Result<GetCategoryResponse, Error>
Retrieve a specific category by providing its unique identifier.
Sourcepub async fn categorise_transaction(
&self,
transaction_id: &str,
category: Option<&str>,
) -> Result<(), Error>
pub async fn categorise_transaction( &self, transaction_id: &str, category: Option<&str>, ) -> Result<(), Error>
Updates the category associated with a transaction. Only transactions
for which is_categorizable
is set to true support this operation. The
id
is taken from the list exposed on list_categories
and cannot be
one of the top-level (parent) categories. To de-categorize a
transaction, set the entire data
key to null
. The associated
category, along with its request URL is also exposed via the category
relationship on the transaction resource returned from get_transaction
.
Source§impl Client
impl Client
Retrieve a list of all tags currently in use. The returned list is
paginated and can be scrolled by following the next
and prev
links
where present. Results are ordered lexicographically. The transactions
relationship for each tag exposes a link to get the transactions with
the given tag.
Associates one or more tags with a specific transaction. No more than 6
tags may be present on any single transaction. Duplicate tags are
silently ignored. The associated tags, along with this request URL, are
also exposed via the tags relationship on the transaction resource
returned from get_transaction
.
Disassociates one or more tags from a specific transaction. Tags that
are not associated are silently ignored. The associated tags, along
with this request URL, are also exposed via the tags relationship on
the transaction resource returned from get_transaction
.
Source§impl Client
impl Client
Sourcepub async fn list_transactions<Tz: TimeZone>(
&self,
options: &ListTransactionsOptions<Tz>,
) -> Result<ListTransactionsResponse, Error>
pub async fn list_transactions<Tz: TimeZone>( &self, options: &ListTransactionsOptions<Tz>, ) -> Result<ListTransactionsResponse, Error>
Retrieve a list of all transactions across all accounts for the
currently authenticated user. The returned list is paginated and can be
scrolled by following the next
and prev
links where present. To
narrow the results to a specific date range pass one or both of
filter[since]
and filter[until]
in the query string. These filter
parameters should not be used for pagination. Results are ordered newest
first to oldest last.
Sourcepub async fn get_transaction(
&self,
id: &String,
) -> Result<GetTransactionResponse, Error>
pub async fn get_transaction( &self, id: &String, ) -> Result<GetTransactionResponse, Error>
Retrieve a specific transaction by providing its unique identifier.
Sourcepub async fn list_transactions_by_account<Tz: TimeZone>(
&self,
account_id: &String,
options: &ListTransactionsOptions<Tz>,
) -> Result<ListTransactionsResponse, Error>
pub async fn list_transactions_by_account<Tz: TimeZone>( &self, account_id: &String, options: &ListTransactionsOptions<Tz>, ) -> Result<ListTransactionsResponse, Error>
Retrieve a list of all transactions for a specific account. The returned
list is paginated and can be scrolled by following the next
and prev
links where present. To narrow the results to a specific date range pass
one or both of filter[since]
and filter[until]
in the query string.
These filter parameters should not be used for pagination. Results are
ordered newest first to oldest last.
Source§impl Client
impl Client
Sourcepub async fn ping(&self) -> Result<PingResponse, Error>
pub async fn ping(&self) -> Result<PingResponse, Error>
Make a basic ping request to the API. This is useful to verify that authentication is functioning correctly.
Source§impl Client
impl Client
Sourcepub async fn list_webhooks(
&self,
options: &ListWebhooksOptions,
) -> Result<ListWebhooksResponse, Error>
pub async fn list_webhooks( &self, options: &ListWebhooksOptions, ) -> Result<ListWebhooksResponse, Error>
Retrieve a list of configured webhooks. The returned list is paginated
and can be scrolled by following the next
and prev
links where
present. Results are ordered oldest first to newest last.
Sourcepub async fn get_webhook(&self, id: &str) -> Result<GetWebhookResponse, Error>
pub async fn get_webhook(&self, id: &str) -> Result<GetWebhookResponse, Error>
Retrieve a specific webhook by providing its unique identifier.
Sourcepub async fn create_webhook(
&self,
webhook_url: &str,
description: Option<String>,
) -> Result<CreateWebhookResponse, Error>
pub async fn create_webhook( &self, webhook_url: &str, description: Option<String>, ) -> Result<CreateWebhookResponse, Error>
Create a new webhook with a given URL. The URL will receive webhook
events as JSON-encoded POST
requests. The URL must respond with a
HTTP 200
status on success.
There is currently a limit of 10 webhooks at any given time. Once this limit is reached, existing webhooks will need to be deleted before new webhooks can be created.
Event delivery is retried with exponential backoff if the URL is
unreachable or it does not respond with a 200
status. The response
includes a secretKey
attribute, which is used to sign requests sent
to the webhook URL. It will not be returned from any other endpoints
within the Up API. If the secretKey
is lost, simply create a new
webhook with the same URL, capture its secretKey
and then delete the
original webhook. See Handling webhook events for details on how to
process webhook events.
It is probably a good idea to test the webhook by sending it a PING
event after creating it.
Sourcepub async fn delete_webhook(&self, id: &str) -> Result<(), Error>
pub async fn delete_webhook(&self, id: &str) -> Result<(), Error>
Delete a specific webhook by providing its unique identifier. Once deleted, webhook events will no longer be sent to the configured URL.
Sourcepub async fn ping_webhook(&self, id: &str) -> Result<PingWebhookResponse, Error>
pub async fn ping_webhook(&self, id: &str) -> Result<PingWebhookResponse, Error>
Send a PING
event to a webhook by providing its unique identifier.
This is useful for testing and debugging purposes. The event is
delivered asynchronously and its data is returned in the response to
this request.
Sourcepub async fn list_webhook_logs(
&self,
id: &str,
options: &ListWebhookLogsOptions,
) -> Result<ListWebhookLogsResponse, Error>
pub async fn list_webhook_logs( &self, id: &str, options: &ListWebhookLogsOptions, ) -> Result<ListWebhookLogsResponse, Error>
Retrieve a list of delivery logs for a webhook by providing its unique
identifier. This is useful for analysis and debugging purposes. The
returned list is paginated and can be scrolled by following the next
and prev
links where present. Results are ordered newest first to
oldest last. Logs may be automatically purged after a period of time.