typesense_codegen 0.30.0

Types for typesense generated with openapi spec
Documentation
/*
 * Typesense API
 *
 * An open source search engine for building delightful search experiences.
 *
 * The version of the OpenAPI document: 28.0
 *
 * Generated by: https://openapi-generator.tech
 */
// This file was added to .openapi-generator-ignore so we can freely modify it.

#[cfg(target_arch = "wasm32")]
pub type HttpClient = reqwest::Client;

#[cfg(not(target_arch = "wasm32"))]
pub type HttpClient = reqwest_middleware::ClientWithMiddleware;

#[derive(Debug, Clone)]
pub struct Configuration {
    pub base_path: String,
    pub user_agent: Option<String>,
    pub client: HttpClient,
    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(Debug, Clone)]
pub struct ApiKey {
    pub prefix: Option<String>,
    pub key: String,
}

impl Configuration {
    #[inline]
    pub fn new() -> Configuration {
        Configuration::default()
    }
}

impl Default for Configuration {
    #[inline]
    fn default() -> Self {
        #[cfg(target_arch = "wasm32")]
        let client = reqwest::Client::new();

        #[cfg(not(target_arch = "wasm32"))]
        let client = reqwest_middleware::ClientBuilder::new(reqwest::Client::new()).build();
        Configuration {
            base_path: "http://localhost".to_owned(),
            user_agent: Some("OpenAPI-Generator/30.0/rust".to_owned()),
            client,
            basic_auth: None,
            oauth_access_token: None,
            bearer_access_token: None,
            api_key: None,
        }
    }
}