//! Generated by `trust-tasks-codegen` — do not edit by hand.
//!
//! Spec slug: `persona/renderers/list`. Version: `1.0`.
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
/// Error types.
pub mod error {
/// Error from a `TryFrom` or `FromStr` implementation.
pub struct ConversionError(::std::borrow::Cow<'static, str>);
impl ::std::error::Error for ConversionError {}
impl ::std::fmt::Display for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Display::fmt(&self.0, f)
}
}
impl ::std::fmt::Debug for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
///Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Ext",
/// "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
/// "type": "object",
/// "minProperties": 1,
/// "additionalProperties": true,
/// "propertyNames": {
/// "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Ext(pub ::std::collections::HashMap<ExtKey, ::serde_json::Value>);
impl ::std::ops::Deref for Ext {
type Target = ::std::collections::HashMap<ExtKey, ::serde_json::Value>;
fn deref(&self) -> &::std::collections::HashMap<ExtKey, ::serde_json::Value> {
&self.0
}
}
impl ::std::convert::From<Ext> for ::std::collections::HashMap<ExtKey, ::serde_json::Value> {
fn from(value: Ext) -> Self {
value.0
}
}
impl ::std::convert::From<::std::collections::HashMap<ExtKey, ::serde_json::Value>> for Ext {
fn from(value: ::std::collections::HashMap<ExtKey, ::serde_json::Value>) -> Self {
Self(value)
}
}
///`ExtKey`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ExtKey(::std::string::String);
impl ::std::ops::Deref for ExtKey {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ExtKey> for ::std::string::String {
fn from(value: ExtKey) -> Self {
value.0
}
}
impl ::std::str::FromStr for ExtKey {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| {
::regress::Regex::new("^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ExtKey {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ExtKey {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ExtKey {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ExtKey {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///Enumerate the output formats this agent can present in, and what each one discards. A client cannot negotiate a format it cannot discover.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$id": "https://trusttasks.org/spec/persona/renderers/list/1.0",
/// "title": "Payload",
/// "description": "Enumerate the output formats this agent can present in, and what each one discards. A client cannot negotiate a format it cannot discover.",
/// "type": "object",
/// "properties": {
/// "ext": {
/// "$ref": "#/definitions/Ext"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct Payload {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ext: ::std::option::Option<Ext>,
}
impl ::std::default::Default for Payload {
fn default() -> Self {
Self {
ext: Default::default(),
}
}
}
impl Payload {
pub fn builder() -> builder::Payload {
Default::default()
}
}
///Success response to persona/renderers/list. Type https://trusttasks.org/spec/persona/renderers/list/1.0#response.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Response",
/// "description": "Success response to persona/renderers/list. Type https://trusttasks.org/spec/persona/renderers/list/1.0#response.",
/// "type": "object",
/// "required": [
/// "renderers"
/// ],
/// "properties": {
/// "ext": {
/// "$ref": "#/definitions/Ext"
/// },
/// "renderers": {
/// "type": "array",
/// "items": {
/// "type": "object",
/// "required": [
/// "canCarryPredicates",
/// "drops",
/// "id"
/// ],
/// "properties": {
/// "canCarryPredicates": {
/// "description": "Whether the format can represent a claim proven rather than shown. Most cannot: there is no field in a general contact format for 'over the threshold'. A disclosure containing a predicate through a renderer that cannot carry one fails at negotiation rather than silently dropping the claim.",
/// "type": "boolean"
/// },
/// "canonical": {
/// "description": "True for the maintainer's lossless native form, used when a producer names no renderer. Exactly one renderer is canonical.",
/// "type": "boolean"
/// },
/// "description": {
/// "type": "string",
/// "maxLength": 512
/// },
/// "drops": {
/// "description": "What this format discards — commonly provenance, because most general-purpose contact formats have nowhere to put it. Declared here so that lossiness is negotiated rather than discovered by a holder afterwards.",
/// "type": "array",
/// "items": {
/// "type": "string",
/// "maxLength": 64
/// },
/// "maxItems": 32
/// },
/// "id": {
/// "type": "string",
/// "maxLength": 64
/// }
/// },
/// "additionalProperties": false
/// },
/// "maxItems": 32
/// }
/// },
/// "additionalProperties": false,
/// "$anchor": "response"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct Response {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ext: ::std::option::Option<Ext>,
pub renderers: ::std::vec::Vec<ResponseRenderersItem>,
}
impl Response {
pub fn builder() -> builder::Response {
Default::default()
}
}
///`ResponseRenderersItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "canCarryPredicates",
/// "drops",
/// "id"
/// ],
/// "properties": {
/// "canCarryPredicates": {
/// "description": "Whether the format can represent a claim proven rather than shown. Most cannot: there is no field in a general contact format for 'over the threshold'. A disclosure containing a predicate through a renderer that cannot carry one fails at negotiation rather than silently dropping the claim.",
/// "type": "boolean"
/// },
/// "canonical": {
/// "description": "True for the maintainer's lossless native form, used when a producer names no renderer. Exactly one renderer is canonical.",
/// "type": "boolean"
/// },
/// "description": {
/// "type": "string",
/// "maxLength": 512
/// },
/// "drops": {
/// "description": "What this format discards — commonly provenance, because most general-purpose contact formats have nowhere to put it. Declared here so that lossiness is negotiated rather than discovered by a holder afterwards.",
/// "type": "array",
/// "items": {
/// "type": "string",
/// "maxLength": 64
/// },
/// "maxItems": 32
/// },
/// "id": {
/// "type": "string",
/// "maxLength": 64
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct ResponseRenderersItem {
///Whether the format can represent a claim proven rather than shown. Most cannot: there is no field in a general contact format for 'over the threshold'. A disclosure containing a predicate through a renderer that cannot carry one fails at negotiation rather than silently dropping the claim.
#[serde(rename = "canCarryPredicates")]
pub can_carry_predicates: bool,
///True for the maintainer's lossless native form, used when a producer names no renderer. Exactly one renderer is canonical.
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub canonical: ::std::option::Option<bool>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub description: ::std::option::Option<ResponseRenderersItemDescription>,
///What this format discards — commonly provenance, because most general-purpose contact formats have nowhere to put it. Declared here so that lossiness is negotiated rather than discovered by a holder afterwards.
pub drops: ::std::vec::Vec<ResponseRenderersItemDropsItem>,
pub id: ResponseRenderersItemId,
}
impl ResponseRenderersItem {
pub fn builder() -> builder::ResponseRenderersItem {
Default::default()
}
}
///`ResponseRenderersItemDescription`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "maxLength": 512
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ResponseRenderersItemDescription(::std::string::String);
impl ::std::ops::Deref for ResponseRenderersItemDescription {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ResponseRenderersItemDescription> for ::std::string::String {
fn from(value: ResponseRenderersItemDescription) -> Self {
value.0
}
}
impl ::std::str::FromStr for ResponseRenderersItemDescription {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 512usize {
return Err("longer than 512 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ResponseRenderersItemDescription {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ResponseRenderersItemDescription {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ResponseRenderersItemDescription {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ResponseRenderersItemDescription {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`ResponseRenderersItemDropsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "maxLength": 64
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ResponseRenderersItemDropsItem(::std::string::String);
impl ::std::ops::Deref for ResponseRenderersItemDropsItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ResponseRenderersItemDropsItem> for ::std::string::String {
fn from(value: ResponseRenderersItemDropsItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for ResponseRenderersItemDropsItem {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 64usize {
return Err("longer than 64 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ResponseRenderersItemDropsItem {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ResponseRenderersItemDropsItem {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ResponseRenderersItemDropsItem {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ResponseRenderersItemDropsItem {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`ResponseRenderersItemId`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "maxLength": 64
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ResponseRenderersItemId(::std::string::String);
impl ::std::ops::Deref for ResponseRenderersItemId {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ResponseRenderersItemId> for ::std::string::String {
fn from(value: ResponseRenderersItemId) -> Self {
value.0
}
}
impl ::std::str::FromStr for ResponseRenderersItemId {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 64usize {
return Err("longer than 64 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ResponseRenderersItemId {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ResponseRenderersItemId {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ResponseRenderersItemId {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ResponseRenderersItemId {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
/// Types for composing complex structures.
pub mod builder {
#[derive(Clone, Debug)]
pub struct Payload {
ext: ::std::result::Result<::std::option::Option<super::Ext>, ::std::string::String>,
}
impl ::std::default::Default for Payload {
fn default() -> Self {
Self {
ext: Ok(Default::default()),
}
}
}
impl Payload {
pub fn ext<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Ext>>,
T::Error: ::std::fmt::Display,
{
self.ext = value
.try_into()
.map_err(|e| format!("error converting supplied value for ext: {e}"));
self
}
}
impl ::std::convert::TryFrom<Payload> for super::Payload {
type Error = super::error::ConversionError;
fn try_from(value: Payload) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { ext: value.ext? })
}
}
impl ::std::convert::From<super::Payload> for Payload {
fn from(value: super::Payload) -> Self {
Self { ext: Ok(value.ext) }
}
}
#[derive(Clone, Debug)]
pub struct Response {
ext: ::std::result::Result<::std::option::Option<super::Ext>, ::std::string::String>,
renderers: ::std::result::Result<
::std::vec::Vec<super::ResponseRenderersItem>,
::std::string::String,
>,
}
impl ::std::default::Default for Response {
fn default() -> Self {
Self {
ext: Ok(Default::default()),
renderers: Err("no value supplied for renderers".to_string()),
}
}
}
impl Response {
pub fn ext<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Ext>>,
T::Error: ::std::fmt::Display,
{
self.ext = value
.try_into()
.map_err(|e| format!("error converting supplied value for ext: {e}"));
self
}
pub fn renderers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ResponseRenderersItem>>,
T::Error: ::std::fmt::Display,
{
self.renderers = value
.try_into()
.map_err(|e| format!("error converting supplied value for renderers: {e}"));
self
}
}
impl ::std::convert::TryFrom<Response> for super::Response {
type Error = super::error::ConversionError;
fn try_from(value: Response) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
ext: value.ext?,
renderers: value.renderers?,
})
}
}
impl ::std::convert::From<super::Response> for Response {
fn from(value: super::Response) -> Self {
Self {
ext: Ok(value.ext),
renderers: Ok(value.renderers),
}
}
}
#[derive(Clone, Debug)]
pub struct ResponseRenderersItem {
can_carry_predicates: ::std::result::Result<bool, ::std::string::String>,
canonical: ::std::result::Result<::std::option::Option<bool>, ::std::string::String>,
description: ::std::result::Result<
::std::option::Option<super::ResponseRenderersItemDescription>,
::std::string::String,
>,
drops: ::std::result::Result<
::std::vec::Vec<super::ResponseRenderersItemDropsItem>,
::std::string::String,
>,
id: ::std::result::Result<super::ResponseRenderersItemId, ::std::string::String>,
}
impl ::std::default::Default for ResponseRenderersItem {
fn default() -> Self {
Self {
can_carry_predicates: Err("no value supplied for can_carry_predicates".to_string()),
canonical: Ok(Default::default()),
description: Ok(Default::default()),
drops: Err("no value supplied for drops".to_string()),
id: Err("no value supplied for id".to_string()),
}
}
}
impl ResponseRenderersItem {
pub fn can_carry_predicates<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.can_carry_predicates = value.try_into().map_err(|e| {
format!("error converting supplied value for can_carry_predicates: {e}")
});
self
}
pub fn canonical<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<bool>>,
T::Error: ::std::fmt::Display,
{
self.canonical = value
.try_into()
.map_err(|e| format!("error converting supplied value for canonical: {e}"));
self
}
pub fn description<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<
::std::option::Option<super::ResponseRenderersItemDescription>,
>,
T::Error: ::std::fmt::Display,
{
self.description = value
.try_into()
.map_err(|e| format!("error converting supplied value for description: {e}"));
self
}
pub fn drops<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::ResponseRenderersItemDropsItem>>,
T::Error: ::std::fmt::Display,
{
self.drops = value
.try_into()
.map_err(|e| format!("error converting supplied value for drops: {e}"));
self
}
pub fn id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ResponseRenderersItemId>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
}
impl ::std::convert::TryFrom<ResponseRenderersItem> for super::ResponseRenderersItem {
type Error = super::error::ConversionError;
fn try_from(
value: ResponseRenderersItem,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
can_carry_predicates: value.can_carry_predicates?,
canonical: value.canonical?,
description: value.description?,
drops: value.drops?,
id: value.id?,
})
}
}
impl ::std::convert::From<super::ResponseRenderersItem> for ResponseRenderersItem {
fn from(value: super::ResponseRenderersItem) -> Self {
Self {
can_carry_predicates: Ok(value.can_carry_predicates),
canonical: Ok(value.canonical),
description: Ok(value.description),
drops: Ok(value.drops),
id: Ok(value.id),
}
}
}
}
impl crate::Payload for Payload {
const TYPE_URI: &'static str = "https://trusttasks.org/spec/persona/renderers/list/1.0";
const IS_PROOF_REQUIRED: bool = true;
const IS_RECIPIENT_REQUIRED: bool = true;
const PAYLOAD_SCHEMA: Option<&'static str> = Some(
"{\n \"$defs\": {\n \"Ext\": {\n \"additionalProperties\": true,\n \"description\": \"Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.\",\n \"minProperties\": 1,\n \"propertyNames\": {\n \"pattern\": \"^[a-z][a-z0-9-]*(\\\\.[a-z0-9-]+)+$\"\n },\n \"title\": \"Ext\",\n \"type\": \"object\"\n },\n \"Response\": {\n \"$anchor\": \"response\",\n \"additionalProperties\": false,\n \"description\": \"Success response to persona/renderers/list. Type https://trusttasks.org/spec/persona/renderers/list/1.0#response.\",\n \"properties\": {\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\"\n },\n \"renderers\": {\n \"items\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"canCarryPredicates\": {\n \"description\": \"Whether the format can represent a claim proven rather than shown. Most cannot: there is no field in a general contact format for 'over the threshold'. A disclosure containing a predicate through a renderer that cannot carry one fails at negotiation rather than silently dropping the claim.\",\n \"type\": \"boolean\"\n },\n \"canonical\": {\n \"description\": \"True for the maintainer's lossless native form, used when a producer names no renderer. Exactly one renderer is canonical.\",\n \"type\": \"boolean\"\n },\n \"description\": {\n \"maxLength\": 512,\n \"type\": \"string\"\n },\n \"drops\": {\n \"description\": \"What this format discards — commonly provenance, because most general-purpose contact formats have nowhere to put it. Declared here so that lossiness is negotiated rather than discovered by a holder afterwards.\",\n \"items\": {\n \"maxLength\": 64,\n \"type\": \"string\"\n },\n \"maxItems\": 32,\n \"type\": \"array\"\n },\n \"id\": {\n \"maxLength\": 64,\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"drops\",\n \"canCarryPredicates\"\n ],\n \"type\": \"object\"\n },\n \"maxItems\": 32,\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"renderers\"\n ],\n \"title\": \"Persona Renderers List — response payload\",\n \"type\": \"object\"\n }\n },\n \"$id\": \"https://trusttasks.org/spec/persona/renderers/list/1.0\",\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"additionalProperties\": false,\n \"description\": \"Enumerate the output formats this agent can present in, and what each one discards. A client cannot negotiate a format it cannot discover.\",\n \"properties\": {\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\"\n }\n },\n \"title\": \"Persona Renderers List — payload\",\n \"type\": \"object\"\n}\n",
);
}
impl crate::Payload for Response {
const TYPE_URI: &'static str =
"https://trusttasks.org/spec/persona/renderers/list/1.0#response";
const IS_PROOF_REQUIRED: bool = true;
const IS_RECIPIENT_REQUIRED: bool = true;
const PAYLOAD_SCHEMA: Option<&'static str> = Some(
"{\n \"$defs\": {\n \"Ext\": {\n \"additionalProperties\": true,\n \"description\": \"Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.\",\n \"minProperties\": 1,\n \"propertyNames\": {\n \"pattern\": \"^[a-z][a-z0-9-]*(\\\\.[a-z0-9-]+)+$\"\n },\n \"title\": \"Ext\",\n \"type\": \"object\"\n },\n \"Response\": {\n \"$anchor\": \"response\",\n \"additionalProperties\": false,\n \"description\": \"Success response to persona/renderers/list. Type https://trusttasks.org/spec/persona/renderers/list/1.0#response.\",\n \"properties\": {\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\"\n },\n \"renderers\": {\n \"items\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"canCarryPredicates\": {\n \"description\": \"Whether the format can represent a claim proven rather than shown. Most cannot: there is no field in a general contact format for 'over the threshold'. A disclosure containing a predicate through a renderer that cannot carry one fails at negotiation rather than silently dropping the claim.\",\n \"type\": \"boolean\"\n },\n \"canonical\": {\n \"description\": \"True for the maintainer's lossless native form, used when a producer names no renderer. Exactly one renderer is canonical.\",\n \"type\": \"boolean\"\n },\n \"description\": {\n \"maxLength\": 512,\n \"type\": \"string\"\n },\n \"drops\": {\n \"description\": \"What this format discards — commonly provenance, because most general-purpose contact formats have nowhere to put it. Declared here so that lossiness is negotiated rather than discovered by a holder afterwards.\",\n \"items\": {\n \"maxLength\": 64,\n \"type\": \"string\"\n },\n \"maxItems\": 32,\n \"type\": \"array\"\n },\n \"id\": {\n \"maxLength\": 64,\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\",\n \"drops\",\n \"canCarryPredicates\"\n ],\n \"type\": \"object\"\n },\n \"maxItems\": 32,\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"renderers\"\n ],\n \"title\": \"Persona Renderers List — response payload\",\n \"type\": \"object\"\n }\n },\n \"$ref\": \"#/$defs/Response\",\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\"\n}\n",
);
}
impl crate::RequestPayload for Payload {
type Response = Response;
}