messaging_api_line/apis/
messaging_api_blob_api.rs1use 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 MessagingApiBlobApiClient<C: Connect>
26 where C: Clone + std::marker::Send + Sync + 'static {
27 configuration: Arc<configuration::Configuration<C>>,
28}
29
30impl<C: Connect> MessagingApiBlobApiClient<C>
31 where C: Clone + std::marker::Send + Sync {
32 pub fn new(configuration: Arc<configuration::Configuration<C>>) -> MessagingApiBlobApiClient<C> {
33 MessagingApiBlobApiClient {
34 configuration,
35 }
36 }
37}
38
39pub trait MessagingApiBlobApi: Send + Sync {
40 fn get_message_content(&self, message_id: &str) -> Pin<Box<dyn Future<Output = Result<std::path::PathBuf, Error>> + Send>>;
41 fn get_message_content_preview(&self, message_id: &str) -> Pin<Box<dyn Future<Output = Result<std::path::PathBuf, Error>> + Send>>;
42 fn get_message_content_transcoding_by_message_id(&self, message_id: &str) -> Pin<Box<dyn Future<Output = Result<models::GetMessageContentTranscodingResponse, Error>> + Send>>;
43 fn get_rich_menu_image(&self, rich_menu_id: &str) -> Pin<Box<dyn Future<Output = Result<std::path::PathBuf, Error>> + Send>>;
44 fn set_rich_menu_image(&self, rich_menu_id: &str, body: Option<std::path::PathBuf>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
45}
46
47impl<C: Connect>MessagingApiBlobApi for MessagingApiBlobApiClient<C>
48 where C: Clone + std::marker::Send + Sync {
49 #[allow(unused_mut)]
50 fn get_message_content(&self, message_id: &str) -> Pin<Box<dyn Future<Output = Result<std::path::PathBuf, Error>> + Send>> {
51 let mut req = __internal_request::Request::new(hyper::Method::GET, "/v2/bot/message/{messageId}/content".to_string())
52 ;
53 req = req.with_path_param("messageId".to_string(), message_id.to_string());
54
55 req.execute(self.configuration.borrow())
56 }
57
58 #[allow(unused_mut)]
59 fn get_message_content_preview(&self, message_id: &str) -> Pin<Box<dyn Future<Output = Result<std::path::PathBuf, Error>> + Send>> {
60 let mut req = __internal_request::Request::new(hyper::Method::GET, "/v2/bot/message/{messageId}/content/preview".to_string())
61 ;
62 req = req.with_path_param("messageId".to_string(), message_id.to_string());
63
64 req.execute(self.configuration.borrow())
65 }
66
67 #[allow(unused_mut)]
68 fn get_message_content_transcoding_by_message_id(&self, message_id: &str) -> Pin<Box<dyn Future<Output = Result<models::GetMessageContentTranscodingResponse, Error>> + Send>> {
69 let mut req = __internal_request::Request::new(hyper::Method::GET, "/v2/bot/message/{messageId}/content/transcoding".to_string())
70 ;
71 req = req.with_path_param("messageId".to_string(), message_id.to_string());
72
73 req.execute(self.configuration.borrow())
74 }
75
76 #[allow(unused_mut)]
77 fn get_rich_menu_image(&self, rich_menu_id: &str) -> Pin<Box<dyn Future<Output = Result<std::path::PathBuf, Error>> + Send>> {
78 let mut req = __internal_request::Request::new(hyper::Method::GET, "/v2/bot/richmenu/{richMenuId}/content".to_string())
79 ;
80 req = req.with_path_param("richMenuId".to_string(), rich_menu_id.to_string());
81
82 req.execute(self.configuration.borrow())
83 }
84
85 #[allow(unused_mut)]
86 fn set_rich_menu_image(&self, rich_menu_id: &str, body: Option<std::path::PathBuf>) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>> {
87 let mut req = __internal_request::Request::new(hyper::Method::POST, "/v2/bot/richmenu/{richMenuId}/content".to_string())
88 ;
89 req = req.with_path_param("richMenuId".to_string(), rich_menu_id.to_string());
90 req = req.with_body_param(body);
91 req = req.returns_nothing();
92
93 req.execute(self.configuration.borrow())
94 }
95
96}