Skip to main content

EnterpriseService

Struct EnterpriseService 

Source
pub struct EnterpriseService { /* private fields */ }
Available on crate feature _async only.
Expand description

Async enterprise service. Async enterprise robot service.

Implementations§

Source§

impl EnterpriseService

Source

pub async fn get_access_token(&self) -> Result<String>

Retrieves enterprise access token and refreshes cache when needed.

Source

pub async fn send_group_message( &self, open_conversation_id: &str, title: &str, text: &str, ) -> Result<String>

Sends a group message to a conversation.

Source

pub async fn send_oto_message( &self, user_id: &str, title: &str, text: &str, ) -> Result<String>

Sends a one-to-one message to a user.

Source

pub async fn contact_get_user( &self, request: ContactGetUserRequest, ) -> Result<ContactUser>

Gets user details by user id.

Source

pub async fn contact_get_user_by_mobile( &self, request: ContactGetUserByMobileRequest, ) -> Result<ContactUser>

Gets user details by mobile.

Source

pub async fn contact_get_user_by_unionid( &self, request: ContactGetUserByUnionIdRequest, ) -> Result<ContactUser>

Gets user details by union id.

Source

pub async fn contact_list_users( &self, request: ContactListUsersRequest, ) -> Result<ContactListUsersResult>

Lists users in a department.

Source

pub async fn contact_create_user( &self, request: ContactCreateUserRequest, ) -> Result<ContactCreateUserResult>

Creates a user.

Source

pub async fn contact_update_user( &self, request: ContactUpdateUserRequest, ) -> Result<()>

Updates a user.

Source

pub async fn contact_delete_user( &self, request: ContactDeleteUserRequest, ) -> Result<()>

Deletes a user.

Source

pub async fn contact_get_department( &self, request: ContactGetDepartmentRequest, ) -> Result<ContactDepartment>

Gets department details.

Source

pub async fn contact_list_sub_departments( &self, request: ContactListSubDepartmentsRequest, ) -> Result<ContactListSubDepartmentsResult>

Lists child departments.

Source

pub async fn contact_list_sub_department_ids( &self, request: ContactListSubDepartmentIdsRequest, ) -> Result<ContactListSubDepartmentIdsResult>

Lists child department ids.

Source

pub async fn contact_create_department( &self, request: ContactCreateDepartmentRequest, ) -> Result<ContactCreateDepartmentResult>

Creates a department.

Source

pub async fn contact_update_department( &self, request: ContactUpdateDepartmentRequest, ) -> Result<()>

Updates a department.

Source

pub async fn contact_delete_department( &self, request: ContactDeleteDepartmentRequest, ) -> Result<()>

Deletes a department.

Source

pub async fn approval_create_process_instance( &self, request: ApprovalCreateProcessInstanceRequest, ) -> Result<String>

Creates an approval process instance and returns its id.

Source

pub async fn approval_get_process_instance( &self, process_instance_id: &str, ) -> Result<ApprovalProcessInstance>

Gets approval process instance details.

Source

pub async fn approval_list_process_instance_ids( &self, request: ApprovalListProcessInstanceIdsRequest, ) -> Result<ApprovalListProcessInstanceIdsResult>

Lists approval process instance ids.

Source

pub async fn approval_terminate_process_instance( &self, request: ApprovalTerminateProcessInstanceRequest, ) -> Result<()>

Terminates an approval process instance.

Source

pub async fn reply_message( &self, data: &Value, title: &str, text: &str, ) -> Result<String>

Replies to an incoming callback message.

For private chats, this sends OTO message to senderStaffId; for group chats, it sends a group message to conversationId.

Trait Implementations§

Source§

impl Clone for EnterpriseService

Source§

fn clone(&self) -> EnterpriseService

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more