netlify_rust/apis/
configuration.rs

1/*
2 * Netlify's API documentation
3 *
4 * Netlify is a hosting service for the programmable web. It understands your documents and provides an API to handle atomic deploys of websites, manage form submissions, inject JavaScript snippets, and much more. This is a REST-style API that uses JSON for serialization and OAuth 2 for authentication.  This document is an OpenAPI reference for the Netlify API that you can explore. For more detailed instructions for common uses, please visit the [online documentation](https://www.netlify.com/docs/api/). Visit our Community forum to join the conversation about [understanding and using Netlify’s API](https://community.netlify.com/t/common-issue-understanding-and-using-netlifys-api/160).  Additionally, we have two API clients for your convenience: - [Go Client](https://github.com/netlify/open-api#go-client) - [JS Client](https://github.com/netlify/js-client)
5 *
6 * The version of the OpenAPI document: 2.5.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13
14#[derive(Debug, Clone)]
15pub struct Configuration {
16    pub base_path: String,
17    pub user_agent: Option<String>,
18    pub client: reqwest::Client,
19    pub basic_auth: Option<BasicAuth>,
20    pub oauth_access_token: Option<String>,
21    pub bearer_access_token: Option<String>,
22    pub api_key: Option<ApiKey>,
23    // TODO: take an oauth2 token source, similar to the go one
24}
25
26pub type BasicAuth = (String, Option<String>);
27
28#[derive(Debug, Clone)]
29pub struct ApiKey {
30    pub prefix: Option<String>,
31    pub key: String,
32}
33
34impl Configuration {
35    pub fn new() -> Configuration {
36        Configuration::default()
37    }
38}
39
40impl Default for Configuration {
41    fn default() -> Self {
42        Configuration {
43            base_path: "https://api.netlify.com/api/v1".to_owned(),
44            user_agent: Some("OpenAPI-Generator/2.5.0/rust".to_owned()),
45            client: reqwest::Client::new(),
46            basic_auth: None,
47            oauth_access_token: None,
48            bearer_access_token: None,
49            api_key: None,
50        }
51    }
52}