wuapi 0.13.0

Rust SDK for wuapi, a WhatsApp API for developers. Link numbers by QR or pairing code, send and receive messages, manage chats, contacts, groups and channels, split them into projects and verify webhooks.
Documentation
// Generated by wuapi-codegen from the OpenAPI spec. Do not edit: run `bun run codegen`.

use crate::http::{HttpClient, Method, RequestParts, encode_path};
use crate::pagination::Paginator;
use crate::types;

/// The `bots` methods.
#[derive(Clone, Debug)]
pub struct BotsResource {
    http: HttpClient,
}

impl BotsResource {
    pub(crate) fn new(http: HttpClient) -> Self {
        Self { http }
    }

    /// List WhatsApp AI bots
    ///
    /// WhatsApp's AI bot directory as the account sees it. `400 not_supported` when WhatsApp does not offer it to this account (WhatsApp's AI assistant is not available in every country or on every account).
    ///
    /// `GET /v1/accounts/{accountId}/bots`
    ///
    /// Safe to repeat: retried on timeouts, network errors, `429` and `5xx`.
    pub fn list(
        &self,
        account_id: &str,
        params: types::BotsListParams,
    ) -> Paginator<types::BotList> {
        let parts = RequestParts::new(Method::Get, format!("/v1/accounts/{}/bots", encode_path(account_id)))
            .query_opt("limit", params.limit.as_ref())
            .retryable();
        Paginator::new(self.http.clone(), parts, "cursor", params.cursor)
    }
}