line_messaging_api/apis/
configuration.rs

1/*
2* Copyright (C) 2016 LINE Corp.
3*
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at
7*
8*     http://www.apache.org/licenses/LICENSE-2.0
9*
10* Unless required by applicable law or agreed to in writing, software
11* distributed under the License is distributed on an "AS IS" BASIS,
12* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13* See the License for the specific language governing permissions and
14* limitations under the License.
15*/
16
17/*
18 * LINE Messaging API
19 *
20 * This document describes LINE Messaging API.
21 *
22 * The version of the OpenAPI document: 0.0.3
23 *
24 * Generated by: https://openapi-generator.tech
25 */
26
27use hyper;
28
29pub struct Configuration<C: hyper::client::connect::Connect>
30where
31    C: Clone + std::marker::Send + Sync + 'static,
32{
33    pub base_path: String,
34    pub user_agent: Option<String>,
35    pub client: hyper::client::Client<C>,
36    pub basic_auth: Option<BasicAuth>,
37    pub oauth_access_token: Option<String>,
38    pub api_key: Option<ApiKey>,
39    // TODO: take an oauth2 token source, similar to the go one
40}
41
42pub type BasicAuth = (String, Option<String>);
43
44pub struct ApiKey {
45    pub prefix: Option<String>,
46    pub key: String,
47}
48
49impl<C: hyper::client::connect::Connect> Configuration<C>
50where
51    C: Clone + std::marker::Send + Sync,
52{
53    pub fn new(client: hyper::client::Client<C>) -> Configuration<C> {
54        Configuration {
55            base_path: "https://api.line.me".to_owned(),
56            user_agent: Some("LINE-Bot-SDK-Rust/1".to_owned()),
57            client,
58            basic_auth: None,
59            oauth_access_token: None,
60            api_key: None,
61        }
62    }
63}