webhook_line/apis/
dummy_api.rs

1/*
2 * Webhook Type Definition
3 *
4 * Webhook event definition of the LINE Messaging API
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use std::sync::Arc;
12use std::borrow::Borrow;
13use std::pin::Pin;
14#[allow(unused_imports)]
15use std::option::Option;
16
17use hyper;
18use hyper_util::client::legacy::connect::Connect;
19use futures::Future;
20
21use crate::models;
22use super::{Error, configuration};
23use super::request as __internal_request;
24
25pub struct DummyApiClient<C: Connect>
26    where C: Clone + std::marker::Send + Sync + 'static {
27    configuration: Arc<configuration::Configuration<C>>,
28}
29
30impl<C: Connect> DummyApiClient<C>
31    where C: Clone + std::marker::Send + Sync {
32    pub fn new(configuration: Arc<configuration::Configuration<C>>) -> DummyApiClient<C> {
33        DummyApiClient {
34            configuration,
35        }
36    }
37}
38
39pub trait DummyApi: Send + Sync {
40    fn callback(&self, callback_request: models::CallbackRequest) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send>>;
41}
42
43impl<C: Connect>DummyApi for DummyApiClient<C>
44    where C: Clone + std::marker::Send + Sync {
45    #[allow(unused_mut)]
46    fn callback(&self, callback_request: models::CallbackRequest) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send>> {
47        let mut req = __internal_request::Request::new(hyper::Method::POST, "/callback".to_string())
48        ;
49        req = req.with_body_param(callback_request);
50
51        req.execute(self.configuration.borrow())
52    }
53
54}