/*
* Open Logistics — Shiprocket
*
* OpenAPI description of the Shiprocket endpoints wrapped by `open-logistics`. Source of truth for generated Python and Rust clients. Operation IDs and schema field names are intentionally snake_case so every language exposes the same names. Two TypeScript methods (`checkServiceability` and `calculateRates`) call `GET /courier/serviceability`; OpenAPI permits one operation per path + method, so this spec exposes a single `courier_serviceability` operation. Language facades may alias it as `calculate_rates`.
*
* The version of the OpenAPI document: 0.3.0
*
* Generated by: https://openapi-generator.tech
*/
pub use reqwest::Client;
#[derive(Clone)]
pub struct Configuration {
pub base_path: String,
pub user_agent: Option<String>,
pub client: reqwest::Client,
pub basic_auth: Option<BasicAuth>,
pub oauth_access_token: Option<String>,
pub bearer_access_token: Option<String>,
pub api_key: Option<ApiKey>,
}
pub type BasicAuth = (String, Option<String>);
#[derive(Clone)]
pub struct ApiKey {
pub prefix: Option<String>,
pub key: String,
}
impl std::fmt::Debug for ApiKey {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("ApiKey")
.field("prefix", &self.prefix)
.field("key", &"[REDACTED]")
.finish()
}
}
impl std::fmt::Debug for Configuration {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut debug = f.debug_struct("Configuration");
debug
.field("base_path", &self.base_path)
.field("user_agent", &self.user_agent)
.field("client", &self.client);
debug
.field("basic_auth", &self.basic_auth.as_ref().map(|(username, password)| (username, password.as_ref().map(|_| "[REDACTED]"))))
.field("oauth_access_token", &self.oauth_access_token.as_ref().map(|_| "[REDACTED]"))
.field("bearer_access_token", &self.bearer_access_token.as_ref().map(|_| "[REDACTED]"))
.field("api_key", &self.api_key);
debug.finish()
}
}
impl Configuration {
pub fn new() -> Configuration {
Configuration::default()
}
}
impl Default for Configuration {
fn default() -> Self {
Configuration {
base_path: "https://apiv2.shiprocket.in/v1/external".to_owned(),
user_agent: Some("OpenAPI-Generator/0.3.0/rust".to_owned()),
client: reqwest::Client::new(),
basic_auth: None,
oauth_access_token: None,
bearer_access_token: None,
api_key: None,
}
}
}