[][src]Struct monzo_lib::Client

pub struct Client { /* fields omitted */ }

Monzo Client

Methods

impl Client[src]

pub fn new(access_token: impl Into<String>) -> Self[src]

Returns a new Monzo Client.

For more fine-grained control over the client configuration, see the builder API.

pub fn builder() -> ClientBuilder[src]

return a ClientBuilder for configuring a new Client

The builder API can be used for more fine-grained control over the configuration of the client.

Example

use monzo_lib::Client;
#[tokio::main]
    let client = Client::builder()
       .access_token("ACCESS_TOKEN")
       .refresh_token("REFRESH_TOKEN")
       .build();

pub async fn accounts<'_>(&'_ self) -> Result<Accounts>[src]

Return a list of bank accounts associated with the Monzo account

Example

#[tokio::main]
   let accounts = client.accounts().await?;

pub async fn balance<'_>(
    &'_ self,
    account_id: impl AsRef<str>
) -> Result<Balance>
[src]

Return the balance of a given account

Example

#[tokio::main]
   let account_balance = client.balance("ACCOUNT_ID").await?;

pub async fn pots<'_>(&'_ self) -> Result<Pots>[src]

Return a list of Pots

Example

#[tokio::main]
   let pots = client.pots().await?;

Auto Trait Implementations

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

impl !RefUnwindSafe for Client

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]