sendinblue_v3/apis/configuration.rs
1/*
2 * SendinBlue API
3 *
4 * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
5 *
6 * The version of the OpenAPI document: 3.0.0
7 * Contact: contact@sendinblue.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use reqwest;
12
13#[derive(Debug, Clone)]
14pub struct Configuration {
15 pub base_path: String,
16 pub user_agent: Option<String>,
17 pub client: reqwest::Client,
18 pub basic_auth: Option<BasicAuth>,
19 pub oauth_access_token: Option<String>,
20 pub bearer_access_token: Option<String>,
21 pub api_key: Option<ApiKey>,
22 // TODO: take an oauth2 token source, similar to the go one
23}
24
25pub type BasicAuth = (String, Option<String>);
26
27#[derive(Debug, Clone)]
28pub struct ApiKey {
29 pub prefix: Option<String>,
30 pub key: String,
31}
32
33impl Configuration {
34 pub fn new() -> Configuration {
35 Configuration::default()
36 }
37}
38
39impl Default for Configuration {
40 fn default() -> Self {
41 let client = reqwest::Client::builder()
42 .use_rustls_tls()
43 .hickory_dns(true)
44 .build()
45 .expect("valid client");
46
47 Configuration {
48 base_path: "https://api.sendinblue.com/v3".to_owned(),
49 user_agent: Some("OpenAPI-Generator/3.0.0/rust".to_owned()),
50 client,
51 basic_auth: None,
52 oauth_access_token: None,
53 bearer_access_token: None,
54 api_key: None,
55 }
56 }
57}