[][src]Struct aiven_rs::billing::ProjectBillingApi

pub struct ProjectBillingApi { /* fields omitted */ }

Methods

impl ProjectBillingApi[src]

pub async fn claim_credit_code<'_, '_, '_>(
    &'_ self,
    project: &'_ str,
    code: &'_ str
) -> Result<ResCredit, AivenError>
[src]

Claim a credit code

https://api.aiven.io/doc/#api-Project_Billing-ProjectCreditsClaim

Arguments

  • project - Project name
  • code - Credit code

Examples

Basic usage:

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let project_billing = client.project_billing();
let response = project_billing.claim_credit_code("project", "code").await?;
Ok(())
}

pub async fn download_pdf_invoice<'_, '_, '_, '_>(
    &'_ self,
    project: &'_ str,
    invoice_number: &'_ str,
    download_cookie: &'_ str
) -> Result<Bytes, AivenError>
[src]

Download PDF invoice

https://api.aiven.io/doc/#api-Project_Billing-ProjectInvoiceGet

Arguments

  • project - Project name
  • invoice_number - Credit code
  • download_cookie - Authentication cookie for invoice download

Examples

Basic usage:

use std::{fs::File, io::prelude::*};
#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let project_billing = client.project_billing();
let response = project_billing
  .download_pdf_invoice("project", "invoice", "download-cookie")
  .await?;
let mut file = File::create("foo.pdf")?;
file.write_all(&response[..])?;
Ok(())
}

pub async fn list_project_credits<'_, '_>(
    &'_ self,
    project: &'_ str
) -> Result<Credits, AivenError>
[src]

List project credits

https://api.aiven.io/doc/#api-Project_Billing-ProjectCreditsList

Arguments

  • project - Project name

Examples

Basic usage:

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let project_billing = client.project_billing();
let response = project_billing.list_project_credits("project").await?;
Ok(())
}

pub async fn list_project_invoices<'_, '_>(
    &'_ self,
    project: &'_ str
) -> Result<Invoices, AivenError>
[src]

List project invoices

https://api.aiven.io/doc/#api-Project_Billing-ProjectInvoiceList

Arguments

  • project - Project name

Examples

Basic usage:

#[tokio::main]
async fn main()-> Result<(), Box<dyn std::error::Error>>{
let client = aiven_rs::AivenClient::from_token("https://api.aiven.io", "v1", "aiven-token");
let project_billing = client.project_billing();
let response = project_billing.list_project_invoices("project").await?;
Ok(())
}

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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<V, T> VZip<V> for T where
    V: MultiLane<T>,