wuapi 0.14.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};
use crate::types;

/// What the invitation page and email show: your name, logo, accent color, support link, and whether the wuapi footer appears (hiding it needs the White label add-on).
#[derive(Clone, Debug)]
pub struct BrandingResource {
    http: HttpClient,
}

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

    /// Get branding
    ///
    /// What the invitation page and email show. Organization keys only (project keys get `403 forbidden`); the `Wuapi-Project` header does not change the result.
    ///
    /// `GET /v1/branding`
    ///
    /// Safe to repeat: retried on timeouts, network errors, `429` and `5xx`.
    pub fn get(&self) -> Request<types::Branding> {
        let parts = RequestParts::new(Method::Get, "/v1/branding").retryable();
        self.http.request(parts)
    }

    /// Update branding
    ///
    /// `displayName` is required the first time. Without an accent color the page uses wuapi's own. `hideWuapiBranding: true` needs the White label add-on ($100/month): without it the call answers `402 addon_required` and changes nothing. Organization keys only (project keys get `403 forbidden`); the `Wuapi-Project` header does not change the result.
    ///
    /// `PATCH /v1/branding`
    ///
    /// Not idempotent: retried only when the request never reached the API or was refused with `429`.
    pub fn update(&self, params: types::BrandingUpdateParams) -> Request<types::Branding> {
        let parts = RequestParts::new(Method::Patch, "/v1/branding").body(&params);
        self.http.request(parts)
    }
}