Skip to main content

WaveClient

Struct WaveClient 

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

Client for the Wave Accounting GraphQL API.

Implementations§

Source§

impl WaveClient

Source

pub fn with_oauth(config: OAuthConfig) -> Self

Create a new client with OAuth credentials.

Source§

impl WaveClient

Source

pub async fn create_customer( &self, input: CustomerCreateInput, ) -> Result<Customer, WaveError>

Create a customer.

Source

pub async fn patch_customer( &self, input: CustomerPatchInput, ) -> Result<Customer, WaveError>

Patch a customer.

Source

pub async fn delete_customer( &self, input: CustomerDeleteInput, ) -> Result<(), WaveError>

Delete a customer.

Source

pub async fn create_invoice( &self, input: InvoiceCreateInput, ) -> Result<Invoice, WaveError>

Create an invoice.

Source

pub async fn patch_invoice( &self, input: InvoicePatchInput, ) -> Result<Invoice, WaveError>

Patch an invoice.

Source

pub async fn delete_invoice(&self, invoice_id: &str) -> Result<(), WaveError>

Delete an invoice.

Source

pub async fn clone_invoice( &self, invoice_id: &str, ) -> Result<Invoice, WaveError>

Clone an invoice.

Source

pub async fn approve_invoice( &self, invoice_id: &str, ) -> Result<Invoice, WaveError>

Approve an invoice.

Source

pub async fn mark_invoice_sent( &self, input: InvoiceMarkSentInput, ) -> Result<Invoice, WaveError>

Mark an invoice as sent.

Source

pub async fn send_invoice( &self, input: InvoiceSendInput, ) -> Result<Invoice, WaveError>

Send an invoice via email.

Source

pub async fn create_account( &self, input: AccountCreateInput, ) -> Result<Account, WaveError>

Create an account.

Source

pub async fn patch_account( &self, input: AccountPatchInput, ) -> Result<Account, WaveError>

Patch an account.

Source

pub async fn archive_account( &self, input: AccountArchiveInput, ) -> Result<(), WaveError>

Archive an account.

Source

pub async fn create_product( &self, input: ProductCreateInput, ) -> Result<Product, WaveError>

Create a product.

Source

pub async fn patch_product( &self, input: ProductPatchInput, ) -> Result<Product, WaveError>

Patch a product.

Source

pub async fn archive_product( &self, input: ProductArchiveInput, ) -> Result<(), WaveError>

Archive a product.

Source

pub async fn create_sales_tax( &self, input: SalesTaxCreateInput, ) -> Result<SalesTax, WaveError>

Create a sales tax.

Source

pub async fn patch_sales_tax( &self, input: SalesTaxPatchInput, ) -> Result<SalesTax, WaveError>

Patch a sales tax.

Source

pub async fn archive_sales_tax( &self, input: SalesTaxArchiveInput, ) -> Result<(), WaveError>

Archive a sales tax.

Source

pub async fn create_money_transaction( &self, input: MoneyTransactionCreateInput, ) -> Result<Transaction, WaveError>

Create a single money transaction.

Source

pub async fn create_money_transactions( &self, input: MoneyTransactionsCreateInput, ) -> Result<Vec<Transaction>, WaveError>

Bulk create money transactions.

Source§

impl WaveClient

Source

pub async fn get_user(&self) -> Result<User, WaveError>

Get the currently authenticated user.

Source

pub async fn list_businesses( &self, opts: ListBusinessesOptions, ) -> Result<Page<Business>, WaveError>

List all businesses accessible to the authenticated user.

Source

pub async fn get_business(&self, id: &str) -> Result<Business, WaveError>

Get a single business by ID.

Source

pub async fn list_customers( &self, business_id: &str, opts: ListCustomersOptions, ) -> Result<Page<Customer>, WaveError>

List customers for a business.

Source

pub async fn get_customer( &self, business_id: &str, customer_id: &str, ) -> Result<Customer, WaveError>

Get a single customer by ID.

Source

pub async fn list_invoices( &self, business_id: &str, opts: ListInvoicesOptions, ) -> Result<Page<Invoice>, WaveError>

List invoices for a business.

Source

pub async fn get_invoice( &self, business_id: &str, invoice_id: &str, ) -> Result<Invoice, WaveError>

Get a single invoice by ID.

Source

pub async fn list_accounts( &self, business_id: &str, opts: ListAccountsOptions, ) -> Result<Page<Account>, WaveError>

List accounts (Chart of Accounts) for a business.

Source

pub async fn get_account( &self, business_id: &str, account_id: &str, ) -> Result<Account, WaveError>

Get a single account by ID.

Source

pub async fn list_products( &self, business_id: &str, opts: ListProductsOptions, ) -> Result<Page<Product>, WaveError>

List products for a business.

Source

pub async fn get_product( &self, business_id: &str, product_id: &str, ) -> Result<Product, WaveError>

Get a single product by ID.

Source

pub async fn list_vendors( &self, business_id: &str, opts: ListVendorsOptions, ) -> Result<Page<Vendor>, WaveError>

List vendors for a business.

Source

pub async fn get_vendor( &self, business_id: &str, vendor_id: &str, ) -> Result<Vendor, WaveError>

Get a single vendor by ID.

Source

pub async fn list_sales_taxes( &self, business_id: &str, opts: ListSalesTaxesOptions, ) -> Result<Page<SalesTax>, WaveError>

List sales taxes for a business.

Source

pub async fn get_sales_tax( &self, business_id: &str, sales_tax_id: &str, ) -> Result<SalesTax, WaveError>

Get a single sales tax by ID.

Source

pub async fn list_currencies(&self) -> Result<Vec<Currency>, WaveError>

List all currencies.

Source

pub async fn list_countries(&self) -> Result<Vec<Country>, WaveError>

List all countries.

Source

pub async fn list_account_types(&self) -> Result<Vec<AccountType>, WaveError>

List account types.

Source

pub async fn list_account_subtypes( &self, ) -> Result<Vec<AccountSubtype>, WaveError>

List account subtypes.

Trait Implementations§

Source§

impl Clone for WaveClient

Source§

fn clone(&self) -> WaveClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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