pub struct ApiClient { /* private fields */ }Expand description
Slack API client
Supports both:
- Wrapper commands via
call_method()withApiMethodenum - Generic API calls via
call()with arbitrary endpoints
Implementations§
Source§impl ApiClient
impl ApiClient
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new API client with default configuration (for generic API calls)
Sourcepub fn with_token(token: String) -> Self
pub fn with_token(token: String) -> Self
Create a new API client with a token (for wrapper commands)
Sourcepub fn with_config(config: ApiClientConfig) -> Self
pub fn with_config(config: ApiClientConfig) -> Self
Create a new API client with custom configuration
Sourcepub async fn call_method(
&self,
method: ApiMethod,
params: HashMap<String, Value>,
) -> Result<ApiResponse, ApiError>
pub async fn call_method( &self, method: ApiMethod, params: HashMap<String, Value>, ) -> Result<ApiResponse, ApiError>
Call a Slack API method using the ApiMethod enum (for wrapper commands)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ApiClient
impl !RefUnwindSafe for ApiClient
impl Send for ApiClient
impl Sync for ApiClient
impl Unpin for ApiClient
impl !UnwindSafe for ApiClient
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