cnb 0.2.0

CNB (cnb.cool) API client for Rust — typed, async, production-ready
Documentation
// @generated DO NOT EDIT.
//
// Generated from the CNB OpenAPI specification by `cnb-codegen`.
// Run `cargo run -p cnb-codegen --manifest-path codegen/Cargo.toml \
//      -- --spec codegen/spec/swagger.json --out src` to refresh.

#![allow(clippy::all)]
#![allow(missing_docs)]
#![allow(unused_imports)]
#![allow(unused_mut)]

use reqwest::Method;
use serde::Serialize;

use crate::error::{ApiError, Result};
use crate::http::HttpInner;
use crate::models;

// `Charge` resource client (generated, 1 operations).

/// Resource client.
#[derive(Debug, Clone)]
pub struct ChargeClient {
    inner: HttpInner,
}

impl ChargeClient {
    /// Construct a new resource client. Normally obtained
    /// via [`crate::ApiClient`] rather than directly.
    pub fn new(inner: HttpInner) -> Self {
        Self { inner }
    }

    /// 查看特权额度
    ///
    /// `GET /{slug}/-/charge/special-amount`
    pub async fn get_special_amount(&self, slug: String) -> Result<crate::models::SpecialAmount> {
        let path = format!("/{}/-/charge/special-amount", slug);
        let mut url = self.inner.url(&path)?;
        self.inner
            .execute::<crate::models::SpecialAmount>(Method::GET, url)
            .await
    }
}