use std::borrow::Borrow;
#[allow(unused_imports)]
use std::option::Option;
use std::sync::Arc;
use hyper;
use hyper_util::client::legacy::connect::Connect;
use super::request as __internal_request;
use super::{configuration, Error};
use crate::line_messaging_api::models;
#[derive(Clone)]
pub struct MessagingApiApiClient<C: Connect>
where
C: Clone + std::marker::Send + Sync + 'static,
{
configuration: Arc<configuration::Configuration<C>>,
}
impl<C: Connect> MessagingApiApiClient<C>
where
C: Clone + std::marker::Send + Sync,
{
pub fn new(configuration: Arc<configuration::Configuration<C>>) -> MessagingApiApiClient<C> {
MessagingApiApiClient { configuration }
}
}
pub trait MessagingApiApi: Send + Sync {
fn broadcast(
&self,
broadcast_request: models::BroadcastRequest,
x_line_retry_key: Option<&str>,
) -> impl std::future::Future<Output = Result<serde_json::Value, Error>> + Send;
fn cancel_default_rich_menu(
&self,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn close_coupon(
&self,
coupon_id: &str,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn create_coupon(
&self,
coupon_create_request: Option<models::CouponCreateRequest>,
) -> impl std::future::Future<Output = Result<models::CouponCreateResponse, Error>> + Send;
fn create_rich_menu(
&self,
rich_menu_request: models::RichMenuRequest,
) -> impl std::future::Future<Output = Result<models::RichMenuIdResponse, Error>> + Send;
fn create_rich_menu_alias(
&self,
create_rich_menu_alias_request: models::CreateRichMenuAliasRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn delete_rich_menu(
&self,
rich_menu_id: &str,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn delete_rich_menu_alias(
&self,
rich_menu_alias_id: &str,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn get_aggregation_unit_name_list(
&self,
limit: Option<&str>,
start: Option<&str>,
) -> impl std::future::Future<Output = Result<models::GetAggregationUnitNameListResponse, Error>>
+ Send;
fn get_aggregation_unit_usage(
&self,
) -> impl std::future::Future<Output = Result<models::GetAggregationUnitUsageResponse, Error>> + Send;
fn get_bot_info(
&self,
) -> impl std::future::Future<Output = Result<models::BotInfoResponse, Error>> + Send;
fn get_coupon_detail(
&self,
coupon_id: &str,
) -> impl std::future::Future<Output = Result<models::CouponResponse, Error>> + Send;
fn get_default_rich_menu_id(
&self,
) -> impl std::future::Future<Output = Result<models::RichMenuIdResponse, Error>> + Send;
fn get_followers(
&self,
start: Option<&str>,
limit: Option<i32>,
) -> impl std::future::Future<Output = Result<models::GetFollowersResponse, Error>> + Send;
fn get_group_member_count(
&self,
group_id: &str,
) -> impl std::future::Future<Output = Result<models::GroupMemberCountResponse, Error>> + Send;
fn get_group_member_profile(
&self,
group_id: &str,
user_id: &str,
) -> impl std::future::Future<Output = Result<models::GroupUserProfileResponse, Error>> + Send;
fn get_group_members_ids(
&self,
group_id: &str,
start: Option<&str>,
) -> impl std::future::Future<Output = Result<models::MembersIdsResponse, Error>> + Send;
fn get_group_summary(
&self,
group_id: &str,
) -> impl std::future::Future<Output = Result<models::GroupSummaryResponse, Error>> + Send;
fn get_joined_membership_users(
&self,
membership_id: i32,
start: Option<&str>,
limit: Option<i32>,
) -> impl std::future::Future<Output = Result<models::GetJoinedMembershipUsersResponse, Error>> + Send;
fn get_membership_list(
&self,
) -> impl std::future::Future<Output = Result<models::MembershipListResponse, Error>> + Send;
fn get_membership_subscription(
&self,
user_id: &str,
) -> impl std::future::Future<Output = Result<models::GetMembershipSubscriptionResponse, Error>> + Send;
fn get_message_quota(
&self,
) -> impl std::future::Future<Output = Result<models::MessageQuotaResponse, Error>> + Send;
fn get_message_quota_consumption(
&self,
) -> impl std::future::Future<Output = Result<models::QuotaConsumptionResponse, Error>> + Send;
fn get_narrowcast_progress(
&self,
request_id: &str,
) -> impl std::future::Future<Output = Result<models::NarrowcastProgressResponse, Error>> + Send;
fn get_number_of_sent_broadcast_messages(
&self,
date: &str,
) -> impl std::future::Future<Output = Result<models::NumberOfMessagesResponse, Error>> + Send;
fn get_number_of_sent_multicast_messages(
&self,
date: &str,
) -> impl std::future::Future<Output = Result<models::NumberOfMessagesResponse, Error>> + Send;
fn get_number_of_sent_push_messages(
&self,
date: &str,
) -> impl std::future::Future<Output = Result<models::NumberOfMessagesResponse, Error>> + Send;
fn get_number_of_sent_reply_messages(
&self,
date: &str,
) -> impl std::future::Future<Output = Result<models::NumberOfMessagesResponse, Error>> + Send;
fn get_pnp_message_statistics(
&self,
date: &str,
) -> impl std::future::Future<Output = Result<models::NumberOfMessagesResponse, Error>> + Send;
fn get_profile(
&self,
user_id: &str,
) -> impl std::future::Future<Output = Result<models::UserProfileResponse, Error>> + Send;
fn get_rich_menu(
&self,
rich_menu_id: &str,
) -> impl std::future::Future<Output = Result<models::RichMenuResponse, Error>> + Send;
fn get_rich_menu_alias(
&self,
rich_menu_alias_id: &str,
) -> impl std::future::Future<Output = Result<models::RichMenuAliasResponse, Error>> + Send;
fn get_rich_menu_alias_list(
&self,
) -> impl std::future::Future<Output = Result<models::RichMenuAliasListResponse, Error>> + Send;
fn get_rich_menu_batch_progress(
&self,
request_id: &str,
) -> impl std::future::Future<Output = Result<models::RichMenuBatchProgressResponse, Error>> + Send;
fn get_rich_menu_id_of_user(
&self,
user_id: &str,
) -> impl std::future::Future<Output = Result<models::RichMenuIdResponse, Error>> + Send;
fn get_rich_menu_list(
&self,
) -> impl std::future::Future<Output = Result<models::RichMenuListResponse, Error>> + Send;
fn get_room_member_count(
&self,
room_id: &str,
) -> impl std::future::Future<Output = Result<models::RoomMemberCountResponse, Error>> + Send;
fn get_room_member_profile(
&self,
room_id: &str,
user_id: &str,
) -> impl std::future::Future<Output = Result<models::RoomUserProfileResponse, Error>> + Send;
fn get_room_members_ids(
&self,
room_id: &str,
start: Option<&str>,
) -> impl std::future::Future<Output = Result<models::MembersIdsResponse, Error>> + Send;
fn get_webhook_endpoint(
&self,
) -> impl std::future::Future<Output = Result<models::GetWebhookEndpointResponse, Error>> + Send;
fn issue_link_token(
&self,
user_id: &str,
) -> impl std::future::Future<Output = Result<models::IssueLinkTokenResponse, Error>> + Send;
fn leave_group(
&self,
group_id: &str,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn leave_room(
&self,
room_id: &str,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn link_rich_menu_id_to_user(
&self,
user_id: &str,
rich_menu_id: &str,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn link_rich_menu_id_to_users(
&self,
rich_menu_bulk_link_request: models::RichMenuBulkLinkRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn list_coupon(
&self,
status: Option<Vec<String>>,
start: Option<&str>,
limit: Option<i32>,
) -> impl std::future::Future<Output = Result<models::MessagingApiPagerCouponListResponse, Error>>
+ Send;
fn mark_messages_as_read(
&self,
mark_messages_as_read_request: models::MarkMessagesAsReadRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn mark_messages_as_read_by_token(
&self,
mark_messages_as_read_by_token_request: models::MarkMessagesAsReadByTokenRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn multicast(
&self,
multicast_request: models::MulticastRequest,
x_line_retry_key: Option<&str>,
) -> impl std::future::Future<Output = Result<serde_json::Value, Error>> + Send;
fn narrowcast(
&self,
narrowcast_request: models::NarrowcastRequest,
x_line_retry_key: Option<&str>,
) -> impl std::future::Future<Output = Result<serde_json::Value, Error>> + Send;
fn push_message(
&self,
push_message_request: models::PushMessageRequest,
x_line_retry_key: Option<&str>,
) -> impl std::future::Future<Output = Result<models::PushMessageResponse, Error>> + Send;
fn push_messages_by_phone(
&self,
pnp_messages_request: models::PnpMessagesRequest,
x_line_delivery_tag: Option<&str>,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn reply_message(
&self,
reply_message_request: models::ReplyMessageRequest,
) -> impl std::future::Future<Output = Result<models::ReplyMessageResponse, Error>> + Send;
fn rich_menu_batch(
&self,
rich_menu_batch_request: models::RichMenuBatchRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn set_default_rich_menu(
&self,
rich_menu_id: &str,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn set_webhook_endpoint(
&self,
set_webhook_endpoint_request: models::SetWebhookEndpointRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn show_loading_animation(
&self,
show_loading_animation_request: models::ShowLoadingAnimationRequest,
) -> impl std::future::Future<Output = Result<serde_json::Value, Error>> + Send;
fn test_webhook_endpoint(
&self,
test_webhook_endpoint_request: Option<models::TestWebhookEndpointRequest>,
) -> impl std::future::Future<Output = Result<models::TestWebhookEndpointResponse, Error>> + Send;
fn unlink_rich_menu_id_from_user(
&self,
user_id: &str,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn unlink_rich_menu_id_from_users(
&self,
rich_menu_bulk_unlink_request: models::RichMenuBulkUnlinkRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn update_rich_menu_alias(
&self,
rich_menu_alias_id: &str,
update_rich_menu_alias_request: models::UpdateRichMenuAliasRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn validate_broadcast(
&self,
validate_message_request: models::ValidateMessageRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn validate_multicast(
&self,
validate_message_request: models::ValidateMessageRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn validate_narrowcast(
&self,
validate_message_request: models::ValidateMessageRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn validate_push(
&self,
validate_message_request: models::ValidateMessageRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn validate_reply(
&self,
validate_message_request: models::ValidateMessageRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn validate_rich_menu_batch_request(
&self,
rich_menu_batch_request: models::RichMenuBatchRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
fn validate_rich_menu_object(
&self,
rich_menu_request: models::RichMenuRequest,
) -> impl std::future::Future<Output = Result<(), Error>> + Send;
}
impl<C: Connect> MessagingApiApi for MessagingApiApiClient<C>
where
C: Clone + std::marker::Send + Sync,
{
#[allow(unused_mut)]
async fn broadcast(
&self,
broadcast_request: models::BroadcastRequest,
x_line_retry_key: Option<&str>,
) -> Result<serde_json::Value, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/message/broadcast".to_string(),
);
if let Some(param_value) = x_line_retry_key {
req = req.with_header_param("X-Line-Retry-Key".to_string(), param_value.to_string());
}
req = req.with_body_param(broadcast_request);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn cancel_default_rich_menu(&self) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::DELETE,
"/v2/bot/user/all/richmenu".to_string(),
);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn close_coupon(&self, coupon_id: &str) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::PUT,
"/v2/bot/coupon/{couponId}/close".to_string(),
);
req = req.with_path_param("couponId".to_string(), coupon_id.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn create_coupon(
&self,
coupon_create_request: Option<models::CouponCreateRequest>,
) -> Result<models::CouponCreateResponse, Error> {
let mut req =
__internal_request::Request::new(hyper::Method::POST, "/v2/bot/coupon".to_string());
req = req.with_body_param(coupon_create_request);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn create_rich_menu(
&self,
rich_menu_request: models::RichMenuRequest,
) -> Result<models::RichMenuIdResponse, Error> {
let mut req =
__internal_request::Request::new(hyper::Method::POST, "/v2/bot/richmenu".to_string());
req = req.with_body_param(rich_menu_request);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn create_rich_menu_alias(
&self,
create_rich_menu_alias_request: models::CreateRichMenuAliasRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/richmenu/alias".to_string(),
);
req = req.with_body_param(create_rich_menu_alias_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn delete_rich_menu(&self, rich_menu_id: &str) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::DELETE,
"/v2/bot/richmenu/{richMenuId}".to_string(),
);
req = req.with_path_param("richMenuId".to_string(), rich_menu_id.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn delete_rich_menu_alias(&self, rich_menu_alias_id: &str) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::DELETE,
"/v2/bot/richmenu/alias/{richMenuAliasId}".to_string(),
);
req = req.with_path_param(
"richMenuAliasId".to_string(),
rich_menu_alias_id.to_string(),
);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_aggregation_unit_name_list(
&self,
limit: Option<&str>,
start: Option<&str>,
) -> Result<models::GetAggregationUnitNameListResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/message/aggregation/list".to_string(),
);
if let Some(ref s) = limit {
req = req.with_query_param("limit".to_string(), s.to_string());
}
if let Some(ref s) = start {
req = req.with_query_param("start".to_string(), s.to_string());
}
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_aggregation_unit_usage(
&self,
) -> Result<models::GetAggregationUnitUsageResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/message/aggregation/info".to_string(),
);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_bot_info(&self) -> Result<models::BotInfoResponse, Error> {
let mut req =
__internal_request::Request::new(hyper::Method::GET, "/v2/bot/info".to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_coupon_detail(&self, coupon_id: &str) -> Result<models::CouponResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/coupon/{couponId}".to_string(),
);
req = req.with_path_param("couponId".to_string(), coupon_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_default_rich_menu_id(&self) -> Result<models::RichMenuIdResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/user/all/richmenu".to_string(),
);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_followers(
&self,
start: Option<&str>,
limit: Option<i32>,
) -> Result<models::GetFollowersResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/followers/ids".to_string(),
);
if let Some(ref s) = start {
req = req.with_query_param("start".to_string(), s.to_string());
}
if let Some(ref s) = limit {
req = req.with_query_param("limit".to_string(), s.to_string());
}
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_group_member_count(
&self,
group_id: &str,
) -> Result<models::GroupMemberCountResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/group/{groupId}/members/count".to_string(),
);
req = req.with_path_param("groupId".to_string(), group_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_group_member_profile(
&self,
group_id: &str,
user_id: &str,
) -> Result<models::GroupUserProfileResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/group/{groupId}/member/{userId}".to_string(),
);
req = req.with_path_param("groupId".to_string(), group_id.to_string());
req = req.with_path_param("userId".to_string(), user_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_group_members_ids(
&self,
group_id: &str,
start: Option<&str>,
) -> Result<models::MembersIdsResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/group/{groupId}/members/ids".to_string(),
);
if let Some(ref s) = start {
req = req.with_query_param("start".to_string(), s.to_string());
}
req = req.with_path_param("groupId".to_string(), group_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_group_summary(
&self,
group_id: &str,
) -> Result<models::GroupSummaryResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/group/{groupId}/summary".to_string(),
);
req = req.with_path_param("groupId".to_string(), group_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_joined_membership_users(
&self,
membership_id: i32,
start: Option<&str>,
limit: Option<i32>,
) -> Result<models::GetJoinedMembershipUsersResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/membership/{membershipId}/users/ids".to_string(),
);
if let Some(ref s) = start {
req = req.with_query_param("start".to_string(), s.to_string());
}
if let Some(ref s) = limit {
req = req.with_query_param("limit".to_string(), s.to_string());
}
req = req.with_path_param("membershipId".to_string(), membership_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_membership_list(&self) -> Result<models::MembershipListResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/membership/list".to_string(),
);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_membership_subscription(
&self,
user_id: &str,
) -> Result<models::GetMembershipSubscriptionResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/membership/subscription/{userId}".to_string(),
);
req = req.with_path_param("userId".to_string(), user_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_message_quota(&self) -> Result<models::MessageQuotaResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/message/quota".to_string(),
);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_message_quota_consumption(
&self,
) -> Result<models::QuotaConsumptionResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/message/quota/consumption".to_string(),
);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_narrowcast_progress(
&self,
request_id: &str,
) -> Result<models::NarrowcastProgressResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/message/progress/narrowcast".to_string(),
);
req = req.with_query_param("requestId".to_string(), request_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_number_of_sent_broadcast_messages(
&self,
date: &str,
) -> Result<models::NumberOfMessagesResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/message/delivery/broadcast".to_string(),
);
req = req.with_query_param("date".to_string(), date.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_number_of_sent_multicast_messages(
&self,
date: &str,
) -> Result<models::NumberOfMessagesResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/message/delivery/multicast".to_string(),
);
req = req.with_query_param("date".to_string(), date.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_number_of_sent_push_messages(
&self,
date: &str,
) -> Result<models::NumberOfMessagesResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/message/delivery/push".to_string(),
);
req = req.with_query_param("date".to_string(), date.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_number_of_sent_reply_messages(
&self,
date: &str,
) -> Result<models::NumberOfMessagesResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/message/delivery/reply".to_string(),
);
req = req.with_query_param("date".to_string(), date.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_pnp_message_statistics(
&self,
date: &str,
) -> Result<models::NumberOfMessagesResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/message/delivery/pnp".to_string(),
);
req = req.with_query_param("date".to_string(), date.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_profile(&self, user_id: &str) -> Result<models::UserProfileResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/profile/{userId}".to_string(),
);
req = req.with_path_param("userId".to_string(), user_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_rich_menu(&self, rich_menu_id: &str) -> Result<models::RichMenuResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/richmenu/{richMenuId}".to_string(),
);
req = req.with_path_param("richMenuId".to_string(), rich_menu_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_rich_menu_alias(
&self,
rich_menu_alias_id: &str,
) -> Result<models::RichMenuAliasResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/richmenu/alias/{richMenuAliasId}".to_string(),
);
req = req.with_path_param(
"richMenuAliasId".to_string(),
rich_menu_alias_id.to_string(),
);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_rich_menu_alias_list(&self) -> Result<models::RichMenuAliasListResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/richmenu/alias/list".to_string(),
);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_rich_menu_batch_progress(
&self,
request_id: &str,
) -> Result<models::RichMenuBatchProgressResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/richmenu/progress/batch".to_string(),
);
req = req.with_query_param("requestId".to_string(), request_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_rich_menu_id_of_user(
&self,
user_id: &str,
) -> Result<models::RichMenuIdResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/user/{userId}/richmenu".to_string(),
);
req = req.with_path_param("userId".to_string(), user_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_rich_menu_list(&self) -> Result<models::RichMenuListResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/richmenu/list".to_string(),
);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_room_member_count(
&self,
room_id: &str,
) -> Result<models::RoomMemberCountResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/room/{roomId}/members/count".to_string(),
);
req = req.with_path_param("roomId".to_string(), room_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_room_member_profile(
&self,
room_id: &str,
user_id: &str,
) -> Result<models::RoomUserProfileResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/room/{roomId}/member/{userId}".to_string(),
);
req = req.with_path_param("roomId".to_string(), room_id.to_string());
req = req.with_path_param("userId".to_string(), user_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_room_members_ids(
&self,
room_id: &str,
start: Option<&str>,
) -> Result<models::MembersIdsResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/room/{roomId}/members/ids".to_string(),
);
if let Some(ref s) = start {
req = req.with_query_param("start".to_string(), s.to_string());
}
req = req.with_path_param("roomId".to_string(), room_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn get_webhook_endpoint(&self) -> Result<models::GetWebhookEndpointResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::GET,
"/v2/bot/channel/webhook/endpoint".to_string(),
);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn issue_link_token(
&self,
user_id: &str,
) -> Result<models::IssueLinkTokenResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/user/{userId}/linkToken".to_string(),
);
req = req.with_path_param("userId".to_string(), user_id.to_string());
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn leave_group(&self, group_id: &str) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/group/{groupId}/leave".to_string(),
);
req = req.with_path_param("groupId".to_string(), group_id.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn leave_room(&self, room_id: &str) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/room/{roomId}/leave".to_string(),
);
req = req.with_path_param("roomId".to_string(), room_id.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn link_rich_menu_id_to_user(
&self,
user_id: &str,
rich_menu_id: &str,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/user/{userId}/richmenu/{richMenuId}".to_string(),
);
req = req.with_path_param("userId".to_string(), user_id.to_string());
req = req.with_path_param("richMenuId".to_string(), rich_menu_id.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn link_rich_menu_id_to_users(
&self,
rich_menu_bulk_link_request: models::RichMenuBulkLinkRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/richmenu/bulk/link".to_string(),
);
req = req.with_body_param(rich_menu_bulk_link_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn list_coupon(
&self,
status: Option<Vec<String>>,
start: Option<&str>,
limit: Option<i32>,
) -> Result<models::MessagingApiPagerCouponListResponse, Error> {
let mut req =
__internal_request::Request::new(hyper::Method::GET, "/v2/bot/coupon".to_string());
if let Some(ref s) = status {
let query_params = s
.iter()
.map(|p| ("status".to_owned(), p.to_string()))
.collect::<Vec<(String, String)>>();
for (key, val) in query_params {
req = req.with_query_param(key, val);
}
}
if let Some(ref s) = start {
req = req.with_query_param("start".to_string(), s.to_string());
}
if let Some(ref s) = limit {
req = req.with_query_param("limit".to_string(), s.to_string());
}
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn mark_messages_as_read(
&self,
mark_messages_as_read_request: models::MarkMessagesAsReadRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/message/markAsRead".to_string(),
);
req = req.with_body_param(mark_messages_as_read_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn mark_messages_as_read_by_token(
&self,
mark_messages_as_read_by_token_request: models::MarkMessagesAsReadByTokenRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/chat/markAsRead".to_string(),
);
req = req.with_body_param(mark_messages_as_read_by_token_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn multicast(
&self,
multicast_request: models::MulticastRequest,
x_line_retry_key: Option<&str>,
) -> Result<serde_json::Value, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/message/multicast".to_string(),
);
if let Some(param_value) = x_line_retry_key {
req = req.with_header_param("X-Line-Retry-Key".to_string(), param_value.to_string());
}
req = req.with_body_param(multicast_request);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn narrowcast(
&self,
narrowcast_request: models::NarrowcastRequest,
x_line_retry_key: Option<&str>,
) -> Result<serde_json::Value, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/message/narrowcast".to_string(),
);
if let Some(param_value) = x_line_retry_key {
req = req.with_header_param("X-Line-Retry-Key".to_string(), param_value.to_string());
}
req = req.with_body_param(narrowcast_request);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn push_message(
&self,
push_message_request: models::PushMessageRequest,
x_line_retry_key: Option<&str>,
) -> Result<models::PushMessageResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/message/push".to_string(),
);
if let Some(param_value) = x_line_retry_key {
req = req.with_header_param("X-Line-Retry-Key".to_string(), param_value.to_string());
}
req = req.with_body_param(push_message_request);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn push_messages_by_phone(
&self,
pnp_messages_request: models::PnpMessagesRequest,
x_line_delivery_tag: Option<&str>,
) -> Result<(), Error> {
let mut req =
__internal_request::Request::new(hyper::Method::POST, "/bot/pnp/push".to_string());
if let Some(param_value) = x_line_delivery_tag {
req = req.with_header_param("X-Line-Delivery-Tag".to_string(), param_value.to_string());
}
req = req.with_body_param(pnp_messages_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn reply_message(
&self,
reply_message_request: models::ReplyMessageRequest,
) -> Result<models::ReplyMessageResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/message/reply".to_string(),
);
req = req.with_body_param(reply_message_request);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn rich_menu_batch(
&self,
rich_menu_batch_request: models::RichMenuBatchRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/richmenu/batch".to_string(),
);
req = req.with_body_param(rich_menu_batch_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn set_default_rich_menu(&self, rich_menu_id: &str) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/user/all/richmenu/{richMenuId}".to_string(),
);
req = req.with_path_param("richMenuId".to_string(), rich_menu_id.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn set_webhook_endpoint(
&self,
set_webhook_endpoint_request: models::SetWebhookEndpointRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::PUT,
"/v2/bot/channel/webhook/endpoint".to_string(),
);
req = req.with_body_param(set_webhook_endpoint_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn show_loading_animation(
&self,
show_loading_animation_request: models::ShowLoadingAnimationRequest,
) -> Result<serde_json::Value, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/chat/loading/start".to_string(),
);
req = req.with_body_param(show_loading_animation_request);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn test_webhook_endpoint(
&self,
test_webhook_endpoint_request: Option<models::TestWebhookEndpointRequest>,
) -> Result<models::TestWebhookEndpointResponse, Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/channel/webhook/test".to_string(),
);
req = req.with_body_param(test_webhook_endpoint_request);
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn unlink_rich_menu_id_from_user(&self, user_id: &str) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::DELETE,
"/v2/bot/user/{userId}/richmenu".to_string(),
);
req = req.with_path_param("userId".to_string(), user_id.to_string());
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn unlink_rich_menu_id_from_users(
&self,
rich_menu_bulk_unlink_request: models::RichMenuBulkUnlinkRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/richmenu/bulk/unlink".to_string(),
);
req = req.with_body_param(rich_menu_bulk_unlink_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn update_rich_menu_alias(
&self,
rich_menu_alias_id: &str,
update_rich_menu_alias_request: models::UpdateRichMenuAliasRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/richmenu/alias/{richMenuAliasId}".to_string(),
);
req = req.with_path_param(
"richMenuAliasId".to_string(),
rich_menu_alias_id.to_string(),
);
req = req.with_body_param(update_rich_menu_alias_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn validate_broadcast(
&self,
validate_message_request: models::ValidateMessageRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/message/validate/broadcast".to_string(),
);
req = req.with_body_param(validate_message_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn validate_multicast(
&self,
validate_message_request: models::ValidateMessageRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/message/validate/multicast".to_string(),
);
req = req.with_body_param(validate_message_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn validate_narrowcast(
&self,
validate_message_request: models::ValidateMessageRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/message/validate/narrowcast".to_string(),
);
req = req.with_body_param(validate_message_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn validate_push(
&self,
validate_message_request: models::ValidateMessageRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/message/validate/push".to_string(),
);
req = req.with_body_param(validate_message_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn validate_reply(
&self,
validate_message_request: models::ValidateMessageRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/message/validate/reply".to_string(),
);
req = req.with_body_param(validate_message_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn validate_rich_menu_batch_request(
&self,
rich_menu_batch_request: models::RichMenuBatchRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/richmenu/validate/batch".to_string(),
);
req = req.with_body_param(rich_menu_batch_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
#[allow(unused_mut)]
async fn validate_rich_menu_object(
&self,
rich_menu_request: models::RichMenuRequest,
) -> Result<(), Error> {
let mut req = __internal_request::Request::new(
hyper::Method::POST,
"/v2/bot/richmenu/validate".to_string(),
);
req = req.with_body_param(rich_menu_request);
req = req.returns_nothing();
req.execute(self.configuration.borrow()).await
}
}