Skip to main content

Crate dingtalk_sdk

Crate dingtalk_sdk 

Source
Expand description

DingTalk API SDK for Rust.

This crate provides:

  • async client (Client) and services (WebhookService, EnterpriseService)
  • optional blocking client (BlockingClient) and services
  • typed request/response models for contacts and approvals
  • unified error model and transport profiles/retry integration via reqx

§Quick Start (Async)

#[cfg(feature = "_async")]
use dingtalk_sdk::Client;

#[cfg(feature = "_async")]
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::builder().build()?;
    let webhook = client.webhook("your_token", Some("your_secret".into()));
    let _ = webhook
        .send_text_message("Hello from rustdoc", None, None, Some(false))
        .await?;
    Ok(())
}

#[cfg(not(feature = "_async"))]
fn main() {}

§Feature Overview

At least one runtime mode is required:

  • _async (internal)
  • _blocking (internal)

Each enabled runtime mode requires exactly one TLS backend:

  • async: async-tls-rustls-ring / async-tls-rustls-aws-lc-rs / async-tls-native
  • blocking: blocking-tls-rustls-ring / blocking-tls-rustls-aws-lc-rs / blocking-tls-native

In normal usage, select TLS features directly. They automatically enable the matching runtime mode.

Structs§

ActionCardButton
Public webhook and enterprise request/response helper types. Re-exported webhook message helper types. Multi-button actionCard button item.
AppCredentials
Application credentials used by enterprise APIs. Enterprise app credentials (appkey + appsecret).
ApprovalCreateProcessInstanceRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for creating an approval process instance.
ApprovalFormComponentValue
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Form field item for approval instance creation.
ApprovalListProcessInstanceIdsRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for listing approval process instance ids.
ApprovalListProcessInstanceIdsResult
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Response payload for process-instance id listing.
ApprovalProcessInstance
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Typed approval process instance payload.
ApprovalTerminateProcessInstanceRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for terminating an approval process instance.
BodySnippetConfig
Controls whether and how response snippets are retained in errors. Configuration for attaching a redacted body snippet to API errors.
Client_async
Async DingTalk SDK client.
ClientBuilder_async
Builder for async Client.
ContactCreateDepartmentRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for creating a department.
ContactCreateDepartmentResult
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Response payload for creating a department.
ContactCreateUserRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for creating a user.
ContactCreateUserResult
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Response payload for contact user creation.
ContactDeleteDepartmentRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for deleting a department.
ContactDeleteUserRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for deleting a user.
ContactDepartment
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Typed department object from contact APIs.
ContactGetDepartmentRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for getting a department.
ContactGetUserByMobileRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for getting a user by mobile number.
ContactGetUserByUnionIdRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for getting a user by union id.
ContactGetUserRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for getting a user by userid.
ContactListSubDepartmentIdsRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for listing child department ids.
ContactListSubDepartmentIdsResult
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Response payload for listing child department ids.
ContactListSubDepartmentsRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for listing child departments.
ContactListSubDepartmentsResult
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Response payload for listing child departments.
ContactListUsersRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for listing users in a department.
ContactListUsersResult
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Response payload for contact user listing.
ContactUpdateDepartmentRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for updating a department.
ContactUpdateUserRequest
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Request for updating a user.
ContactUser
Public webhook and enterprise request/response helper types. Re-exported enterprise request/response types. Typed user object from contact APIs.
EnterpriseService_async
Async enterprise service. Async enterprise robot service.
FeedCardLink
Public webhook and enterprise request/response helper types. Re-exported webhook message helper types. feedCard link item.
HttpError
SDK error type and helpers. Structured HTTP error context.
RetryPolicy
reqx retry policy for DingTalk clients.
TransportError
SDK error type and helpers. Structured transport error context.
WebhookService_async
Async webhook service. Async webhook robot service.

Enums§

ClientProfile
reqx transport profile presets for DingTalk clients.
Error
SDK error type and helpers. Unified SDK error type.
ErrorKind
SDK error type and helpers. Stable high-level error category.

Type Aliases§

Result
SDK error type and helpers. SDK result type.