pub struct ApiClient { /* private fields */ }Expand description
Thin HTTP client for Inline API endpoints.
Implementations§
Source§impl ApiClient
impl ApiClient
Sourcepub fn builder(base_url: impl Into<String>) -> ApiClientBuilder
pub fn builder(base_url: impl Into<String>) -> ApiClientBuilder
Starts an ApiClient builder for an Inline API base URL.
Sourcepub fn try_new(base_url: impl Into<String>) -> Result<Self, ApiError>
pub fn try_new(base_url: impl Into<String>) -> Result<Self, ApiError>
Creates an API client with the default SDK identity.
Sourcepub fn try_new_with_identity(
base_url: impl Into<String>,
identity: ClientIdentity,
) -> Result<Self, ApiError>
pub fn try_new_with_identity( base_url: impl Into<String>, identity: ClientIdentity, ) -> Result<Self, ApiError>
Creates an API client with a custom client identity.
Sourcepub fn http_client(&self) -> &Client
pub fn http_client(&self) -> &Client
Returns the underlying reqwest client.
Sourcepub fn request_timeout(&self) -> Option<Duration>
pub fn request_timeout(&self) -> Option<Duration>
Returns the request timeout configured by the SDK builder.
This is None when the caller provided a custom reqwest client.
Source§impl ApiClient
impl ApiClient
Sourcepub fn try_with_http_client(
base_url: impl Into<String>,
http: Client,
) -> Result<Self, ApiError>
pub fn try_with_http_client( base_url: impl Into<String>, http: Client, ) -> Result<Self, ApiError>
Creates an API client from a caller-provided reqwest client.
Sourcepub async fn send_email_code(
&self,
email: &str,
metadata: &AuthMetadata,
) -> Result<SendCodeResult, ApiError>
pub async fn send_email_code( &self, email: &str, metadata: &AuthMetadata, ) -> Result<SendCodeResult, ApiError>
Sends an email login code.
Sourcepub async fn verify_email_code(
&self,
email: &str,
code: &str,
challenge_token: Option<&str>,
metadata: &AuthMetadata,
) -> Result<VerifyCodeResult, ApiError>
pub async fn verify_email_code( &self, email: &str, code: &str, challenge_token: Option<&str>, metadata: &AuthMetadata, ) -> Result<VerifyCodeResult, ApiError>
Verifies an email login code and returns an auth token on success.
Sourcepub async fn send_sms_code(
&self,
phone_number: &str,
metadata: &AuthMetadata,
) -> Result<SendCodeResult, ApiError>
pub async fn send_sms_code( &self, phone_number: &str, metadata: &AuthMetadata, ) -> Result<SendCodeResult, ApiError>
Sends an SMS login code.
Sourcepub async fn verify_sms_code(
&self,
phone_number: &str,
code: &str,
metadata: &AuthMetadata,
) -> Result<VerifyCodeResult, ApiError>
pub async fn verify_sms_code( &self, phone_number: &str, code: &str, metadata: &AuthMetadata, ) -> Result<VerifyCodeResult, ApiError>
Verifies an SMS login code and returns an auth token on success.
Sourcepub async fn upload_file(
&self,
token: &str,
input: UploadFileInput,
) -> Result<UploadFileResult, ApiError>
pub async fn upload_file( &self, token: &str, input: UploadFileInput, ) -> Result<UploadFileResult, ApiError>
Uploads a local file using the Inline upload endpoint.
Sourcepub async fn read_messages(
&self,
token: &str,
input: ReadMessagesInput,
) -> Result<ReadMessagesResult, ApiError>
pub async fn read_messages( &self, token: &str, input: ReadMessagesInput, ) -> Result<ReadMessagesResult, ApiError>
Marks messages as read for a peer.
Sourcepub async fn create_private_chat(
&self,
token: &str,
user_id: i64,
) -> Result<CreatePrivateChatResult, ApiError>
pub async fn create_private_chat( &self, token: &str, user_id: i64, ) -> Result<CreatePrivateChatResult, ApiError>
Creates or opens a private chat with a user.
Sourcepub async fn create_linear_issue(
&self,
token: &str,
input: CreateLinearIssueInput,
) -> Result<CreateLinearIssueResult, ApiError>
pub async fn create_linear_issue( &self, token: &str, input: CreateLinearIssueInput, ) -> Result<CreateLinearIssueResult, ApiError>
Creates a Linear issue from an Inline message.
Sourcepub async fn create_notion_task(
&self,
token: &str,
input: CreateNotionTaskInput,
) -> Result<CreateNotionTaskResult, ApiError>
pub async fn create_notion_task( &self, token: &str, input: CreateNotionTaskInput, ) -> Result<CreateNotionTaskResult, ApiError>
Creates a Notion task from an Inline message.