alpr-sdk 0.1.1

Alpr.sh's SDK for Rust: license plate recognition from photos, cameras, readings and webhooks.
Documentation
// Code generated by sdk/generator. DO NOT EDIT.

//! Alpr.sh's SDK for Rust, generated from Alpr.sh's API contract.
//!
//! A [`Client`] calls the API with one workspace's API key
//! (`alpr_live_…`). A refusal is [`Error::Api`].
//!
//! ```no_run
//! use alpr::{Client, PhotosRecognizeParams, RecognitionsListParams};
//!
//! # fn main() -> Result<(), alpr::Error> {
//! let client = Client::new("alpr_live_…");
//!
//! let photo = std::fs::read("carro.jpg").unwrap();
//! let result = client.photos().recognize(&PhotosRecognizeParams::new(photo))?;
//! for plate in &result.plates {
//!     println!("{} ({})", plate.plate, plate.conf);
//! }
//!
//! for reading in client.recognitions().list_iter(RecognitionsListParams::new()) {
//!     println!("{}", reading?.plate);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! Webhooks are checked with [`verify_webhook`] before their body is read.

#![forbid(unsafe_code)]
#![warn(missing_docs)]

mod client;
mod error;
mod multipart;
// The models, services and webhooks are written by the generator, which lays
// them out itself.
#[rustfmt::skip]
pub mod models;
mod pagination;
#[rustfmt::skip]
mod services;
mod version;
#[rustfmt::skip]
mod webhooks;

pub use client::{
    BoxError, Client, ClientBuilder, HttpRequest, HttpResponse, RequestOptions, Transport,
    UreqTransport,
};
pub use error::{ApiError, Error};
pub use models::*;
pub use pagination::Page;
pub use services::*;
pub use version::{API_VERSION, DEFAULT_BASE_URL, VERSION};
pub use webhooks::{
    verify_webhook, verify_webhook_at, verify_webhook_signature, verify_webhook_signature_at,
    UnknownWebhookEvent, WebhookError, WebhookEvent, WEBHOOK_TOLERANCE,
};

// The event of each kind of data a webhook carries.
pub use webhooks::AlertTriggeredWebhookEvent;
pub use webhooks::RecognitionCreatedWebhookEvent;
pub use webhooks::TestWebhookEvent;