#![allow(
clippy::all,
clippy::pedantic,
clippy::nursery,
dead_code,
unused_imports,
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"
)]
#![allow(
clippy::disallowed_types,
reason = "adjudicated free-form JSON slots: serde_json::Value is workspace-banned (#1694); a generated carrier exists only where the spec leaves the slot open — `allow`, not `expect`, because a carrier may sit inside a feature-gated region and fire only under that feature"
)]
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionOfParty {
#[serde(skip_serializing_if = "Option::is_none")]
pub _type: Option<String>,
pub contribution: openehr_base::prelude::ObjectRef,
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
pub commit_audit: openehr_rm::v1_2::common::generic::audit_details::AuditDetails,
pub data: openehr_rm::v1_2::demographic::party::Party,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
#[derive(Debug, Clone)]
pub enum Versionable {
Actor(openehr_rm::v1_2::demographic::actor::Actor),
Agent(openehr_rm::v1_2::demographic::agent::Agent),
Group(openehr_rm::v1_2::demographic::group::Group),
Organisation(openehr_rm::v1_2::demographic::organisation::Organisation),
Party(openehr_rm::v1_2::demographic::party::Party),
Person(openehr_rm::v1_2::demographic::person::Person),
Role(openehr_rm::v1_2::demographic::role::Role),
}
impl ::serde::Serialize for Versionable {
fn serialize<__S: ::serde::Serializer>(
&self,
__serializer: __S,
) -> ::core::result::Result<__S::Ok, __S::Error> {
match self {
Self::Actor(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::Agent(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::Group(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::Organisation(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::Party(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::Person(__x) => ::serde::Serialize::serialize(__x, __serializer),
Self::Role(__x) => ::serde::Serialize::serialize(__x, __serializer),
}
}
}
impl<'de> ::serde::Deserialize<'de> for Versionable {
fn deserialize<__D: ::serde::Deserializer<'de>>(
__deserializer: __D,
) -> ::core::result::Result<Self, __D::Error> {
const __TAGS: &[&str] = &[
"ACTOR",
"AGENT",
"GROUP",
"ORGANISATION",
"PARTY",
"PERSON",
"ROLE",
];
struct __Visitor;
impl<'de> ::serde::de::Visitor<'de> for __Visitor {
type Value = Versionable;
fn expecting(&self, __f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
__f.write_str("an ITS-REST `Versionable` object")
}
fn visit_map<__A: ::serde::de::MapAccess<'de>>(
self,
mut __map: __A,
) -> ::core::result::Result<Self::Value, __A::Error> {
let (__tag, __buffered) =
::openehr_base::serde_support::read_slot_tag(&mut __map, __TAGS)?;
match __tag {
Some(::openehr_base::serde_support::TagMatch::Known(__t)) => {
let __rest = ::openehr_base::serde_support::TaggedRest::new(
Some(__t),
__buffered,
__map,
);
match __t {
"ACTOR" => ::core::result::Result::Ok(Versionable::Actor(
::serde::Deserialize::deserialize(__rest)?,
)),
"AGENT" => ::core::result::Result::Ok(Versionable::Agent(
::serde::Deserialize::deserialize(__rest)?,
)),
"GROUP" => ::core::result::Result::Ok(Versionable::Group(
::serde::Deserialize::deserialize(__rest)?,
)),
"ORGANISATION" => {
::core::result::Result::Ok(Versionable::Organisation(
::serde::Deserialize::deserialize(__rest)?,
))
}
"PARTY" => ::core::result::Result::Ok(Versionable::Party(
::serde::Deserialize::deserialize(__rest)?,
)),
"PERSON" => ::core::result::Result::Ok(Versionable::Person(
::serde::Deserialize::deserialize(__rest)?,
)),
"ROLE" => ::core::result::Result::Ok(Versionable::Role(
::serde::Deserialize::deserialize(__rest)?,
)),
__other => ::core::result::Result::Err(
::openehr_base::serde_support::unexpected_type(
"Versionable",
__other,
"ACTOR, AGENT, GROUP, ORGANISATION, PARTY, PERSON, ROLE",
),
),
}
}
Some(::openehr_base::serde_support::TagMatch::Unknown(__other)) => {
::core::result::Result::Err(::openehr_base::serde_support::unexpected_type(
"Versionable",
&__other,
"ACTOR, AGENT, GROUP, ORGANISATION, PARTY, PERSON, ROLE",
))
}
None => {
::core::result::Result::Err(::openehr_base::serde_support::missing_type(
"Versionable",
"ACTOR, AGENT, GROUP, ORGANISATION, PARTY, PERSON, ROLE",
))
}
}
}
}
::serde::Deserializer::deserialize_map(__deserializer, __Visitor)
}
}
pub type UpdateVersion = super::common::UpdateVersion<Versionable>;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NewContribution<T = Versionable> {
#[serde(skip_serializing_if = "Option::is_none")]
pub uid: Option<openehr_base::v1_3::base_types::identification::hier_object_id::HierObjectId>,
pub versions: Vec<super::common::UpdateVersion<T>>,
pub audit: super::common::UpdateAudit,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
}
pub type ItemTagOfPerson = openehr_rm::v1_2::common::tags::item_tag::ItemTag;
pub type ItemTagOfAgent = openehr_rm::v1_2::common::tags::item_tag::ItemTag;
pub type ItemTagOfGroup = openehr_rm::v1_2::common::tags::item_tag::ItemTag;
pub type ItemTagOfOrganisation = openehr_rm::v1_2::common::tags::item_tag::ItemTag;
pub type ItemTagOfRole = openehr_rm::v1_2::common::tags::item_tag::ItemTag;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentCreateParams {
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl AgentCreateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
_matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Self::from_parts(headers)
}
pub(crate) fn from_parts(
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
openehr_item_tag: crate::rest::decode::header_list(headers, "openehr-item-tag")?,
openehr_version_item_tag: crate::rest::decode::header_list(
headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
pub fn agent_create_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<
crate::rest::runtime::Payload<openehr_rm::v1_2::demographic::agent::Agent, serde_json::Value>,
crate::rest::runtime::ApiError,
> {
crate::rest::decode::payload_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentGetParams {
pub uid_based_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub version_at_time: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl AgentGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "version_at_time",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::DateTime,
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
let query = crate::rest::decode::QueryPairs::parse(query)?;
Self::from_parts(&path, &query, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
query: &crate::rest::decode::QueryPairs,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
version_at_time: query.optional("version_at_time")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentUpdateParams {
pub uid_based_id: String,
#[serde(rename = "If-Match")]
pub if_match: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl AgentUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
identifier: Some(crate::rest::routes::IdentifierClass::HierObject),
},
crate::rest::routes::Param {
name: "If-Match",
location: crate::rest::routes::ParamLocation::Header,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
if_match: crate::rest::decode::header_required(headers, "If-Match")?,
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
openehr_version_item_tag: crate::rest::decode::header_list(
headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
pub fn agent_update_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<
crate::rest::runtime::Payload<openehr_rm::v1_2::demographic::agent::Agent, serde_json::Value>,
crate::rest::runtime::ApiError,
> {
crate::rest::decode::payload_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentDeleteParams {
pub uid_based_id: String,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl AgentDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::ObjectVersion),
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupCreateParams {
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl GroupCreateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
_matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Self::from_parts(headers)
}
pub(crate) fn from_parts(
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
openehr_item_tag: crate::rest::decode::header_list(headers, "openehr-item-tag")?,
openehr_version_item_tag: crate::rest::decode::header_list(
headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
pub fn group_create_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<
crate::rest::runtime::Payload<openehr_rm::v1_2::demographic::group::Group, serde_json::Value>,
crate::rest::runtime::ApiError,
> {
crate::rest::decode::payload_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupGetParams {
pub uid_based_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub version_at_time: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl GroupGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "version_at_time",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::DateTime,
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
let query = crate::rest::decode::QueryPairs::parse(query)?;
Self::from_parts(&path, &query, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
query: &crate::rest::decode::QueryPairs,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
version_at_time: query.optional("version_at_time")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupUpdateParams {
pub uid_based_id: String,
#[serde(rename = "If-Match")]
pub if_match: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl GroupUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
identifier: Some(crate::rest::routes::IdentifierClass::HierObject),
},
crate::rest::routes::Param {
name: "If-Match",
location: crate::rest::routes::ParamLocation::Header,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
if_match: crate::rest::decode::header_required(headers, "If-Match")?,
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
openehr_version_item_tag: crate::rest::decode::header_list(
headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
pub fn group_update_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<
crate::rest::runtime::Payload<openehr_rm::v1_2::demographic::group::Group, serde_json::Value>,
crate::rest::runtime::ApiError,
> {
crate::rest::decode::payload_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupDeleteParams {
pub uid_based_id: String,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl GroupDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::ObjectVersion),
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OrganisationCreateParams {
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl OrganisationCreateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
_matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Self::from_parts(headers)
}
pub(crate) fn from_parts(
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
openehr_item_tag: crate::rest::decode::header_list(headers, "openehr-item-tag")?,
openehr_version_item_tag: crate::rest::decode::header_list(
headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
pub fn organisation_create_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<
crate::rest::runtime::Payload<
openehr_rm::v1_2::demographic::organisation::Organisation,
serde_json::Value,
>,
crate::rest::runtime::ApiError,
> {
crate::rest::decode::payload_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OrganisationGetParams {
pub uid_based_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub version_at_time: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl OrganisationGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "version_at_time",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::DateTime,
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
let query = crate::rest::decode::QueryPairs::parse(query)?;
Self::from_parts(&path, &query, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
query: &crate::rest::decode::QueryPairs,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
version_at_time: query.optional("version_at_time")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OrganisationUpdateParams {
pub uid_based_id: String,
#[serde(rename = "If-Match")]
pub if_match: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl OrganisationUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
identifier: Some(crate::rest::routes::IdentifierClass::HierObject),
},
crate::rest::routes::Param {
name: "If-Match",
location: crate::rest::routes::ParamLocation::Header,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
if_match: crate::rest::decode::header_required(headers, "If-Match")?,
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
openehr_version_item_tag: crate::rest::decode::header_list(
headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
pub fn organisation_update_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<
crate::rest::runtime::Payload<
openehr_rm::v1_2::demographic::organisation::Organisation,
serde_json::Value,
>,
crate::rest::runtime::ApiError,
> {
crate::rest::decode::payload_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OrganisationDeleteParams {
pub uid_based_id: String,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl OrganisationDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::ObjectVersion),
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PersonCreateParams {
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl PersonCreateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
_matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Self::from_parts(headers)
}
pub(crate) fn from_parts(
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
openehr_item_tag: crate::rest::decode::header_list(headers, "openehr-item-tag")?,
openehr_version_item_tag: crate::rest::decode::header_list(
headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
pub fn person_create_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<
crate::rest::runtime::Payload<openehr_rm::v1_2::demographic::person::Person, serde_json::Value>,
crate::rest::runtime::ApiError,
> {
crate::rest::decode::payload_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PersonGetParams {
pub uid_based_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub version_at_time: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl PersonGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "version_at_time",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::DateTime,
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
let query = crate::rest::decode::QueryPairs::parse(query)?;
Self::from_parts(&path, &query, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
query: &crate::rest::decode::QueryPairs,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
version_at_time: query.optional("version_at_time")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PersonUpdateParams {
pub uid_based_id: String,
#[serde(rename = "If-Match")]
pub if_match: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl PersonUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
identifier: Some(crate::rest::routes::IdentifierClass::HierObject),
},
crate::rest::routes::Param {
name: "If-Match",
location: crate::rest::routes::ParamLocation::Header,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
if_match: crate::rest::decode::header_required(headers, "If-Match")?,
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
openehr_version_item_tag: crate::rest::decode::header_list(
headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
pub fn person_update_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<
crate::rest::runtime::Payload<openehr_rm::v1_2::demographic::person::Person, serde_json::Value>,
crate::rest::runtime::ApiError,
> {
crate::rest::decode::payload_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PersonDeleteParams {
pub uid_based_id: String,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl PersonDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::ObjectVersion),
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RoleCreateParams {
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl RoleCreateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
_matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Self::from_parts(headers)
}
pub(crate) fn from_parts(
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
openehr_item_tag: crate::rest::decode::header_list(headers, "openehr-item-tag")?,
openehr_version_item_tag: crate::rest::decode::header_list(
headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
pub fn role_create_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<
crate::rest::runtime::Payload<openehr_rm::v1_2::demographic::role::Role, serde_json::Value>,
crate::rest::runtime::ApiError,
> {
crate::rest::decode::payload_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RoleGetParams {
pub uid_based_id: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub version_at_time: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl RoleGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "version_at_time",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::DateTime,
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
let query = crate::rest::decode::QueryPairs::parse(query)?;
Self::from_parts(&path, &query, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
query: &crate::rest::decode::QueryPairs,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
version_at_time: query.optional("version_at_time")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RoleUpdateParams {
pub uid_based_id: String,
#[serde(rename = "If-Match")]
pub if_match: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-version-item-tag")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version_item_tag: Option<Vec<String>>,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl RoleUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
identifier: Some(crate::rest::routes::IdentifierClass::HierObject),
},
crate::rest::routes::Param {
name: "If-Match",
location: crate::rest::routes::ParamLocation::Header,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version-item-tag",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Object),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
if_match: crate::rest::decode::header_required(headers, "If-Match")?,
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
openehr_version_item_tag: crate::rest::decode::header_list(
headers,
"openehr-version-item-tag",
)?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
pub fn role_update_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<
crate::rest::runtime::Payload<openehr_rm::v1_2::demographic::role::Role, serde_json::Value>,
crate::rest::runtime::ApiError,
> {
crate::rest::decode::payload_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RoleDeleteParams {
pub uid_based_id: String,
#[serde(rename = "openehr-version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_version: Option<String>,
#[serde(rename = "openehr-audit-details")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_audit_details: Option<Vec<String>>,
}
impl RoleDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::ObjectVersion),
},
crate::rest::routes::Param {
name: "openehr-version",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-audit-details",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Array(&crate::rest::routes::ParamKind::Text),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
openehr_version: crate::rest::decode::header_optional(headers, "openehr-version")?,
openehr_audit_details: crate::rest::decode::header_list(
headers,
"openehr-audit-details",
)?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionedPartyGetParams {
pub versioned_object_uid: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl VersionedPartyGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "versioned_object_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
identifier: Some(crate::rest::routes::IdentifierClass::HierObject),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
versioned_object_uid: path.value("versioned_object_uid")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionedPartyRevisionHistoryParams {
pub versioned_object_uid: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl VersionedPartyRevisionHistoryParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "versioned_object_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
identifier: Some(crate::rest::routes::IdentifierClass::HierObject),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
versioned_object_uid: path.value("versioned_object_uid")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionedPartyVersionGetAtTimeParams {
pub versioned_object_uid: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub version_at_time: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl VersionedPartyVersionGetAtTimeParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "versioned_object_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
identifier: Some(crate::rest::routes::IdentifierClass::HierObject),
},
crate::rest::routes::Param {
name: "version_at_time",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::DateTime,
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
let query = crate::rest::decode::QueryPairs::parse(query)?;
Self::from_parts(&path, &query, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
query: &crate::rest::decode::QueryPairs,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
versioned_object_uid: path.value("versioned_object_uid")?,
version_at_time: query.optional("version_at_time")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VersionedPartyVersionGetByIdParams {
pub versioned_object_uid: String,
pub version_uid: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl VersionedPartyVersionGetByIdParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "versioned_object_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
identifier: Some(crate::rest::routes::IdentifierClass::HierObject),
},
crate::rest::routes::Param {
name: "version_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::ObjectVersion),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
versioned_object_uid: path.value("versioned_object_uid")?,
version_uid: path.value("version_uid")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ContributionCreateParams {
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "openehr-template-id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub openehr_template_id: Option<String>,
}
impl ContributionCreateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
crate::rest::routes::Param {
name: "openehr-template-id",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
];
pub fn from_request(
_matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Self::from_parts(headers)
}
pub(crate) fn from_parts(
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
openehr_template_id: crate::rest::decode::header_optional(
headers,
"openehr-template-id",
)?,
})
}
}
pub fn contribution_create_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<NewContribution, crate::rest::runtime::ApiError> {
crate::rest::decode::json_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ContributionGetParams {
pub contribution_uid: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl ContributionGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "contribution_uid",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Uuid,
identifier: Some(crate::rest::routes::IdentifierClass::HierObject),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
contribution_uid: path.value("contribution_uid")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct DemographicTagsGetParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_key: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_value: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_target_path: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl DemographicTagsGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "tag_key",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "tag_value",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "tag_target_path",
location: crate::rest::routes::ParamLocation::Query,
required: false,
explode: true,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
_matched: &crate::rest::routes::RouteMatch,
query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let query = crate::rest::decode::QueryPairs::parse(query)?;
Self::from_parts(&query, headers)
}
pub(crate) fn from_parts(
query: &crate::rest::decode::QueryPairs,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
tag_key: query.optional("tag_key")?,
tag_value: query.optional("tag_value")?,
tag_target_path: query.optional("tag_target_path")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentTagsGetParams {
pub uid_based_id: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl AgentTagsGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentTagsUpdateParams {
pub uid_based_id: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl AgentTagsUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
})
}
}
pub fn agent_tags_update_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<Vec<super::common::UpdateItemTag>, crate::rest::runtime::ApiError> {
crate::rest::decode::json_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentTagsDeleteParams {
pub uid_based_id: String,
pub key: String,
}
impl AgentTagsDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "key",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
_headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
key: path.value("key")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupTagsGetParams {
pub uid_based_id: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl GroupTagsGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupTagsUpdateParams {
pub uid_based_id: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl GroupTagsUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
})
}
}
pub fn group_tags_update_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<Vec<super::common::UpdateItemTag>, crate::rest::runtime::ApiError> {
crate::rest::decode::json_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupTagsDeleteParams {
pub uid_based_id: String,
pub key: String,
}
impl GroupTagsDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "key",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
_headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
key: path.value("key")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OrganisationTagsGetParams {
pub uid_based_id: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl OrganisationTagsGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OrganisationTagsUpdateParams {
pub uid_based_id: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl OrganisationTagsUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
})
}
}
pub fn organisation_tags_update_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<Vec<super::common::UpdateItemTag>, crate::rest::runtime::ApiError> {
crate::rest::decode::json_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OrganisationTagsDeleteParams {
pub uid_based_id: String,
pub key: String,
}
impl OrganisationTagsDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "key",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
_headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
key: path.value("key")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PersonTagsGetParams {
pub uid_based_id: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl PersonTagsGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PersonTagsUpdateParams {
pub uid_based_id: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl PersonTagsUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
})
}
}
pub fn person_tags_update_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<Vec<super::common::UpdateItemTag>, crate::rest::runtime::ApiError> {
crate::rest::decode::json_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PersonTagsDeleteParams {
pub uid_based_id: String,
pub key: String,
}
impl PersonTagsDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "key",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
_headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
key: path.value("key")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RoleTagsGetParams {
pub uid_based_id: String,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
}
impl RoleTagsGetParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
})
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RoleTagsUpdateParams {
pub uid_based_id: String,
#[serde(rename = "Prefer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub prefer: Option<String>,
#[serde(rename = "Accept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accept: Option<String>,
#[serde(rename = "Content-Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
}
impl RoleTagsUpdateParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "Prefer",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&[
"return=representation",
"return=minimal",
"return=identifier",
]),
identifier: None,
},
crate::rest::routes::Param {
name: "Accept",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
crate::rest::routes::Param {
name: "Content-Type",
location: crate::rest::routes::ParamLocation::Header,
required: false,
explode: false,
kind: crate::rest::routes::ParamKind::Enum(&["application/json", "application/xml"]),
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path, headers)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
prefer: crate::rest::decode::header_optional(headers, "Prefer")?,
accept: crate::rest::decode::header_optional(headers, "Accept")?,
content_type: crate::rest::decode::header_optional(headers, "Content-Type")?,
})
}
}
pub fn role_tags_update_request_body(
content_type: Option<&http::HeaderValue>,
body: &[u8],
) -> Result<Vec<super::common::UpdateItemTag>, crate::rest::runtime::ApiError> {
crate::rest::decode::json_body(content_type, body)
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RoleTagsDeleteParams {
pub uid_based_id: String,
pub key: String,
}
impl RoleTagsDeleteParams {
pub const PARAMS: &'static [crate::rest::routes::Param] = &[
crate::rest::routes::Param {
name: "uid_based_id",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: Some(crate::rest::routes::IdentifierClass::UidBased),
},
crate::rest::routes::Param {
name: "key",
location: crate::rest::routes::ParamLocation::Path,
required: true,
explode: false,
kind: crate::rest::routes::ParamKind::Text,
identifier: None,
},
];
pub fn from_request(
matched: &crate::rest::routes::RouteMatch,
_query: Option<&str>,
_headers: &http::HeaderMap,
) -> Result<Self, crate::rest::runtime::ApiError> {
let path = crate::rest::decode::PathValues::from_route(matched)?;
Self::from_parts(&path)
}
pub(crate) fn from_parts(
path: &crate::rest::decode::PathValues,
) -> Result<Self, crate::rest::runtime::ApiError> {
Ok(Self {
uid_based_id: path.value("uid_based_id")?,
key: path.value("key")?,
})
}
}
#[derive(Debug, Clone, Default)]
pub struct AgentCreateCreatedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for AgentCreateCreatedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct AgentCreateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for AgentCreateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct AgentGetOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for AgentGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct AgentUpdateOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for AgentUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct AgentUpdateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for AgentUpdateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct AgentUpdatePreconditionFailedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for AgentUpdatePreconditionFailedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct AgentDeleteNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for AgentDeleteNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct AgentDeleteConflictHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for AgentDeleteConflictHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct GroupCreateCreatedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for GroupCreateCreatedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct GroupCreateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for GroupCreateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct GroupGetOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for GroupGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct GroupUpdateOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for GroupUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct GroupUpdateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for GroupUpdateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct GroupUpdatePreconditionFailedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for GroupUpdatePreconditionFailedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct GroupDeleteNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for GroupDeleteNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct GroupDeleteConflictHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for GroupDeleteConflictHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct OrganisationCreateCreatedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for OrganisationCreateCreatedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct OrganisationCreateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for OrganisationCreateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct OrganisationGetOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for OrganisationGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct OrganisationUpdateOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for OrganisationUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct OrganisationUpdateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for OrganisationUpdateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct OrganisationUpdatePreconditionFailedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for OrganisationUpdatePreconditionFailedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct OrganisationDeleteNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for OrganisationDeleteNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct OrganisationDeleteConflictHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for OrganisationDeleteConflictHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct PersonCreateCreatedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for PersonCreateCreatedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct PersonCreateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for PersonCreateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct PersonGetOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for PersonGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct PersonUpdateOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for PersonUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct PersonUpdateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for PersonUpdateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct PersonUpdatePreconditionFailedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for PersonUpdatePreconditionFailedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct PersonDeleteNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for PersonDeleteNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct PersonDeleteConflictHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for PersonDeleteConflictHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct RoleCreateCreatedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for RoleCreateCreatedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct RoleCreateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for RoleCreateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct RoleGetOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for RoleGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct RoleUpdateOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for RoleUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct RoleUpdateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub openehr_item_tag: Vec<String>,
pub openehr_version_item_tag: Vec<String>,
}
impl crate::rest::runtime::ResponseHeaders for RoleUpdateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::append_headers(&mut map, "openehr-item-tag", self.openehr_item_tag)?;
crate::rest::runtime::append_headers(
&mut map,
"openehr-version-item-tag",
self.openehr_version_item_tag,
)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct RoleUpdatePreconditionFailedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for RoleUpdatePreconditionFailedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct RoleDeleteNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for RoleDeleteNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct RoleDeleteConflictHeaders {
pub etag: Option<String>,
pub location: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for RoleDeleteConflictHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct VersionedPartyGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for VersionedPartyGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct VersionedPartyRevisionHistoryOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for VersionedPartyRevisionHistoryOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct VersionedPartyVersionGetAtTimeOkHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for VersionedPartyVersionGetAtTimeOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct VersionedPartyVersionGetByIdOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for VersionedPartyVersionGetByIdOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct ContributionCreateCreatedHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for ContributionCreateCreatedHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct ContributionCreateNoContentHeaders {
pub etag: Option<String>,
pub location: Option<String>,
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for ContributionCreateNoContentHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "ETag", self.etag)?;
crate::rest::runtime::set_header(&mut map, "Location", self.location)?;
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct ContributionGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for ContributionGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct DemographicTagsGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for DemographicTagsGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct AgentTagsGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for AgentTagsGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct AgentTagsUpdateOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for AgentTagsUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct GroupTagsGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for GroupTagsGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct GroupTagsUpdateOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for GroupTagsUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct OrganisationTagsGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for OrganisationTagsGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct OrganisationTagsUpdateOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for OrganisationTagsUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct PersonTagsGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for PersonTagsGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct PersonTagsUpdateOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for PersonTagsUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct RoleTagsGetOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for RoleTagsGetOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[derive(Debug, Clone, Default)]
pub struct RoleTagsUpdateOkHeaders {
pub content_type: Option<String>,
}
impl crate::rest::runtime::ResponseHeaders for RoleTagsUpdateOkHeaders {
fn into_header_map(self) -> Result<http::HeaderMap, crate::rest::runtime::HeaderError> {
let mut map = http::HeaderMap::new();
crate::rest::runtime::set_header(&mut map, "Content-Type", self.content_type)?;
Ok(map)
}
}
#[cfg(feature = "rest-server")]
pub mod server {
use super::*;
#[derive(Debug, Clone)]
pub enum AgentCreateResponse {
Created {
body: Option<
crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::agent::Agent>,
>,
headers: AgentCreateCreatedHeaders,
},
NoContent {
headers: AgentCreateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum AgentGetResponse {
Ok {
body: openehr_rm::v1_2::demographic::agent::Agent,
headers: AgentGetOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum AgentUpdateResponse {
Ok {
body: crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::agent::Agent>,
headers: AgentUpdateOkHeaders,
},
NoContent {
headers: AgentUpdateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum AgentDeleteResponse {
NoContent {
headers: AgentDeleteNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum GroupCreateResponse {
Created {
body: Option<
crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::group::Group>,
>,
headers: GroupCreateCreatedHeaders,
},
NoContent {
headers: GroupCreateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum GroupGetResponse {
Ok {
body: openehr_rm::v1_2::demographic::group::Group,
headers: GroupGetOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum GroupUpdateResponse {
Ok {
body: crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::group::Group>,
headers: GroupUpdateOkHeaders,
},
NoContent {
headers: GroupUpdateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum GroupDeleteResponse {
NoContent {
headers: GroupDeleteNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum OrganisationCreateResponse {
Created {
body: Option<
crate::rest::runtime::Representation<
openehr_rm::v1_2::demographic::organisation::Organisation,
>,
>,
headers: OrganisationCreateCreatedHeaders,
},
NoContent {
headers: OrganisationCreateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum OrganisationGetResponse {
Ok {
body: openehr_rm::v1_2::demographic::organisation::Organisation,
headers: OrganisationGetOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum OrganisationUpdateResponse {
Ok {
body: crate::rest::runtime::Representation<
openehr_rm::v1_2::demographic::organisation::Organisation,
>,
headers: OrganisationUpdateOkHeaders,
},
NoContent {
headers: OrganisationUpdateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum OrganisationDeleteResponse {
NoContent {
headers: OrganisationDeleteNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum PersonCreateResponse {
Created {
body: Option<
crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::person::Person>,
>,
headers: PersonCreateCreatedHeaders,
},
NoContent {
headers: PersonCreateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum PersonGetResponse {
Ok {
body: openehr_rm::v1_2::demographic::person::Person,
headers: PersonGetOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum PersonUpdateResponse {
Ok {
body:
crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::person::Person>,
headers: PersonUpdateOkHeaders,
},
NoContent {
headers: PersonUpdateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum PersonDeleteResponse {
NoContent {
headers: PersonDeleteNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum RoleCreateResponse {
Created {
body: Option<
crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::role::Role>,
>,
headers: RoleCreateCreatedHeaders,
},
NoContent {
headers: RoleCreateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum RoleGetResponse {
Ok {
body: openehr_rm::v1_2::demographic::role::Role,
headers: RoleGetOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum RoleUpdateResponse {
Ok {
body: crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::role::Role>,
headers: RoleUpdateOkHeaders,
},
NoContent {
headers: RoleUpdateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum RoleDeleteResponse {
NoContent {
headers: RoleDeleteNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedPartyGetResponse {
Ok {
body: openehr_rm::v1_2::demographic::versioned_party::VersionedParty,
headers: VersionedPartyGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedPartyRevisionHistoryResponse {
Ok {
body: openehr_rm::v1_2::common::generic::revision_history::RevisionHistory,
headers: VersionedPartyRevisionHistoryOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedPartyVersionGetAtTimeResponse {
Ok {
body: VersionOfParty,
headers: VersionedPartyVersionGetAtTimeOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedPartyVersionGetByIdResponse {
Ok {
body: VersionOfParty,
headers: VersionedPartyVersionGetByIdOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum ContributionCreateResponse {
Created {
body: Option<
crate::rest::runtime::Representation<
openehr_rm::v1_2::common::change_control::contribution::Contribution,
>,
>,
headers: ContributionCreateCreatedHeaders,
},
NoContent {
headers: ContributionCreateNoContentHeaders,
},
}
#[derive(Debug, Clone)]
pub enum ContributionGetResponse {
Ok {
body: openehr_rm::v1_2::common::change_control::contribution::Contribution,
headers: ContributionGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum DemographicTagsGetResponse {
Ok {
body: Vec<ItemTagOfPerson>,
headers: DemographicTagsGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum AgentTagsGetResponse {
Ok {
body: Vec<ItemTagOfAgent>,
headers: AgentTagsGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum AgentTagsUpdateResponse {
Ok {
body: Vec<ItemTagOfAgent>,
headers: AgentTagsUpdateOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum AgentTagsDeleteResponse {
NoContent,
}
#[derive(Debug, Clone)]
pub enum GroupTagsGetResponse {
Ok {
body: Vec<ItemTagOfGroup>,
headers: GroupTagsGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum GroupTagsUpdateResponse {
Ok {
body: Vec<ItemTagOfGroup>,
headers: GroupTagsUpdateOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum GroupTagsDeleteResponse {
NoContent,
}
#[derive(Debug, Clone)]
pub enum OrganisationTagsGetResponse {
Ok {
body: Vec<ItemTagOfOrganisation>,
headers: OrganisationTagsGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum OrganisationTagsUpdateResponse {
Ok {
body: Vec<ItemTagOfOrganisation>,
headers: OrganisationTagsUpdateOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum OrganisationTagsDeleteResponse {
NoContent,
}
#[derive(Debug, Clone)]
pub enum PersonTagsGetResponse {
Ok {
body: Vec<ItemTagOfPerson>,
headers: PersonTagsGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum PersonTagsUpdateResponse {
Ok {
body: Vec<ItemTagOfPerson>,
headers: PersonTagsUpdateOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum PersonTagsDeleteResponse {
NoContent,
}
#[derive(Debug, Clone)]
pub enum RoleTagsGetResponse {
Ok {
body: Vec<ItemTagOfRole>,
headers: RoleTagsGetOkHeaders,
},
}
#[derive(Debug, Clone)]
pub enum RoleTagsUpdateResponse {
Ok {
body: Vec<ItemTagOfRole>,
headers: RoleTagsUpdateOkHeaders,
},
NoContent,
}
#[derive(Debug, Clone)]
pub enum RoleTagsDeleteResponse {
NoContent,
}
#[async_trait::async_trait]
pub trait DemographicApi {
async fn agent_create(
&self,
params: AgentCreateParams,
body: crate::rest::runtime::Payload<
openehr_rm::v1_2::demographic::agent::Agent,
serde_json::Value,
>,
) -> Result<AgentCreateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn agent_get(
&self,
params: AgentGetParams,
) -> Result<AgentGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn agent_update(
&self,
params: AgentUpdateParams,
body: crate::rest::runtime::Payload<
openehr_rm::v1_2::demographic::agent::Agent,
serde_json::Value,
>,
) -> Result<AgentUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn agent_delete(
&self,
params: AgentDeleteParams,
) -> Result<AgentDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn group_create(
&self,
params: GroupCreateParams,
body: crate::rest::runtime::Payload<
openehr_rm::v1_2::demographic::group::Group,
serde_json::Value,
>,
) -> Result<GroupCreateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn group_get(
&self,
params: GroupGetParams,
) -> Result<GroupGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn group_update(
&self,
params: GroupUpdateParams,
body: crate::rest::runtime::Payload<
openehr_rm::v1_2::demographic::group::Group,
serde_json::Value,
>,
) -> Result<GroupUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn group_delete(
&self,
params: GroupDeleteParams,
) -> Result<GroupDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn organisation_create(
&self,
params: OrganisationCreateParams,
body: crate::rest::runtime::Payload<
openehr_rm::v1_2::demographic::organisation::Organisation,
serde_json::Value,
>,
) -> Result<OrganisationCreateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn organisation_get(
&self,
params: OrganisationGetParams,
) -> Result<OrganisationGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn organisation_update(
&self,
params: OrganisationUpdateParams,
body: crate::rest::runtime::Payload<
openehr_rm::v1_2::demographic::organisation::Organisation,
serde_json::Value,
>,
) -> Result<OrganisationUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn organisation_delete(
&self,
params: OrganisationDeleteParams,
) -> Result<OrganisationDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn person_create(
&self,
params: PersonCreateParams,
body: crate::rest::runtime::Payload<
openehr_rm::v1_2::demographic::person::Person,
serde_json::Value,
>,
) -> Result<PersonCreateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn person_get(
&self,
params: PersonGetParams,
) -> Result<PersonGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn person_update(
&self,
params: PersonUpdateParams,
body: crate::rest::runtime::Payload<
openehr_rm::v1_2::demographic::person::Person,
serde_json::Value,
>,
) -> Result<PersonUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn person_delete(
&self,
params: PersonDeleteParams,
) -> Result<PersonDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn role_create(
&self,
params: RoleCreateParams,
body: crate::rest::runtime::Payload<
openehr_rm::v1_2::demographic::role::Role,
serde_json::Value,
>,
) -> Result<RoleCreateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn role_get(
&self,
params: RoleGetParams,
) -> Result<RoleGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn role_update(
&self,
params: RoleUpdateParams,
body: crate::rest::runtime::Payload<
openehr_rm::v1_2::demographic::role::Role,
serde_json::Value,
>,
) -> Result<RoleUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn role_delete(
&self,
params: RoleDeleteParams,
) -> Result<RoleDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn versioned_party_get(
&self,
params: VersionedPartyGetParams,
) -> Result<VersionedPartyGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn versioned_party_revision_history(
&self,
params: VersionedPartyRevisionHistoryParams,
) -> Result<VersionedPartyRevisionHistoryResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn versioned_party_version_get_at_time(
&self,
params: VersionedPartyVersionGetAtTimeParams,
) -> Result<VersionedPartyVersionGetAtTimeResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn versioned_party_version_get_by_id(
&self,
params: VersionedPartyVersionGetByIdParams,
) -> Result<VersionedPartyVersionGetByIdResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn contribution_create(
&self,
params: ContributionCreateParams,
body: NewContribution,
) -> Result<ContributionCreateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn contribution_get(
&self,
params: ContributionGetParams,
) -> Result<ContributionGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn demographic_tags_get(
&self,
params: DemographicTagsGetParams,
) -> Result<DemographicTagsGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn agent_tags_get(
&self,
params: AgentTagsGetParams,
) -> Result<AgentTagsGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn agent_tags_update(
&self,
params: AgentTagsUpdateParams,
body: Vec<super::super::common::UpdateItemTag>,
) -> Result<AgentTagsUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn agent_tags_delete(
&self,
params: AgentTagsDeleteParams,
) -> Result<AgentTagsDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn group_tags_get(
&self,
params: GroupTagsGetParams,
) -> Result<GroupTagsGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn group_tags_update(
&self,
params: GroupTagsUpdateParams,
body: Vec<super::super::common::UpdateItemTag>,
) -> Result<GroupTagsUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn group_tags_delete(
&self,
params: GroupTagsDeleteParams,
) -> Result<GroupTagsDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn organisation_tags_get(
&self,
params: OrganisationTagsGetParams,
) -> Result<OrganisationTagsGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn organisation_tags_update(
&self,
params: OrganisationTagsUpdateParams,
body: Vec<super::super::common::UpdateItemTag>,
) -> Result<OrganisationTagsUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn organisation_tags_delete(
&self,
params: OrganisationTagsDeleteParams,
) -> Result<OrganisationTagsDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn person_tags_get(
&self,
params: PersonTagsGetParams,
) -> Result<PersonTagsGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn person_tags_update(
&self,
params: PersonTagsUpdateParams,
body: Vec<super::super::common::UpdateItemTag>,
) -> Result<PersonTagsUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn person_tags_delete(
&self,
params: PersonTagsDeleteParams,
) -> Result<PersonTagsDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn role_tags_get(
&self,
params: RoleTagsGetParams,
) -> Result<RoleTagsGetResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn role_tags_update(
&self,
params: RoleTagsUpdateParams,
body: Vec<super::super::common::UpdateItemTag>,
) -> Result<RoleTagsUpdateResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
async fn role_tags_delete(
&self,
params: RoleTagsDeleteParams,
) -> Result<RoleTagsDeleteResponse, crate::rest::runtime::Refusal> {
Err(crate::rest::runtime::ApiError::NotImplemented.into())
}
}
pub fn router<S>(api: std::sync::Arc<S>) -> axum::Router
where
S: DemographicApi + Send + Sync + 'static,
{
axum::Router::new()
.route(
"/demographic/agent",
axum::routing::on(axum::routing::MethodFilter::POST, handle_agent_create::<S>),
)
.route(
"/demographic/agent/{p3}",
axum::routing::on(axum::routing::MethodFilter::GET, handle_agent_get::<S>),
)
.route(
"/demographic/agent/{p3}",
axum::routing::on(axum::routing::MethodFilter::PUT, handle_agent_update::<S>),
)
.route(
"/demographic/agent/{p3}",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_agent_delete::<S>,
),
)
.route(
"/demographic/group",
axum::routing::on(axum::routing::MethodFilter::POST, handle_group_create::<S>),
)
.route(
"/demographic/group/{p3}",
axum::routing::on(axum::routing::MethodFilter::GET, handle_group_get::<S>),
)
.route(
"/demographic/group/{p3}",
axum::routing::on(axum::routing::MethodFilter::PUT, handle_group_update::<S>),
)
.route(
"/demographic/group/{p3}",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_group_delete::<S>,
),
)
.route(
"/demographic/organisation",
axum::routing::on(
axum::routing::MethodFilter::POST,
handle_organisation_create::<S>,
),
)
.route(
"/demographic/organisation/{p3}",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_organisation_get::<S>,
),
)
.route(
"/demographic/organisation/{p3}",
axum::routing::on(
axum::routing::MethodFilter::PUT,
handle_organisation_update::<S>,
),
)
.route(
"/demographic/organisation/{p3}",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_organisation_delete::<S>,
),
)
.route(
"/demographic/person",
axum::routing::on(axum::routing::MethodFilter::POST, handle_person_create::<S>),
)
.route(
"/demographic/person/{p3}",
axum::routing::on(axum::routing::MethodFilter::GET, handle_person_get::<S>),
)
.route(
"/demographic/person/{p3}",
axum::routing::on(axum::routing::MethodFilter::PUT, handle_person_update::<S>),
)
.route(
"/demographic/person/{p3}",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_person_delete::<S>,
),
)
.route(
"/demographic/role",
axum::routing::on(axum::routing::MethodFilter::POST, handle_role_create::<S>),
)
.route(
"/demographic/role/{p3}",
axum::routing::on(axum::routing::MethodFilter::GET, handle_role_get::<S>),
)
.route(
"/demographic/role/{p3}",
axum::routing::on(axum::routing::MethodFilter::PUT, handle_role_update::<S>),
)
.route(
"/demographic/role/{p3}",
axum::routing::on(axum::routing::MethodFilter::DELETE, handle_role_delete::<S>),
)
.route(
"/demographic/versioned_party/{p3}",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_versioned_party_get::<S>,
),
)
.route(
"/demographic/versioned_party/{p3}/revision_history",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_versioned_party_revision_history::<S>,
),
)
.route(
"/demographic/versioned_party/{p3}/version",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_versioned_party_version_get_at_time::<S>,
),
)
.route(
"/demographic/versioned_party/{p3}/version/{p5}",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_versioned_party_version_get_by_id::<S>,
),
)
.route(
"/demographic/contribution",
axum::routing::on(
axum::routing::MethodFilter::POST,
handle_contribution_create::<S>,
),
)
.route(
"/demographic/contribution/{p3}",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_contribution_get::<S>,
),
)
.route(
"/demographic/tags",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_demographic_tags_get::<S>,
),
)
.route(
"/demographic/agent/{p3}/tags",
axum::routing::on(axum::routing::MethodFilter::GET, handle_agent_tags_get::<S>),
)
.route(
"/demographic/agent/{p3}/tags",
axum::routing::on(
axum::routing::MethodFilter::PUT,
handle_agent_tags_update::<S>,
),
)
.route(
"/demographic/agent/{p3}/tags/{p5}",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_agent_tags_delete::<S>,
),
)
.route(
"/demographic/group/{p3}/tags",
axum::routing::on(axum::routing::MethodFilter::GET, handle_group_tags_get::<S>),
)
.route(
"/demographic/group/{p3}/tags",
axum::routing::on(
axum::routing::MethodFilter::PUT,
handle_group_tags_update::<S>,
),
)
.route(
"/demographic/group/{p3}/tags/{p5}",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_group_tags_delete::<S>,
),
)
.route(
"/demographic/organisation/{p3}/tags",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_organisation_tags_get::<S>,
),
)
.route(
"/demographic/organisation/{p3}/tags",
axum::routing::on(
axum::routing::MethodFilter::PUT,
handle_organisation_tags_update::<S>,
),
)
.route(
"/demographic/organisation/{p3}/tags/{p5}",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_organisation_tags_delete::<S>,
),
)
.route(
"/demographic/person/{p3}/tags",
axum::routing::on(
axum::routing::MethodFilter::GET,
handle_person_tags_get::<S>,
),
)
.route(
"/demographic/person/{p3}/tags",
axum::routing::on(
axum::routing::MethodFilter::PUT,
handle_person_tags_update::<S>,
),
)
.route(
"/demographic/person/{p3}/tags/{p5}",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_person_tags_delete::<S>,
),
)
.route(
"/demographic/role/{p3}/tags",
axum::routing::on(axum::routing::MethodFilter::GET, handle_role_tags_get::<S>),
)
.route(
"/demographic/role/{p3}/tags",
axum::routing::on(
axum::routing::MethodFilter::PUT,
handle_role_tags_update::<S>,
),
)
.route(
"/demographic/role/{p3}/tags/{p5}",
axum::routing::on(
axum::routing::MethodFilter::DELETE,
handle_role_tags_delete::<S>,
),
)
.with_state(api)
}
async fn handle_agent_create<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let params = AgentCreateParams::from_parts(&headers)?;
let body = agent_create_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply = match api.agent_create(params, body).await? {
AgentCreateResponse::Created { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::CREATED);
if let Some(body) = body.as_ref() {
reply.json(body)?;
}
reply.headers(headers)?;
reply
}
AgentCreateResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_agent_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let query = crate::rest::decode::QueryPairs::parse(query.as_deref())?;
let params = AgentGetParams::from_parts(&path, &query, &headers)?;
let reply: crate::rest::server::Reply = match api.agent_get(params).await? {
AgentGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
AgentGetResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_agent_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = AgentUpdateParams::from_parts(&path, &headers)?;
let body = agent_update_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply = match api.agent_update(params, body).await? {
AgentUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
AgentUpdateResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_agent_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = AgentDeleteParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply = match api.agent_delete(params).await? {
AgentDeleteResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_group_create<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let params = GroupCreateParams::from_parts(&headers)?;
let body = group_create_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply = match api.group_create(params, body).await? {
GroupCreateResponse::Created { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::CREATED);
if let Some(body) = body.as_ref() {
reply.json(body)?;
}
reply.headers(headers)?;
reply
}
GroupCreateResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_group_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let query = crate::rest::decode::QueryPairs::parse(query.as_deref())?;
let params = GroupGetParams::from_parts(&path, &query, &headers)?;
let reply: crate::rest::server::Reply = match api.group_get(params).await? {
GroupGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
GroupGetResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_group_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = GroupUpdateParams::from_parts(&path, &headers)?;
let body = group_update_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply = match api.group_update(params, body).await? {
GroupUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
GroupUpdateResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_group_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = GroupDeleteParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply = match api.group_delete(params).await? {
GroupDeleteResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_organisation_create<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let params = OrganisationCreateParams::from_parts(&headers)?;
let body =
organisation_create_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply =
match api.organisation_create(params, body).await? {
OrganisationCreateResponse::Created { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::CREATED);
if let Some(body) = body.as_ref() {
reply.json(body)?;
}
reply.headers(headers)?;
reply
}
OrganisationCreateResponse::NoContent { headers } => {
let mut reply =
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_organisation_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let query = crate::rest::decode::QueryPairs::parse(query.as_deref())?;
let params = OrganisationGetParams::from_parts(&path, &query, &headers)?;
let reply: crate::rest::server::Reply = match api.organisation_get(params).await? {
OrganisationGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
OrganisationGetResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_organisation_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = OrganisationUpdateParams::from_parts(&path, &headers)?;
let body =
organisation_update_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply =
match api.organisation_update(params, body).await? {
OrganisationUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
OrganisationUpdateResponse::NoContent { headers } => {
let mut reply =
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_organisation_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = OrganisationDeleteParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply = match api.organisation_delete(params).await? {
OrganisationDeleteResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_person_create<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let params = PersonCreateParams::from_parts(&headers)?;
let body = person_create_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply = match api.person_create(params, body).await? {
PersonCreateResponse::Created { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::CREATED);
if let Some(body) = body.as_ref() {
reply.json(body)?;
}
reply.headers(headers)?;
reply
}
PersonCreateResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_person_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let query = crate::rest::decode::QueryPairs::parse(query.as_deref())?;
let params = PersonGetParams::from_parts(&path, &query, &headers)?;
let reply: crate::rest::server::Reply = match api.person_get(params).await? {
PersonGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
PersonGetResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_person_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = PersonUpdateParams::from_parts(&path, &headers)?;
let body = person_update_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply = match api.person_update(params, body).await? {
PersonUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
PersonUpdateResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_person_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = PersonDeleteParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply = match api.person_delete(params).await? {
PersonDeleteResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_role_create<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let params = RoleCreateParams::from_parts(&headers)?;
let body = role_create_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply = match api.role_create(params, body).await? {
RoleCreateResponse::Created { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::CREATED);
if let Some(body) = body.as_ref() {
reply.json(body)?;
}
reply.headers(headers)?;
reply
}
RoleCreateResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_role_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let query = crate::rest::decode::QueryPairs::parse(query.as_deref())?;
let params = RoleGetParams::from_parts(&path, &query, &headers)?;
let reply: crate::rest::server::Reply = match api.role_get(params).await? {
RoleGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
RoleGetResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_role_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = RoleUpdateParams::from_parts(&path, &headers)?;
let body = role_update_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply = match api.role_update(params, body).await? {
RoleUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
RoleUpdateResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_role_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = RoleDeleteParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply = match api.role_delete(params).await? {
RoleDeleteResponse::NoContent { headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_versioned_party_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "versioned_object_uid")])?;
let params = VersionedPartyGetParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply = match api.versioned_party_get(params).await? {
VersionedPartyGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_versioned_party_revision_history<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "versioned_object_uid")])?;
let params = VersionedPartyRevisionHistoryParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply =
match api.versioned_party_revision_history(params).await? {
VersionedPartyRevisionHistoryResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_versioned_party_version_get_at_time<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "versioned_object_uid")])?;
let query = crate::rest::decode::QueryPairs::parse(query.as_deref())?;
let params = VersionedPartyVersionGetAtTimeParams::from_parts(&path, &query, &headers)?;
let reply: crate::rest::server::Reply =
match api.versioned_party_version_get_at_time(params).await? {
VersionedPartyVersionGetAtTimeResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_versioned_party_version_get_by_id<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(
path,
&[("p5", "version_uid"), ("p3", "versioned_object_uid")],
)?;
let params = VersionedPartyVersionGetByIdParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply =
match api.versioned_party_version_get_by_id(params).await? {
VersionedPartyVersionGetByIdResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_contribution_create<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let params = ContributionCreateParams::from_parts(&headers)?;
let body =
contribution_create_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply =
match api.contribution_create(params, body).await? {
ContributionCreateResponse::Created { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::CREATED);
if let Some(body) = body.as_ref() {
reply.json(body)?;
}
reply.headers(headers)?;
reply
}
ContributionCreateResponse::NoContent { headers } => {
let mut reply =
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT);
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_contribution_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "contribution_uid")])?;
let params = ContributionGetParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply = match api.contribution_get(params).await? {
ContributionGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_demographic_tags_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
axum::extract::RawQuery(query): axum::extract::RawQuery,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let query = crate::rest::decode::QueryPairs::parse(query.as_deref())?;
let params = DemographicTagsGetParams::from_parts(&query, &headers)?;
let reply: crate::rest::server::Reply = match api.demographic_tags_get(params).await? {
DemographicTagsGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_agent_tags_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = AgentTagsGetParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply = match api.agent_tags_get(params).await? {
AgentTagsGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_agent_tags_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = AgentTagsUpdateParams::from_parts(&path, &headers)?;
let body =
agent_tags_update_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply =
match api.agent_tags_update(params, body).await? {
AgentTagsUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
AgentTagsUpdateResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_agent_tags_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path =
crate::rest::server::path_captures(path, &[("p5", "key"), ("p3", "uid_based_id")])?;
let params = AgentTagsDeleteParams::from_parts(&path)?;
let reply: crate::rest::server::Reply = match api.agent_tags_delete(params).await? {
AgentTagsDeleteResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_group_tags_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = GroupTagsGetParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply = match api.group_tags_get(params).await? {
GroupTagsGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_group_tags_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = GroupTagsUpdateParams::from_parts(&path, &headers)?;
let body =
group_tags_update_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply =
match api.group_tags_update(params, body).await? {
GroupTagsUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
GroupTagsUpdateResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_group_tags_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path =
crate::rest::server::path_captures(path, &[("p5", "key"), ("p3", "uid_based_id")])?;
let params = GroupTagsDeleteParams::from_parts(&path)?;
let reply: crate::rest::server::Reply = match api.group_tags_delete(params).await? {
GroupTagsDeleteResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_organisation_tags_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = OrganisationTagsGetParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply = match api.organisation_tags_get(params).await? {
OrganisationTagsGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_organisation_tags_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = OrganisationTagsUpdateParams::from_parts(&path, &headers)?;
let body = organisation_tags_update_request_body(
headers.get(http::header::CONTENT_TYPE),
&body,
)?;
let reply: crate::rest::server::Reply =
match api.organisation_tags_update(params, body).await? {
OrganisationTagsUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
OrganisationTagsUpdateResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_organisation_tags_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path =
crate::rest::server::path_captures(path, &[("p5", "key"), ("p3", "uid_based_id")])?;
let params = OrganisationTagsDeleteParams::from_parts(&path)?;
let reply: crate::rest::server::Reply =
match api.organisation_tags_delete(params).await? {
OrganisationTagsDeleteResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_person_tags_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = PersonTagsGetParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply = match api.person_tags_get(params).await? {
PersonTagsGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_person_tags_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = PersonTagsUpdateParams::from_parts(&path, &headers)?;
let body =
person_tags_update_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply =
match api.person_tags_update(params, body).await? {
PersonTagsUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
PersonTagsUpdateResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_person_tags_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path =
crate::rest::server::path_captures(path, &[("p5", "key"), ("p3", "uid_based_id")])?;
let params = PersonTagsDeleteParams::from_parts(&path)?;
let reply: crate::rest::server::Reply = match api.person_tags_delete(params).await? {
PersonTagsDeleteResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_role_tags_get<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = RoleTagsGetParams::from_parts(&path, &headers)?;
let reply: crate::rest::server::Reply = match api.role_tags_get(params).await? {
RoleTagsGetResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_role_tags_update<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
headers: http::HeaderMap,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
body: axum::body::Bytes,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path = crate::rest::server::path_captures(path, &[("p3", "uid_based_id")])?;
let params = RoleTagsUpdateParams::from_parts(&path, &headers)?;
let body =
role_tags_update_request_body(headers.get(http::header::CONTENT_TYPE), &body)?;
let reply: crate::rest::server::Reply = match api.role_tags_update(params, body).await?
{
RoleTagsUpdateResponse::Ok { body, headers } => {
let mut reply = crate::rest::server::Reply::new(http::StatusCode::OK);
reply.json(&body)?;
reply.headers(headers)?;
reply
}
RoleTagsUpdateResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
async fn handle_role_tags_delete<S>(
axum::extract::State(api): axum::extract::State<std::sync::Arc<S>>,
path: Result<
axum::extract::RawPathParams,
axum::extract::rejection::RawPathParamsRejection,
>,
) -> axum::response::Response
where
S: DemographicApi + Send + Sync + 'static,
{
let served: Result<axum::response::Response, crate::rest::runtime::Refusal> = async {
let path =
crate::rest::server::path_captures(path, &[("p5", "key"), ("p3", "uid_based_id")])?;
let params = RoleTagsDeleteParams::from_parts(&path)?;
let reply: crate::rest::server::Reply = match api.role_tags_delete(params).await? {
RoleTagsDeleteResponse::NoContent => {
crate::rest::server::Reply::new(http::StatusCode::NO_CONTENT)
}
};
Ok(reply.finish())
}
.await;
crate::rest::server::respond(served)
}
}
#[cfg(feature = "rest-client")]
pub mod client {
use super::*;
#[derive(Debug, Clone)]
pub enum AgentCreateOutcome {
Created {
body: Option<
crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::agent::Agent>,
>,
headers: AgentCreateCreatedHeaders,
},
NoContent {
headers: AgentCreateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
UnprocessableEntity {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum AgentGetOutcome {
Ok {
body: openehr_rm::v1_2::demographic::agent::Agent,
headers: AgentGetOkHeaders,
},
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum AgentUpdateOutcome {
Ok {
body: crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::agent::Agent>,
headers: AgentUpdateOkHeaders,
},
NoContent {
headers: AgentUpdateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
PreconditionFailed {
body: crate::rest::client::ErrorBody,
headers: AgentUpdatePreconditionFailedHeaders,
},
UnprocessableEntity {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum AgentDeleteOutcome {
NoContent {
headers: AgentDeleteNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
Conflict {
body: crate::rest::client::ErrorBody,
headers: AgentDeleteConflictHeaders,
},
}
#[derive(Debug, Clone)]
pub enum GroupCreateOutcome {
Created {
body: Option<
crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::group::Group>,
>,
headers: GroupCreateCreatedHeaders,
},
NoContent {
headers: GroupCreateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
UnprocessableEntity {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum GroupGetOutcome {
Ok {
body: openehr_rm::v1_2::demographic::group::Group,
headers: GroupGetOkHeaders,
},
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum GroupUpdateOutcome {
Ok {
body: crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::group::Group>,
headers: GroupUpdateOkHeaders,
},
NoContent {
headers: GroupUpdateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
PreconditionFailed {
body: crate::rest::client::ErrorBody,
headers: GroupUpdatePreconditionFailedHeaders,
},
UnprocessableEntity {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum GroupDeleteOutcome {
NoContent {
headers: GroupDeleteNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
Conflict {
body: crate::rest::client::ErrorBody,
headers: GroupDeleteConflictHeaders,
},
}
#[derive(Debug, Clone)]
pub enum OrganisationCreateOutcome {
Created {
body: Option<
crate::rest::runtime::Representation<
openehr_rm::v1_2::demographic::organisation::Organisation,
>,
>,
headers: OrganisationCreateCreatedHeaders,
},
NoContent {
headers: OrganisationCreateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
UnprocessableEntity {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum OrganisationGetOutcome {
Ok {
body: openehr_rm::v1_2::demographic::organisation::Organisation,
headers: OrganisationGetOkHeaders,
},
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum OrganisationUpdateOutcome {
Ok {
body: crate::rest::runtime::Representation<
openehr_rm::v1_2::demographic::organisation::Organisation,
>,
headers: OrganisationUpdateOkHeaders,
},
NoContent {
headers: OrganisationUpdateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
PreconditionFailed {
body: crate::rest::client::ErrorBody,
headers: OrganisationUpdatePreconditionFailedHeaders,
},
UnprocessableEntity {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum OrganisationDeleteOutcome {
NoContent {
headers: OrganisationDeleteNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
Conflict {
body: crate::rest::client::ErrorBody,
headers: OrganisationDeleteConflictHeaders,
},
}
#[derive(Debug, Clone)]
pub enum PersonCreateOutcome {
Created {
body: Option<
crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::person::Person>,
>,
headers: PersonCreateCreatedHeaders,
},
NoContent {
headers: PersonCreateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
UnprocessableEntity {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum PersonGetOutcome {
Ok {
body: openehr_rm::v1_2::demographic::person::Person,
headers: PersonGetOkHeaders,
},
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum PersonUpdateOutcome {
Ok {
body:
crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::person::Person>,
headers: PersonUpdateOkHeaders,
},
NoContent {
headers: PersonUpdateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
PreconditionFailed {
body: crate::rest::client::ErrorBody,
headers: PersonUpdatePreconditionFailedHeaders,
},
UnprocessableEntity {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum PersonDeleteOutcome {
NoContent {
headers: PersonDeleteNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
Conflict {
body: crate::rest::client::ErrorBody,
headers: PersonDeleteConflictHeaders,
},
}
#[derive(Debug, Clone)]
pub enum RoleCreateOutcome {
Created {
body: Option<
crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::role::Role>,
>,
headers: RoleCreateCreatedHeaders,
},
NoContent {
headers: RoleCreateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
UnprocessableEntity {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum RoleGetOutcome {
Ok {
body: openehr_rm::v1_2::demographic::role::Role,
headers: RoleGetOkHeaders,
},
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum RoleUpdateOutcome {
Ok {
body: crate::rest::runtime::Representation<openehr_rm::v1_2::demographic::role::Role>,
headers: RoleUpdateOkHeaders,
},
NoContent {
headers: RoleUpdateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
PreconditionFailed {
body: crate::rest::client::ErrorBody,
headers: RoleUpdatePreconditionFailedHeaders,
},
UnprocessableEntity {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum RoleDeleteOutcome {
NoContent {
headers: RoleDeleteNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
Conflict {
body: crate::rest::client::ErrorBody,
headers: RoleDeleteConflictHeaders,
},
}
#[derive(Debug, Clone)]
pub enum VersionedPartyGetOutcome {
Ok {
body: openehr_rm::v1_2::demographic::versioned_party::VersionedParty,
headers: VersionedPartyGetOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum VersionedPartyRevisionHistoryOutcome {
Ok {
body: openehr_rm::v1_2::common::generic::revision_history::RevisionHistory,
headers: VersionedPartyRevisionHistoryOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum VersionedPartyVersionGetAtTimeOutcome {
Ok {
body: VersionOfParty,
headers: VersionedPartyVersionGetAtTimeOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum VersionedPartyVersionGetByIdOutcome {
Ok {
body: VersionOfParty,
headers: VersionedPartyVersionGetByIdOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum ContributionCreateOutcome {
Created {
body: Option<
crate::rest::runtime::Representation<
openehr_rm::v1_2::common::change_control::contribution::Contribution,
>,
>,
headers: ContributionCreateCreatedHeaders,
},
NoContent {
headers: ContributionCreateNoContentHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
Conflict {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum ContributionGetOutcome {
Ok {
body: openehr_rm::v1_2::common::change_control::contribution::Contribution,
headers: ContributionGetOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum DemographicTagsGetOutcome {
Ok {
body: Vec<ItemTagOfPerson>,
headers: DemographicTagsGetOkHeaders,
},
BadRequest {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum AgentTagsGetOutcome {
Ok {
body: Vec<ItemTagOfAgent>,
headers: AgentTagsGetOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum AgentTagsUpdateOutcome {
Ok {
body: Vec<ItemTagOfAgent>,
headers: AgentTagsUpdateOkHeaders,
},
NoContent,
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum AgentTagsDeleteOutcome {
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum GroupTagsGetOutcome {
Ok {
body: Vec<ItemTagOfGroup>,
headers: GroupTagsGetOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum GroupTagsUpdateOutcome {
Ok {
body: Vec<ItemTagOfGroup>,
headers: GroupTagsUpdateOkHeaders,
},
NoContent,
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum GroupTagsDeleteOutcome {
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum OrganisationTagsGetOutcome {
Ok {
body: Vec<ItemTagOfOrganisation>,
headers: OrganisationTagsGetOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum OrganisationTagsUpdateOutcome {
Ok {
body: Vec<ItemTagOfOrganisation>,
headers: OrganisationTagsUpdateOkHeaders,
},
NoContent,
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum OrganisationTagsDeleteOutcome {
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum PersonTagsGetOutcome {
Ok {
body: Vec<ItemTagOfPerson>,
headers: PersonTagsGetOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum PersonTagsUpdateOutcome {
Ok {
body: Vec<ItemTagOfPerson>,
headers: PersonTagsUpdateOkHeaders,
},
NoContent,
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum PersonTagsDeleteOutcome {
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum RoleTagsGetOutcome {
Ok {
body: Vec<ItemTagOfRole>,
headers: RoleTagsGetOkHeaders,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum RoleTagsUpdateOutcome {
Ok {
body: Vec<ItemTagOfRole>,
headers: RoleTagsUpdateOkHeaders,
},
NoContent,
BadRequest {
body: crate::rest::client::ErrorBody,
},
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub enum RoleTagsDeleteOutcome {
NoContent,
NotFound {
body: crate::rest::client::ErrorBody,
},
}
#[derive(Debug, Clone)]
pub struct DemographicClient<'c, T> {
client: &'c crate::rest::client::Client<T>,
options: crate::rest::client::CallOptions,
}
impl<'c, T: crate::rest::client::Transport> DemographicClient<'c, T> {
#[must_use]
pub fn new(client: &'c crate::rest::client::Client<T>) -> Self {
Self {
client,
options: crate::rest::client::CallOptions::default(),
}
}
#[must_use]
pub fn with_options(mut self, options: crate::rest::client::CallOptions) -> Self {
self.options = options;
self
}
pub async fn agent_create(
&self,
params: &AgentCreateParams,
body: &openehr_rm::v1_2::demographic::agent::Agent,
) -> Result<AgentCreateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::POST,
String::from("/demographic/agent"),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_item_tag.as_ref() {
for item in value {
request.header("openehr-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::CREATED => Ok(AgentCreateOutcome::Created {
body: answer.optional_json()?,
headers: AgentCreateCreatedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(AgentCreateOutcome::NoContent {
headers: AgentCreateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(AgentCreateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(AgentCreateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::UNPROCESSABLE_ENTITY => {
Ok(AgentCreateOutcome::UnprocessableEntity {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn agent_get(
&self,
params: &AgentGetParams,
) -> Result<AgentGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/agent/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.version_at_time.as_ref() {
request.query("version_at_time", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(AgentGetOutcome::Ok {
body: answer.json()?,
headers: AgentGetOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(AgentGetOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(AgentGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn agent_update(
&self,
params: &AgentUpdateParams,
body: &openehr_rm::v1_2::demographic::agent::Agent,
) -> Result<AgentUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/demographic/agent/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
{
let value = ¶ms.if_match;
request.header("If-Match", &value.to_string())?;
}
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(AgentUpdateOutcome::Ok {
body: answer.json()?,
headers: AgentUpdateOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(AgentUpdateOutcome::NoContent {
headers: AgentUpdateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(AgentUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(AgentUpdateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::PRECONDITION_FAILED => {
Ok(AgentUpdateOutcome::PreconditionFailed {
body: answer.error_body(),
headers: AgentUpdatePreconditionFailedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
})
}
http::StatusCode::UNPROCESSABLE_ENTITY => {
Ok(AgentUpdateOutcome::UnprocessableEntity {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn agent_delete(
&self,
params: &AgentDeleteParams,
) -> Result<AgentDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/demographic/agent/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(AgentDeleteOutcome::NoContent {
headers: AgentDeleteNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(AgentDeleteOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(AgentDeleteOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::CONFLICT => Ok(AgentDeleteOutcome::Conflict {
body: answer.error_body(),
headers: AgentDeleteConflictHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn group_create(
&self,
params: &GroupCreateParams,
body: &openehr_rm::v1_2::demographic::group::Group,
) -> Result<GroupCreateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::POST,
String::from("/demographic/group"),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_item_tag.as_ref() {
for item in value {
request.header("openehr-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::CREATED => Ok(GroupCreateOutcome::Created {
body: answer.optional_json()?,
headers: GroupCreateCreatedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(GroupCreateOutcome::NoContent {
headers: GroupCreateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(GroupCreateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(GroupCreateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::UNPROCESSABLE_ENTITY => {
Ok(GroupCreateOutcome::UnprocessableEntity {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn group_get(
&self,
params: &GroupGetParams,
) -> Result<GroupGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/group/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.version_at_time.as_ref() {
request.query("version_at_time", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(GroupGetOutcome::Ok {
body: answer.json()?,
headers: GroupGetOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(GroupGetOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(GroupGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn group_update(
&self,
params: &GroupUpdateParams,
body: &openehr_rm::v1_2::demographic::group::Group,
) -> Result<GroupUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/demographic/group/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
{
let value = ¶ms.if_match;
request.header("If-Match", &value.to_string())?;
}
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(GroupUpdateOutcome::Ok {
body: answer.json()?,
headers: GroupUpdateOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(GroupUpdateOutcome::NoContent {
headers: GroupUpdateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(GroupUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(GroupUpdateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::PRECONDITION_FAILED => {
Ok(GroupUpdateOutcome::PreconditionFailed {
body: answer.error_body(),
headers: GroupUpdatePreconditionFailedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
})
}
http::StatusCode::UNPROCESSABLE_ENTITY => {
Ok(GroupUpdateOutcome::UnprocessableEntity {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn group_delete(
&self,
params: &GroupDeleteParams,
) -> Result<GroupDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/demographic/group/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(GroupDeleteOutcome::NoContent {
headers: GroupDeleteNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(GroupDeleteOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(GroupDeleteOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::CONFLICT => Ok(GroupDeleteOutcome::Conflict {
body: answer.error_body(),
headers: GroupDeleteConflictHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn organisation_create(
&self,
params: &OrganisationCreateParams,
body: &openehr_rm::v1_2::demographic::organisation::Organisation,
) -> Result<OrganisationCreateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::POST,
String::from("/demographic/organisation"),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_item_tag.as_ref() {
for item in value {
request.header("openehr-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::CREATED => Ok(OrganisationCreateOutcome::Created {
body: answer.optional_json()?,
headers: OrganisationCreateCreatedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(OrganisationCreateOutcome::NoContent {
headers: OrganisationCreateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(OrganisationCreateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(OrganisationCreateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::UNPROCESSABLE_ENTITY => {
Ok(OrganisationCreateOutcome::UnprocessableEntity {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn organisation_get(
&self,
params: &OrganisationGetParams,
) -> Result<OrganisationGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/organisation/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.version_at_time.as_ref() {
request.query("version_at_time", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(OrganisationGetOutcome::Ok {
body: answer.json()?,
headers: OrganisationGetOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(OrganisationGetOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(OrganisationGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn organisation_update(
&self,
params: &OrganisationUpdateParams,
body: &openehr_rm::v1_2::demographic::organisation::Organisation,
) -> Result<OrganisationUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/demographic/organisation/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
{
let value = ¶ms.if_match;
request.header("If-Match", &value.to_string())?;
}
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(OrganisationUpdateOutcome::Ok {
body: answer.json()?,
headers: OrganisationUpdateOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(OrganisationUpdateOutcome::NoContent {
headers: OrganisationUpdateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(OrganisationUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(OrganisationUpdateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::PRECONDITION_FAILED => {
Ok(OrganisationUpdateOutcome::PreconditionFailed {
body: answer.error_body(),
headers: OrganisationUpdatePreconditionFailedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
})
}
http::StatusCode::UNPROCESSABLE_ENTITY => {
Ok(OrganisationUpdateOutcome::UnprocessableEntity {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn organisation_delete(
&self,
params: &OrganisationDeleteParams,
) -> Result<OrganisationDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/demographic/organisation/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(OrganisationDeleteOutcome::NoContent {
headers: OrganisationDeleteNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(OrganisationDeleteOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(OrganisationDeleteOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::CONFLICT => Ok(OrganisationDeleteOutcome::Conflict {
body: answer.error_body(),
headers: OrganisationDeleteConflictHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn person_create(
&self,
params: &PersonCreateParams,
body: &openehr_rm::v1_2::demographic::person::Person,
) -> Result<PersonCreateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::POST,
String::from("/demographic/person"),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_item_tag.as_ref() {
for item in value {
request.header("openehr-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::CREATED => Ok(PersonCreateOutcome::Created {
body: answer.optional_json()?,
headers: PersonCreateCreatedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(PersonCreateOutcome::NoContent {
headers: PersonCreateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(PersonCreateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(PersonCreateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::UNPROCESSABLE_ENTITY => {
Ok(PersonCreateOutcome::UnprocessableEntity {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn person_get(
&self,
params: &PersonGetParams,
) -> Result<PersonGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/person/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.version_at_time.as_ref() {
request.query("version_at_time", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(PersonGetOutcome::Ok {
body: answer.json()?,
headers: PersonGetOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(PersonGetOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(PersonGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn person_update(
&self,
params: &PersonUpdateParams,
body: &openehr_rm::v1_2::demographic::person::Person,
) -> Result<PersonUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/demographic/person/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
{
let value = ¶ms.if_match;
request.header("If-Match", &value.to_string())?;
}
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(PersonUpdateOutcome::Ok {
body: answer.json()?,
headers: PersonUpdateOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(PersonUpdateOutcome::NoContent {
headers: PersonUpdateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(PersonUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(PersonUpdateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::PRECONDITION_FAILED => {
Ok(PersonUpdateOutcome::PreconditionFailed {
body: answer.error_body(),
headers: PersonUpdatePreconditionFailedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
})
}
http::StatusCode::UNPROCESSABLE_ENTITY => {
Ok(PersonUpdateOutcome::UnprocessableEntity {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn person_delete(
&self,
params: &PersonDeleteParams,
) -> Result<PersonDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/demographic/person/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(PersonDeleteOutcome::NoContent {
headers: PersonDeleteNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(PersonDeleteOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(PersonDeleteOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::CONFLICT => Ok(PersonDeleteOutcome::Conflict {
body: answer.error_body(),
headers: PersonDeleteConflictHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn role_create(
&self,
params: &RoleCreateParams,
body: &openehr_rm::v1_2::demographic::role::Role,
) -> Result<RoleCreateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::POST,
String::from("/demographic/role"),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_item_tag.as_ref() {
for item in value {
request.header("openehr-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::CREATED => Ok(RoleCreateOutcome::Created {
body: answer.optional_json()?,
headers: RoleCreateCreatedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(RoleCreateOutcome::NoContent {
headers: RoleCreateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(RoleCreateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(RoleCreateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::UNPROCESSABLE_ENTITY => {
Ok(RoleCreateOutcome::UnprocessableEntity {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn role_get(
&self,
params: &RoleGetParams,
) -> Result<RoleGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/role/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.version_at_time.as_ref() {
request.query("version_at_time", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(RoleGetOutcome::Ok {
body: answer.json()?,
headers: RoleGetOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(RoleGetOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(RoleGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn role_update(
&self,
params: &RoleUpdateParams,
body: &openehr_rm::v1_2::demographic::role::Role,
) -> Result<RoleUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/demographic/role/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
{
let value = ¶ms.if_match;
request.header("If-Match", &value.to_string())?;
}
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_version_item_tag.as_ref() {
for item in value {
request.header("openehr-version-item-tag", &item.to_string())?;
}
}
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(RoleUpdateOutcome::Ok {
body: answer.json()?,
headers: RoleUpdateOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::NO_CONTENT => Ok(RoleUpdateOutcome::NoContent {
headers: RoleUpdateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
openehr_item_tag: answer.header_all("openehr-item-tag"),
openehr_version_item_tag: answer.header_all("openehr-version-item-tag"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(RoleUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(RoleUpdateOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::PRECONDITION_FAILED => {
Ok(RoleUpdateOutcome::PreconditionFailed {
body: answer.error_body(),
headers: RoleUpdatePreconditionFailedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
})
}
http::StatusCode::UNPROCESSABLE_ENTITY => {
Ok(RoleUpdateOutcome::UnprocessableEntity {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn role_delete(
&self,
params: &RoleDeleteParams,
) -> Result<RoleDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/demographic/role/{}",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.openehr_version.as_ref() {
request.header("openehr-version", &value.to_string())?;
}
if let Some(value) = params.openehr_audit_details.as_ref() {
for item in value {
request.header("openehr-audit-details", &item.to_string())?;
}
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(RoleDeleteOutcome::NoContent {
headers: RoleDeleteNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(RoleDeleteOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(RoleDeleteOutcome::NotFound {
body: answer.error_body(),
}),
http::StatusCode::CONFLICT => Ok(RoleDeleteOutcome::Conflict {
body: answer.error_body(),
headers: RoleDeleteConflictHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
},
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn versioned_party_get(
&self,
params: &VersionedPartyGetParams,
) -> Result<VersionedPartyGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/versioned_party/{}",
crate::rest::client::path_segment(¶ms.versioned_object_uid)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(VersionedPartyGetOutcome::Ok {
body: answer.json()?,
headers: VersionedPartyGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(VersionedPartyGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn versioned_party_revision_history(
&self,
params: &VersionedPartyRevisionHistoryParams,
) -> Result<VersionedPartyRevisionHistoryOutcome, crate::rest::client::ClientError>
{
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/versioned_party/{}/revision_history",
crate::rest::client::path_segment(¶ms.versioned_object_uid)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(VersionedPartyRevisionHistoryOutcome::Ok {
body: answer.json()?,
headers: VersionedPartyRevisionHistoryOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(VersionedPartyRevisionHistoryOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn versioned_party_version_get_at_time(
&self,
params: &VersionedPartyVersionGetAtTimeParams,
) -> Result<VersionedPartyVersionGetAtTimeOutcome, crate::rest::client::ClientError>
{
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/versioned_party/{}/version",
crate::rest::client::path_segment(¶ms.versioned_object_uid)
),
);
if let Some(value) = params.version_at_time.as_ref() {
request.query("version_at_time", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(VersionedPartyVersionGetAtTimeOutcome::Ok {
body: answer.json()?,
headers: VersionedPartyVersionGetAtTimeOkHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => {
Ok(VersionedPartyVersionGetAtTimeOutcome::NotFound {
body: answer.error_body(),
})
}
_ => Err(answer.into_undocumented()),
}
}
pub async fn versioned_party_version_get_by_id(
&self,
params: &VersionedPartyVersionGetByIdParams,
) -> Result<VersionedPartyVersionGetByIdOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/versioned_party/{}/version/{}",
crate::rest::client::path_segment(¶ms.versioned_object_uid),
crate::rest::client::path_segment(¶ms.version_uid)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(VersionedPartyVersionGetByIdOutcome::Ok {
body: answer.json()?,
headers: VersionedPartyVersionGetByIdOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(VersionedPartyVersionGetByIdOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn contribution_create(
&self,
params: &ContributionCreateParams,
body: &NewContribution,
) -> Result<ContributionCreateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::POST,
String::from("/demographic/contribution"),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
if let Some(value) = params.openehr_template_id.as_ref() {
request.header("openehr-template-id", &value.to_string())?;
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::CREATED => Ok(ContributionCreateOutcome::Created {
body: answer.optional_json()?,
headers: ContributionCreateCreatedHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NO_CONTENT => Ok(ContributionCreateOutcome::NoContent {
headers: ContributionCreateNoContentHeaders {
etag: answer.header("ETag"),
location: answer.header("Location"),
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(ContributionCreateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::CONFLICT => Ok(ContributionCreateOutcome::Conflict {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn contribution_get(
&self,
params: &ContributionGetParams,
) -> Result<ContributionGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/contribution/{}",
crate::rest::client::path_segment(¶ms.contribution_uid)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(ContributionGetOutcome::Ok {
body: answer.json()?,
headers: ContributionGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(ContributionGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn demographic_tags_get(
&self,
params: &DemographicTagsGetParams,
) -> Result<DemographicTagsGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
String::from("/demographic/tags"),
);
if let Some(value) = params.tag_key.as_ref() {
request.query("tag_key", value);
}
if let Some(value) = params.tag_value.as_ref() {
request.query("tag_value", value);
}
if let Some(value) = params.tag_target_path.as_ref() {
request.query("tag_target_path", value);
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(DemographicTagsGetOutcome::Ok {
body: answer.json()?,
headers: DemographicTagsGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::BAD_REQUEST => Ok(DemographicTagsGetOutcome::BadRequest {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn agent_tags_get(
&self,
params: &AgentTagsGetParams,
) -> Result<AgentTagsGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/agent/{}/tags",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(AgentTagsGetOutcome::Ok {
body: answer.json()?,
headers: AgentTagsGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(AgentTagsGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn agent_tags_update(
&self,
params: &AgentTagsUpdateParams,
body: &Vec<super::super::common::UpdateItemTag>,
) -> Result<AgentTagsUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/demographic/agent/{}/tags",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(AgentTagsUpdateOutcome::Ok {
body: answer.json()?,
headers: AgentTagsUpdateOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NO_CONTENT => Ok(AgentTagsUpdateOutcome::NoContent),
http::StatusCode::BAD_REQUEST => Ok(AgentTagsUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(AgentTagsUpdateOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn agent_tags_delete(
&self,
params: &AgentTagsDeleteParams,
) -> Result<AgentTagsDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/demographic/agent/{}/tags/{}",
crate::rest::client::path_segment(¶ms.uid_based_id),
crate::rest::client::path_segment(¶ms.key)
),
);
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(AgentTagsDeleteOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(AgentTagsDeleteOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn group_tags_get(
&self,
params: &GroupTagsGetParams,
) -> Result<GroupTagsGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/group/{}/tags",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(GroupTagsGetOutcome::Ok {
body: answer.json()?,
headers: GroupTagsGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(GroupTagsGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn group_tags_update(
&self,
params: &GroupTagsUpdateParams,
body: &Vec<super::super::common::UpdateItemTag>,
) -> Result<GroupTagsUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/demographic/group/{}/tags",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(GroupTagsUpdateOutcome::Ok {
body: answer.json()?,
headers: GroupTagsUpdateOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NO_CONTENT => Ok(GroupTagsUpdateOutcome::NoContent),
http::StatusCode::BAD_REQUEST => Ok(GroupTagsUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(GroupTagsUpdateOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn group_tags_delete(
&self,
params: &GroupTagsDeleteParams,
) -> Result<GroupTagsDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/demographic/group/{}/tags/{}",
crate::rest::client::path_segment(¶ms.uid_based_id),
crate::rest::client::path_segment(¶ms.key)
),
);
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(GroupTagsDeleteOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(GroupTagsDeleteOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn organisation_tags_get(
&self,
params: &OrganisationTagsGetParams,
) -> Result<OrganisationTagsGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/organisation/{}/tags",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(OrganisationTagsGetOutcome::Ok {
body: answer.json()?,
headers: OrganisationTagsGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(OrganisationTagsGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn organisation_tags_update(
&self,
params: &OrganisationTagsUpdateParams,
body: &Vec<super::super::common::UpdateItemTag>,
) -> Result<OrganisationTagsUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/demographic/organisation/{}/tags",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(OrganisationTagsUpdateOutcome::Ok {
body: answer.json()?,
headers: OrganisationTagsUpdateOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NO_CONTENT => Ok(OrganisationTagsUpdateOutcome::NoContent),
http::StatusCode::BAD_REQUEST => Ok(OrganisationTagsUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(OrganisationTagsUpdateOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn organisation_tags_delete(
&self,
params: &OrganisationTagsDeleteParams,
) -> Result<OrganisationTagsDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/demographic/organisation/{}/tags/{}",
crate::rest::client::path_segment(¶ms.uid_based_id),
crate::rest::client::path_segment(¶ms.key)
),
);
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(OrganisationTagsDeleteOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(OrganisationTagsDeleteOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn person_tags_get(
&self,
params: &PersonTagsGetParams,
) -> Result<PersonTagsGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/person/{}/tags",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(PersonTagsGetOutcome::Ok {
body: answer.json()?,
headers: PersonTagsGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(PersonTagsGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn person_tags_update(
&self,
params: &PersonTagsUpdateParams,
body: &Vec<super::super::common::UpdateItemTag>,
) -> Result<PersonTagsUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/demographic/person/{}/tags",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(PersonTagsUpdateOutcome::Ok {
body: answer.json()?,
headers: PersonTagsUpdateOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NO_CONTENT => Ok(PersonTagsUpdateOutcome::NoContent),
http::StatusCode::BAD_REQUEST => Ok(PersonTagsUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(PersonTagsUpdateOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn person_tags_delete(
&self,
params: &PersonTagsDeleteParams,
) -> Result<PersonTagsDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/demographic/person/{}/tags/{}",
crate::rest::client::path_segment(¶ms.uid_based_id),
crate::rest::client::path_segment(¶ms.key)
),
);
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(PersonTagsDeleteOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(PersonTagsDeleteOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn role_tags_get(
&self,
params: &RoleTagsGetParams,
) -> Result<RoleTagsGetOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::GET,
format!(
"/demographic/role/{}/tags",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(RoleTagsGetOutcome::Ok {
body: answer.json()?,
headers: RoleTagsGetOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NOT_FOUND => Ok(RoleTagsGetOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn role_tags_update(
&self,
params: &RoleTagsUpdateParams,
body: &Vec<super::super::common::UpdateItemTag>,
) -> Result<RoleTagsUpdateOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::PUT,
format!(
"/demographic/role/{}/tags",
crate::rest::client::path_segment(¶ms.uid_based_id)
),
);
if let Some(value) = params.prefer.as_ref() {
request.header("Prefer", &value.to_string())?;
}
if let Some(value) = params.accept.as_ref() {
request.header("Accept", &value.to_string())?;
}
if let Some(value) = params.content_type.as_ref() {
request.header("Content-Type", &value.to_string())?;
}
request.json_body(body, params.content_type.as_deref())?;
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::OK => Ok(RoleTagsUpdateOutcome::Ok {
body: answer.json()?,
headers: RoleTagsUpdateOkHeaders {
content_type: answer.header("Content-Type"),
},
}),
http::StatusCode::NO_CONTENT => Ok(RoleTagsUpdateOutcome::NoContent),
http::StatusCode::BAD_REQUEST => Ok(RoleTagsUpdateOutcome::BadRequest {
body: answer.error_body(),
}),
http::StatusCode::NOT_FOUND => Ok(RoleTagsUpdateOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
pub async fn role_tags_delete(
&self,
params: &RoleTagsDeleteParams,
) -> Result<RoleTagsDeleteOutcome, crate::rest::client::ClientError> {
let mut request = crate::rest::client::Request::new(
http::Method::DELETE,
format!(
"/demographic/role/{}/tags/{}",
crate::rest::client::path_segment(¶ms.uid_based_id),
crate::rest::client::path_segment(¶ms.key)
),
);
request.apply_options(&self.options);
let answer = self.client.execute(request).await?;
match answer.status() {
http::StatusCode::NO_CONTENT => Ok(RoleTagsDeleteOutcome::NoContent),
http::StatusCode::NOT_FOUND => Ok(RoleTagsDeleteOutcome::NotFound {
body: answer.error_body(),
}),
_ => Err(answer.into_undocumented()),
}
}
}
}
pub const ROUTES: &[(&str, &str, &str)] = &[
("POST", "/demographic/agent", "agent_create"),
("GET", "/demographic/agent/{uid_based_id}", "agent_get"),
("PUT", "/demographic/agent/{uid_based_id}", "agent_update"),
(
"DELETE",
"/demographic/agent/{uid_based_id}",
"agent_delete",
),
("POST", "/demographic/group", "group_create"),
("GET", "/demographic/group/{uid_based_id}", "group_get"),
("PUT", "/demographic/group/{uid_based_id}", "group_update"),
(
"DELETE",
"/demographic/group/{uid_based_id}",
"group_delete",
),
("POST", "/demographic/organisation", "organisation_create"),
(
"GET",
"/demographic/organisation/{uid_based_id}",
"organisation_get",
),
(
"PUT",
"/demographic/organisation/{uid_based_id}",
"organisation_update",
),
(
"DELETE",
"/demographic/organisation/{uid_based_id}",
"organisation_delete",
),
("POST", "/demographic/person", "person_create"),
("GET", "/demographic/person/{uid_based_id}", "person_get"),
("PUT", "/demographic/person/{uid_based_id}", "person_update"),
(
"DELETE",
"/demographic/person/{uid_based_id}",
"person_delete",
),
("POST", "/demographic/role", "role_create"),
("GET", "/demographic/role/{uid_based_id}", "role_get"),
("PUT", "/demographic/role/{uid_based_id}", "role_update"),
("DELETE", "/demographic/role/{uid_based_id}", "role_delete"),
(
"GET",
"/demographic/versioned_party/{versioned_object_uid}",
"versioned_party_get",
),
(
"GET",
"/demographic/versioned_party/{versioned_object_uid}/revision_history",
"versioned_party_revision_history",
),
(
"GET",
"/demographic/versioned_party/{versioned_object_uid}/version",
"versioned_party_version_get_at_time",
),
(
"GET",
"/demographic/versioned_party/{versioned_object_uid}/version/{version_uid}",
"versioned_party_version_get_by_id",
),
("POST", "/demographic/contribution", "contribution_create"),
(
"GET",
"/demographic/contribution/{contribution_uid}",
"contribution_get",
),
("GET", "/demographic/tags", "demographic_tags_get"),
(
"GET",
"/demographic/agent/{uid_based_id}/tags",
"agent_tags_get",
),
(
"PUT",
"/demographic/agent/{uid_based_id}/tags",
"agent_tags_update",
),
(
"DELETE",
"/demographic/agent/{uid_based_id}/tags/{key}",
"agent_tags_delete",
),
(
"GET",
"/demographic/group/{uid_based_id}/tags",
"group_tags_get",
),
(
"PUT",
"/demographic/group/{uid_based_id}/tags",
"group_tags_update",
),
(
"DELETE",
"/demographic/group/{uid_based_id}/tags/{key}",
"group_tags_delete",
),
(
"GET",
"/demographic/organisation/{uid_based_id}/tags",
"organisation_tags_get",
),
(
"PUT",
"/demographic/organisation/{uid_based_id}/tags",
"organisation_tags_update",
),
(
"DELETE",
"/demographic/organisation/{uid_based_id}/tags/{key}",
"organisation_tags_delete",
),
(
"GET",
"/demographic/person/{uid_based_id}/tags",
"person_tags_get",
),
(
"PUT",
"/demographic/person/{uid_based_id}/tags",
"person_tags_update",
),
(
"DELETE",
"/demographic/person/{uid_based_id}/tags/{key}",
"person_tags_delete",
),
(
"GET",
"/demographic/role/{uid_based_id}/tags",
"role_tags_get",
),
(
"PUT",
"/demographic/role/{uid_based_id}/tags",
"role_tags_update",
),
(
"DELETE",
"/demographic/role/{uid_based_id}/tags/{key}",
"role_tags_delete",
),
];
pub const ROUTE_PARAMS: &[&[crate::rest::routes::Param]] = &[
AgentCreateParams::PARAMS,
AgentGetParams::PARAMS,
AgentUpdateParams::PARAMS,
AgentDeleteParams::PARAMS,
GroupCreateParams::PARAMS,
GroupGetParams::PARAMS,
GroupUpdateParams::PARAMS,
GroupDeleteParams::PARAMS,
OrganisationCreateParams::PARAMS,
OrganisationGetParams::PARAMS,
OrganisationUpdateParams::PARAMS,
OrganisationDeleteParams::PARAMS,
PersonCreateParams::PARAMS,
PersonGetParams::PARAMS,
PersonUpdateParams::PARAMS,
PersonDeleteParams::PARAMS,
RoleCreateParams::PARAMS,
RoleGetParams::PARAMS,
RoleUpdateParams::PARAMS,
RoleDeleteParams::PARAMS,
VersionedPartyGetParams::PARAMS,
VersionedPartyRevisionHistoryParams::PARAMS,
VersionedPartyVersionGetAtTimeParams::PARAMS,
VersionedPartyVersionGetByIdParams::PARAMS,
ContributionCreateParams::PARAMS,
ContributionGetParams::PARAMS,
DemographicTagsGetParams::PARAMS,
AgentTagsGetParams::PARAMS,
AgentTagsUpdateParams::PARAMS,
AgentTagsDeleteParams::PARAMS,
GroupTagsGetParams::PARAMS,
GroupTagsUpdateParams::PARAMS,
GroupTagsDeleteParams::PARAMS,
OrganisationTagsGetParams::PARAMS,
OrganisationTagsUpdateParams::PARAMS,
OrganisationTagsDeleteParams::PARAMS,
PersonTagsGetParams::PARAMS,
PersonTagsUpdateParams::PARAMS,
PersonTagsDeleteParams::PARAMS,
RoleTagsGetParams::PARAMS,
RoleTagsUpdateParams::PARAMS,
RoleTagsDeleteParams::PARAMS,
];
const _: () = assert!(
ROUTE_PARAMS.len() == ROUTES.len(),
"ROUTE_PARAMS carries one row per ROUTES entry"
);
pub const ROUTE_REQUEST_MEDIA: &[&[&str]] = &[
&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
],
&[],
&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
],
&[],
&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
],
&[],
&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
],
&[],
&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
],
&[],
&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
],
&[],
&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
],
&[],
&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
],
&[],
&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
],
&[],
&[
"application/json",
"application/xml",
"application/openehr.wt.flat+json",
"application/openehr.wt.structured+json",
],
&[],
&[],
&[],
&[],
&[],
&["application/json", "application/xml"],
&[],
&[],
&[],
&["application/json", "application/xml"],
&[],
&[],
&["application/json", "application/xml"],
&[],
&[],
&["application/json", "application/xml"],
&[],
&[],
&["application/json", "application/xml"],
&[],
&[],
&["application/json", "application/xml"],
&[],
];
const _: () = assert!(
ROUTE_REQUEST_MEDIA.len() == ROUTES.len(),
"ROUTE_REQUEST_MEDIA carries one row per ROUTES entry"
);