Skip to main content

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 * Contact: devrel@onesignal.com
7 * Generated by: https://openapi-generator.tech
8 */
9
10
11use reqwest;
12
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    pub organization_api_key_token: Option<String>,
24    pub rest_api_key_token: Option<String>,
25    // TODO: take an oauth2 token source, similar to the go one
26}
27
28pub type BasicAuth = (String, Option<String>);
29
30#[derive(Debug, Clone)]
31pub struct ApiKey {
32    pub prefix: Option<String>,
33    pub key: String,
34}
35
36
37impl Configuration {
38    pub fn new() -> Configuration {
39        Configuration::default()
40    }
41}
42
43impl Default for Configuration {
44    fn default() -> Self {
45        Configuration {
46            base_path: "https://api.onesignal.com".to_owned(),
47            user_agent: Some("OpenAPI-Generator/5.13.0/rust".to_owned()),
48            client: reqwest::Client::new(),
49            basic_auth: None,
50            oauth_access_token: None,
51            bearer_access_token: None,
52            api_key: None,
53            organization_api_key_token: None,
54            rest_api_key_token: None,
55
56        }
57    }
58}