langgraph_api/generated/apis/
configuration.rs

1/*
2 * LangSmith Deployment
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 0.1.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12use typed_builder::TypedBuilder;
13
14#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, typed_builder::TypedBuilder)]
15pub struct Configuration {
16    #[serde(default = "default_base_path")]
17    #[builder(default_code = "default_base_path()")]
18    pub base_path: String,
19    #[serde(default = "default_user_agent")]
20    #[builder(default_code = "default_user_agent()")]
21    pub user_agent: Option<String>,
22    #[serde(skip_serializing, skip_deserializing)]
23    #[builder(default_code = "default_client()")]
24    pub client: reqwest::Client,
25    #[serde(default)]
26    #[builder(default)]
27    pub basic_auth: Option<BasicAuth>,
28    #[serde(default)]
29    #[builder(default)]
30    pub oauth_access_token: Option<String>,
31    #[serde(default)]
32    #[builder(default)]
33    pub bearer_access_token: Option<String>,
34    #[serde(default)]
35    #[builder(default)]
36    pub api_key: Option<ApiKey>,
37}
38
39pub type BasicAuth = (String, Option<String>);
40
41#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, typed_builder::TypedBuilder)]
42pub struct ApiKey {
43    #[serde(default)]
44    #[builder(default)]
45    pub prefix: Option<String>,
46    pub key: String,
47}
48
49fn default_base_path() -> String {
50    "http://localhost:8444".to_owned()
51}
52
53fn default_user_agent() -> Option<String> {
54    Some(format!(
55        "{}-rust/{}",
56        env!("CARGO_PKG_NAME"),
57        env!("CARGO_PKG_VERSION")
58    ))
59}
60
61fn default_client() -> reqwest::Client {
62    reqwest::Client::new()
63}
64
65impl Configuration {
66    pub fn new() -> Configuration {
67        Configuration::default()
68    }
69}
70
71impl Default for Configuration {
72    fn default() -> Self {
73        Configuration {
74            base_path: default_base_path(),
75            user_agent: default_user_agent(),
76            client: default_client(),
77            basic_auth: None,
78            oauth_access_token: None,
79            bearer_access_token: None,
80            api_key: None,
81        }
82    }
83}