wuapi 0.11.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, Request, RequestParts, encode_path};
use crate::types;

/// Catalog orders contacts send as messages, read live from WhatsApp.
#[derive(Clone, Debug)]
pub struct OrdersResource {
    http: HttpClient,
}

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

    /// Get an order
    ///
    /// Details of a catalog order received as a message.
    ///
    /// `GET /v1/accounts/{accountId}/orders/{orderId}`
    ///
    /// Safe to repeat: retried on timeouts, network errors, `429` and `5xx`.
    pub fn get(
        &self,
        account_id: &str,
        order_id: &str,
        params: types::OrdersGetParams,
    ) -> Request<types::Order> {
        let parts = RequestParts::new(Method::Get, format!("/v1/accounts/{}/orders/{}", encode_path(account_id), encode_path(order_id)))
            .query("token", &params.token)
            .retryable();
        self.http.request(parts)
    }
}