apibrasil 1.0.0

SDK oficial Rust da plataforma APIBrasil: WhatsApp, SMS, consultas de CPF/CNPJ, veiculos, CEP, correios, pagamentos PIX/boleto e mais.
Documentation
use crate::core::{IntoBody, Json, Result};

platform_service! {
    /// Execução em lote: `POST /bulk/direct/{action}` e
    /// `POST /bulk/queue/{action}`.
    BulkService
}

impl BulkService {
    /// Executa um lote de forma síncrona: `POST /bulk/direct/{action}`.
    pub async fn direct(&self, action: &str, body: impl IntoBody) -> Result<Json> {
        self.base.post(&format!("bulk/direct/{action}"), body).await
    }

    /// Enfileira um lote: `POST /bulk/queue/{action}`.
    pub async fn queue(&self, action: &str, body: impl IntoBody) -> Result<Json> {
        self.base.post(&format!("bulk/queue/{action}"), body).await
    }
}