Struct Client

Source
pub struct Client { /* private fields */ }
Expand description

A client for interacting with the Up API.

Implementations§

Source§

impl Client

Source

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.

Source

pub async fn get_account(&self, id: &str) -> Result<GetAccountResponse, Error>

Retrieve a specific account by providing its unique identifier.

Source§

impl Client

Source

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.

Source

pub async fn get_category(&self, id: &str) -> Result<GetCategoryResponse, Error>

Retrieve a specific category by providing its unique identifier.

Source

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

Source

pub async fn list_tags( &self, options: &ListTagsOptions, ) -> Result<ListTagsResponse, Error>

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.

Source

pub async fn add_tags( &self, transaction_id: &str, tags: Vec<String>, ) -> Result<(), Error>

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.

Source

pub async fn delete_tags( &self, transaction_id: &str, tags: Vec<String>, ) -> Result<(), Error>

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

Source

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.

Source

pub async fn get_transaction( &self, id: &String, ) -> Result<GetTransactionResponse, Error>

Retrieve a specific transaction by providing its unique identifier.

Source

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

Source

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

Source

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.

Source

pub async fn get_webhook(&self, id: &str) -> Result<GetWebhookResponse, Error>

Retrieve a specific webhook by providing its unique identifier.

Source

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.

Source

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.

Source

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.

Source

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.

Source§

impl Client

Source

pub fn new(access_token: String) -> Self

Creates an instance of the Client from the access token. Visit this page to get such a token.

Auto Trait Implementations§

§

impl Freeze for Client

§

impl RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl UnwindSafe for Client

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,