pub struct Client { /* private fields */ }Expand description
An API client for Orb.
The API client is designed to be wrapped in an Arc and used from
multiple threads simultaneously.
Implementations§
Source§impl Client
impl Client
Sourcepub fn list_customers(
&self,
params: &ListParams,
) -> impl Stream<Item = Result<Customer, Error>> + '_
pub fn list_customers( &self, params: &ListParams, ) -> impl Stream<Item = Result<Customer, Error>> + '_
Lists all customers.
The underlying API call is paginated. The returned stream will fetch additional pages as it is consumed.
Sourcepub async fn create_customer(
&self,
customer: &CreateCustomerRequest<'_>,
) -> Result<Customer, Error>
pub async fn create_customer( &self, customer: &CreateCustomerRequest<'_>, ) -> Result<Customer, Error>
Creates a new customer.
Sourcepub async fn get_customer_by_external_id(
&self,
external_id: &str,
) -> Result<Customer, Error>
pub async fn get_customer_by_external_id( &self, external_id: &str, ) -> Result<Customer, Error>
Gets a customer by external ID.
Sourcepub async fn update_customer(
&self,
id: &str,
customer: &UpdateCustomerRequest<'_>,
) -> Result<Customer, Error>
pub async fn update_customer( &self, id: &str, customer: &UpdateCustomerRequest<'_>, ) -> Result<Customer, Error>
Updates a customer by ID.
Sourcepub async fn update_customer_by_external_id(
&self,
external_id: &str,
customer: &UpdateCustomerRequest<'_>,
) -> Result<Customer, Error>
pub async fn update_customer_by_external_id( &self, external_id: &str, customer: &UpdateCustomerRequest<'_>, ) -> Result<Customer, Error>
Updates a customer by external ID.
Sourcepub fn get_customer_credit_balance(
&self,
id: &str,
params: &ListParams,
) -> impl Stream<Item = Result<CustomerCreditBlock, Error>> + '_
pub fn get_customer_credit_balance( &self, id: &str, params: &ListParams, ) -> impl Stream<Item = Result<CustomerCreditBlock, Error>> + '_
Fetch all unexpired, non-zero credit blocks for a customer.
The underlying API call is paginated. The returned stream will fetch additional pages as it is consumed.
Sourcepub fn get_customer_credit_balance_by_external_id(
&self,
external_id: &str,
params: &ListParams,
) -> impl Stream<Item = Result<CustomerCreditBlock, Error>> + '_
pub fn get_customer_credit_balance_by_external_id( &self, external_id: &str, params: &ListParams, ) -> impl Stream<Item = Result<CustomerCreditBlock, Error>> + '_
Fetch all unexpired, non-zero credit blocks for a customer by external ID.
The underlying API call is paginated. The returned stream will fetch additional pages as it is consumed.
Sourcepub async fn create_ledger_entry(
&self,
id: &str,
entry: &LedgerEntryRequest<'_>,
) -> Result<LedgerEntry, Error>
pub async fn create_ledger_entry( &self, id: &str, entry: &LedgerEntryRequest<'_>, ) -> Result<LedgerEntry, Error>
Create a new ledger entry for the specified customer’s balance.
Sourcepub async fn get_customer_costs(
&self,
id: &str,
params: &CustomerCostParams<'_>,
) -> Result<Vec<CustomerCostBucket>, Error>
pub async fn get_customer_costs( &self, id: &str, params: &CustomerCostParams<'_>, ) -> Result<Vec<CustomerCostBucket>, Error>
Fetch a day-by-day snapshot of a customer’s costs.
Sourcepub async fn get_customer_costs_by_external_id(
&self,
external_id: &str,
params: &CustomerCostParams<'_>,
) -> Result<Vec<CustomerCostBucket>, Error>
pub async fn get_customer_costs_by_external_id( &self, external_id: &str, params: &CustomerCostParams<'_>, ) -> Result<Vec<CustomerCostBucket>, Error>
Fetch a day-by-day snapshot of a customer’s costs by their external ID.
Source§impl Client
impl Client
Sourcepub fn search_events(
&self,
params: &EventSearchParams<'_>,
) -> impl Stream<Item = Result<Event, Error>> + '_
pub fn search_events( &self, params: &EventSearchParams<'_>, ) -> impl Stream<Item = Result<Event, Error>> + '_
Searches events.
Sourcepub async fn ingest_events(
&self,
mode: IngestionMode,
events: &[IngestEventRequest<'_>],
) -> Result<IngestEventResponse, Error>
pub async fn ingest_events( &self, mode: IngestionMode, events: &[IngestEventRequest<'_>], ) -> Result<IngestEventResponse, Error>
Ingests events.
Sourcepub async fn amend_event(
&self,
id: &str,
event: &AmendEventRequest<'_>,
) -> Result<(), Error>
pub async fn amend_event( &self, id: &str, event: &AmendEventRequest<'_>, ) -> Result<(), Error>
Amends an event by ID.
Source§impl Client
impl Client
Sourcepub fn list_invoices(
&self,
params: &InvoiceListParams<'_>,
) -> impl Stream<Item = Result<Invoice, Error>> + '_
pub fn list_invoices( &self, params: &InvoiceListParams<'_>, ) -> impl Stream<Item = Result<Invoice, Error>> + '_
Lists invoices as configured by params.
The underlying API call is paginated. The returned stream will fetch additional pages as it is consumed.
Source§impl Client
impl Client
Sourcepub fn list_plans(
&self,
params: &ListParams,
) -> impl Stream<Item = Result<Plan, Error>> + '_
pub fn list_plans( &self, params: &ListParams, ) -> impl Stream<Item = Result<Plan, Error>> + '_
Lists all plans.
The underlying API call is paginated. The returned stream will fetch additional pages as it is consumed.
Source§impl Client
impl Client
Sourcepub fn list_subscriptions(
&self,
params: &SubscriptionListParams<'_>,
) -> impl Stream<Item = Result<Subscription, Error>> + '_
pub fn list_subscriptions( &self, params: &SubscriptionListParams<'_>, ) -> impl Stream<Item = Result<Subscription, Error>> + '_
Lists subscriptions as configured by params.
The underlying API call is paginated. The returned stream will fetch additional pages as it is consumed.
Sourcepub async fn create_subscription(
&self,
subscription: &CreateSubscriptionRequest<'_>,
) -> Result<Subscription, Error>
pub async fn create_subscription( &self, subscription: &CreateSubscriptionRequest<'_>, ) -> Result<Subscription, Error>
Creates a new subscription.
Sourcepub async fn get_subscription(&self, id: &str) -> Result<Subscription, Error>
pub async fn get_subscription(&self, id: &str) -> Result<Subscription, Error>
Gets a subscription by ID.
Source§impl Client
impl Client
Sourcepub fn new(config: ClientConfig) -> Client
pub fn new(config: ClientConfig) -> Client
Creates a new Client from its required configuration parameters.
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Creates a builder for a Client that allows for customization of
optional parameters.