pub struct TemplateApi { /* private fields */ }Expand description
Template Message Management API
Thin wrapper around SubscribeApi for template management operations.
Subscribe messages and template management share the same underlying WeChat APIs.
Implementations§
Source§impl TemplateApi
impl TemplateApi
Sourcepub fn new(context: Arc<WechatContext>) -> Self
pub fn new(context: Arc<WechatContext>) -> Self
Create a new TemplateApi instance
Sourcepub async fn add_template(
&self,
tid: &str,
kid_list: Option<Vec<i32>>,
scene_desc: Option<&str>,
) -> Result<String, WechatError>
pub async fn add_template( &self, tid: &str, kid_list: Option<Vec<i32>>, scene_desc: Option<&str>, ) -> Result<String, WechatError>
Add template from template library
Delegates to SubscribeApi::add_template.
Sourcepub async fn get_template_list(&self) -> Result<Vec<TemplateInfo>, WechatError>
pub async fn get_template_list(&self) -> Result<Vec<TemplateInfo>, WechatError>
Get template list
Delegates to SubscribeApi::get_template_list.
Sourcepub async fn delete_template(
&self,
pri_tmpl_id: &str,
) -> Result<(), WechatError>
pub async fn delete_template( &self, pri_tmpl_id: &str, ) -> Result<(), WechatError>
Delete template
Delegates to SubscribeApi::delete_template.
Sourcepub async fn get_category(&self) -> Result<Vec<CategoryInfo>, WechatError>
pub async fn get_category(&self) -> Result<Vec<CategoryInfo>, WechatError>
Get category list
Delegates to SubscribeApi::get_category.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TemplateApi
impl !RefUnwindSafe for TemplateApi
impl Send for TemplateApi
impl Sync for TemplateApi
impl Unpin for TemplateApi
impl UnsafeUnpin for TemplateApi
impl !UnwindSafe for TemplateApi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more