onesignal_rust_api/apis/
configuration.rs

1/*
2 * OneSignal
3 *
4 * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5 *
6 * The version of the OpenAPI document: 1.4.1
7 * Contact: devrel@onesignal.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13
14
15#[derive(Debug, Clone)]
16pub struct Configuration {
17    pub base_path: String,
18    pub user_agent: Option<String>,
19    pub client: reqwest::Client,
20    pub basic_auth: Option<BasicAuth>,
21    pub oauth_access_token: Option<String>,
22    pub bearer_access_token: Option<String>,
23    pub api_key: Option<ApiKey>,
24    pub app_key_token: Option<String>,
25    pub user_key_token: Option<String>,
26    // TODO: take an oauth2 token source, similar to the go one
27}
28
29pub type BasicAuth = (String, Option<String>);
30
31#[derive(Debug, Clone)]
32pub struct ApiKey {
33    pub prefix: Option<String>,
34    pub key: String,
35}
36
37
38impl Configuration {
39    pub fn new() -> Configuration {
40        Configuration::default()
41    }
42}
43
44impl Default for Configuration {
45    fn default() -> Self {
46        Configuration {
47            base_path: "https://api.onesignal.com".to_owned(),
48            user_agent: Some("OpenAPI-Generator/1.4.1/rust".to_owned()),
49            client: reqwest::Client::new(),
50            basic_auth: None,
51            oauth_access_token: None,
52            bearer_access_token: None,
53            api_key: None,
54            app_key_token: None,
55            user_key_token: None,
56
57        }
58    }
59}