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::{DeviceResponse, IntoBody, Result};

platform_service! {
    /// Loterias (device-based): `POST /loterias/{sorteio}/*`.
    LoteriasService
}

impl LoteriasService {
    /// Consulta um concurso: `POST /loterias/{sorteio}/{concurso}`.
    pub async fn resultado(
        &self,
        sorteio: &str,
        concurso: u64,
        body: impl IntoBody,
    ) -> Result<DeviceResponse> {
        let path = format!("loterias/{sorteio}/{concurso}");
        Ok(DeviceResponse(self.base.post(&path, body).await?))
    }

    /// Consulta o Ășltimo resultado: `POST /loterias/{sorteio}/latest`.
    pub async fn latest(&self, sorteio: &str, body: impl IntoBody) -> Result<DeviceResponse> {
        let path = format!("loterias/{sorteio}/latest");
        Ok(DeviceResponse(self.base.post(&path, body).await?))
    }
}