stcloud/apis/
configuration.rs

1/* 
2 * Sematext Cloud API
3 *
4 * API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`.
5 *
6 * OpenAPI spec version: v3
7 * 
8 * Generated by: https://github.com/swagger-api/swagger-codegen.git
9 */
10use hyper;
11use std::collections::HashMap;
12use hyper::{Body, Client};
13
14pub struct Configuration<C: hyper::client::connect::Connect + Clone + Send + Sync> {
15  pub base_path: String,
16  pub user_agent: Option<String>,
17  pub client: hyper::client::Client<C, Body>,
18  pub basic_auth: Option<BasicAuth>,
19  pub oauth_access_token: Option<String>,
20  pub api_key: Option<ApiKey>,
21  // TODO: take an oauth2 token source, similar to the go one
22}
23
24pub type BasicAuth = (String, Option<String>);
25
26pub struct ApiKey {
27  pub prefix: Option<String>,
28  pub key: String,
29}
30
31impl<C: hyper::client::connect::Connect + Clone + Send + Sync> Configuration<C> {
32  pub fn new(client: hyper::client::Client<C, Body>) -> Configuration<C> {
33    Configuration {
34      base_path: "/".to_owned(),
35      user_agent: Some("Swagger-Codegen/v3/rust".to_owned()),
36      client: client,
37      basic_auth: None,
38      oauth_access_token: None,
39      api_key: None,
40    }
41  }
42}