openehr-its 0.0.2

openEHR ITS (Implementation Technology Specifications): canonical JSON + XML serialization, ITS-REST OpenAPI contract, ITS-BMM. Mirrors the specifications-ITS-{JSON,XML,REST,BMM} repos.
Documentation
// @generated by openehr-codegen (emit-rest) — DO NOT EDIT.
//! ITS-REST contract for the `admin` API group: DTOs, per-operation
//! param structs, the `AdminApi` server trait, and the route table.

#![allow(
    clippy::all,
    clippy::pedantic,
    clippy::nursery,
    dead_code,
    unused_variables,
    reason = "mechanically generated contract text: the OAS is emitted in full (every DTO, param struct and route, whether or not this workspace consumes it yet), so style and dead-code lints do not apply — the hand-written runtime and the implementing adapter carry the lint bar"
)]
use serde::{Deserialize, Serialize};

/// Parameters for `admin_ehr_delete` (path/query/header).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AdminEhrDeleteParams {
    /// `ehr_id` (path)
    pub ehr_id: String,
}

/// Parameters for `admin_ehr_delete_all` (path/query/header).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AdminEhrDeleteAllParams {
    #[serde(skip_serializing_if = "Option::is_none")]
    /// `ehr_id` (query)
    pub ehr_id: Option<String>,
}

/// Server contract for the `admin` API group (ITS-REST). Every method
/// defaults to returning `ApiError::NotImplemented`, so an implementor
/// (the application service, or a test stub) overrides only the
/// operations it supports.
#[async_trait::async_trait]
pub trait AdminApi {
    /// `DELETE /admin/ehr/{ehr_id}`
    async fn admin_ehr_delete(
        &self,
        params: AdminEhrDeleteParams,
    ) -> Result<(), crate::rest::runtime::ApiError> {
        Err(crate::rest::runtime::ApiError::NotImplemented)
    }
    /// `DELETE /admin/ehr/all{?ehr_id*}`
    async fn admin_ehr_delete_all(
        &self,
        params: AdminEhrDeleteAllParams,
    ) -> Result<(), crate::rest::runtime::ApiError> {
        Err(crate::rest::runtime::ApiError::NotImplemented)
    }
}

/// The operations of this group as `(method, path, operation_id)`, for
/// wiring an axum router in `ferroehr-rest`.
pub const ROUTES: &[(&str, &str, &str)] = &[
    ("DELETE", "/admin/ehr/{ehr_id}", "admin_ehr_delete"),
    ("DELETE", "/admin/ehr/all{?ehr_id*}", "admin_ehr_delete_all"),
];