//! Generated by `trust-tasks-codegen` — do not edit by hand.
//!
//! Spec slug: `vta/pcs/root-request`. Version: `0.1`.
#[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())
}
}
}
///The community's hidden-vetting parameters exactly as its join manifest publishes them, under the criterion's `vetting.ext`. The caller copies them in verbatim on every call that needs them, because the community rotates labels and the engine keeps no copy of its own: a stale copy costs the caller a refused proof, never a mistaken one.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "CommunityParameters",
/// "description": "The community's hidden-vetting parameters exactly as its join manifest publishes them, under the criterion's `vetting.ext`. The caller copies them in verbatim on every call that needs them, because the community rotates labels and the engine keeps no copy of its own: a stale copy costs the caller a refused proof, never a mistaken one.",
/// "$ref": "#/definitions/PublishedConfig"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CommunityParameters(pub PublishedConfig);
impl ::std::ops::Deref for CommunityParameters {
type Target = PublishedConfig;
fn deref(&self) -> &PublishedConfig {
&self.0
}
}
impl ::std::convert::From<CommunityParameters> for PublishedConfig {
fn from(value: CommunityParameters) -> Self {
value.0
}
}
impl ::std::convert::From<PublishedConfig> for CommunityParameters {
fn from(value: PublishedConfig) -> Self {
Self(value)
}
}
///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())
})
}
}
///A vetter's client asks its VTA for the blinded request that enrols the vetter with a community for a vetting period; the VTA creates the vetter's PCS key on first use and keeps the blinding state.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$id": "https://trusttasks.org/spec/vta/pcs/root-request/0.1",
/// "title": "Payload",
/// "description": "A vetter's client asks its VTA for the blinded request that enrols the vetter with a community for a vetting period; the VTA creates the vetter's PCS key on first use and keeps the blinding state.",
/// "type": "object",
/// "required": [
/// "community",
/// "contextId",
/// "label",
/// "memberDid",
/// "parameters"
/// ],
/// "properties": {
/// "community": {
/// "description": "The community's DID: the helper whose parameters the engine runs under.",
/// "type": "string",
/// "minLength": 1
/// },
/// "contextId": {
/// "description": "The context the engine belongs to. Its key is derived from this context's base.",
/// "type": "string",
/// "minLength": 1
/// },
/// "ext": {
/// "$ref": "#/definitions/Ext"
/// },
/// "label": {
/// "description": "The class label to enrol under: the community's current one.",
/// "type": "string",
/// "pattern": "^vetter/[0-9]{4}-[0-9]{2}$"
/// },
/// "memberDid": {
/// "description": "The vetter's member DID in the community: the DID that signs the requests the client sends on the vetter's behalf.",
/// "type": "string",
/// "minLength": 1
/// },
/// "parameters": {
/// "description": "The community's published hidden-vetting parameters, copied verbatim from its join manifest.",
/// "$ref": "#/definitions/CommunityParameters"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct Payload {
///The community's DID: the helper whose parameters the engine runs under.
pub community: PayloadCommunity,
///The context the engine belongs to. Its key is derived from this context's base.
#[serde(rename = "contextId")]
pub context_id: PayloadContextId,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ext: ::std::option::Option<Ext>,
///The class label to enrol under: the community's current one.
pub label: PayloadLabel,
///The vetter's member DID in the community: the DID that signs the requests the client sends on the vetter's behalf.
#[serde(rename = "memberDid")]
pub member_did: PayloadMemberDid,
///The community's published hidden-vetting parameters, copied verbatim from its join manifest.
pub parameters: CommunityParameters,
}
impl Payload {
pub fn builder() -> builder::Payload {
Default::default()
}
}
///The community's DID: the helper whose parameters the engine runs under.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The community's DID: the helper whose parameters the engine runs under.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PayloadCommunity(::std::string::String);
impl ::std::ops::Deref for PayloadCommunity {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PayloadCommunity> for ::std::string::String {
fn from(value: PayloadCommunity) -> Self {
value.0
}
}
impl ::std::str::FromStr for PayloadCommunity {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PayloadCommunity {
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 PayloadCommunity {
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 PayloadCommunity {
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 PayloadCommunity {
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())
})
}
}
///The context the engine belongs to. Its key is derived from this context's base.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The context the engine belongs to. Its key is derived from this context's base.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PayloadContextId(::std::string::String);
impl ::std::ops::Deref for PayloadContextId {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PayloadContextId> for ::std::string::String {
fn from(value: PayloadContextId) -> Self {
value.0
}
}
impl ::std::str::FromStr for PayloadContextId {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PayloadContextId {
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 PayloadContextId {
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 PayloadContextId {
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 PayloadContextId {
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())
})
}
}
///The class label to enrol under: the community's current one.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The class label to enrol under: the community's current one.",
/// "type": "string",
/// "pattern": "^vetter/[0-9]{4}-[0-9]{2}$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PayloadLabel(::std::string::String);
impl ::std::ops::Deref for PayloadLabel {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PayloadLabel> for ::std::string::String {
fn from(value: PayloadLabel) -> Self {
value.0
}
}
impl ::std::str::FromStr for PayloadLabel {
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("^vetter/[0-9]{4}-[0-9]{2}$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^vetter/[0-9]{4}-[0-9]{2}$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PayloadLabel {
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 PayloadLabel {
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 PayloadLabel {
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 PayloadLabel {
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())
})
}
}
///The vetter's member DID in the community: the DID that signs the requests the client sends on the vetter's behalf.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The vetter's member DID in the community: the DID that signs the requests the client sends on the vetter's behalf.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PayloadMemberDid(::std::string::String);
impl ::std::ops::Deref for PayloadMemberDid {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PayloadMemberDid> for ::std::string::String {
fn from(value: PayloadMemberDid) -> Self {
value.0
}
}
impl ::std::str::FromStr for PayloadMemberDid {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PayloadMemberDid {
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 PayloadMemberDid {
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 PayloadMemberDid {
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 PayloadMemberDid {
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())
})
}
}
///The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "PublishedConfig",
/// "description": "The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.",
/// "type": "object",
/// "required": [
/// "dripPerTick",
/// "events",
/// "helperKey",
/// "suite",
/// "tickLength",
/// "tokenKey",
/// "tokenLabels",
/// "vetterLabels"
/// ],
/// "properties": {
/// "dripPerTick": {
/// "type": "integer",
/// "minimum": 1.0
/// },
/// "events": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PublishedEvent"
/// }
/// },
/// "helperKey": {
/// "description": "The helper verification key, multibase — named for its role on the wire rather than for hvk.",
/// "type": "string",
/// "minLength": 1
/// },
/// "suite": {
/// "type": "string",
/// "minLength": 1
/// },
/// "tickLength": {
/// "$ref": "#/definitions/TickLength"
/// },
/// "tokenKey": {
/// "description": "The token verification key, multibase — named for its role on the wire rather than for tvk.",
/// "type": "string",
/// "minLength": 1
/// },
/// "tokenLabels": {
/// "type": "array",
/// "items": {
/// "type": "string",
/// "minLength": 1
/// }
/// },
/// "vetterLabels": {
/// "description": "Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period.",
/// "type": "array",
/// "items": {
/// "type": "string",
/// "minLength": 1
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct PublishedConfig {
#[serde(rename = "dripPerTick")]
pub drip_per_tick: ::std::num::NonZeroU64,
pub events: ::std::vec::Vec<PublishedEvent>,
///The helper verification key, multibase — named for its role on the wire rather than for hvk.
#[serde(rename = "helperKey")]
pub helper_key: PublishedConfigHelperKey,
pub suite: PublishedConfigSuite,
#[serde(rename = "tickLength")]
pub tick_length: TickLength,
///The token verification key, multibase — named for its role on the wire rather than for tvk.
#[serde(rename = "tokenKey")]
pub token_key: PublishedConfigTokenKey,
#[serde(rename = "tokenLabels")]
pub token_labels: ::std::vec::Vec<PublishedConfigTokenLabelsItem>,
///Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period.
#[serde(rename = "vetterLabels")]
pub vetter_labels: ::std::vec::Vec<PublishedConfigVetterLabelsItem>,
}
impl PublishedConfig {
pub fn builder() -> builder::PublishedConfig {
Default::default()
}
}
///The helper verification key, multibase — named for its role on the wire rather than for hvk.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The helper verification key, multibase — named for its role on the wire rather than for hvk.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PublishedConfigHelperKey(::std::string::String);
impl ::std::ops::Deref for PublishedConfigHelperKey {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PublishedConfigHelperKey> for ::std::string::String {
fn from(value: PublishedConfigHelperKey) -> Self {
value.0
}
}
impl ::std::str::FromStr for PublishedConfigHelperKey {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PublishedConfigHelperKey {
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 PublishedConfigHelperKey {
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 PublishedConfigHelperKey {
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 PublishedConfigHelperKey {
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())
})
}
}
///`PublishedConfigSuite`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PublishedConfigSuite(::std::string::String);
impl ::std::ops::Deref for PublishedConfigSuite {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PublishedConfigSuite> for ::std::string::String {
fn from(value: PublishedConfigSuite) -> Self {
value.0
}
}
impl ::std::str::FromStr for PublishedConfigSuite {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PublishedConfigSuite {
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 PublishedConfigSuite {
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 PublishedConfigSuite {
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 PublishedConfigSuite {
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())
})
}
}
///The token verification key, multibase — named for its role on the wire rather than for tvk.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The token verification key, multibase — named for its role on the wire rather than for tvk.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PublishedConfigTokenKey(::std::string::String);
impl ::std::ops::Deref for PublishedConfigTokenKey {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PublishedConfigTokenKey> for ::std::string::String {
fn from(value: PublishedConfigTokenKey) -> Self {
value.0
}
}
impl ::std::str::FromStr for PublishedConfigTokenKey {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PublishedConfigTokenKey {
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 PublishedConfigTokenKey {
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 PublishedConfigTokenKey {
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 PublishedConfigTokenKey {
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())
})
}
}
///`PublishedConfigTokenLabelsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PublishedConfigTokenLabelsItem(::std::string::String);
impl ::std::ops::Deref for PublishedConfigTokenLabelsItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PublishedConfigTokenLabelsItem> for ::std::string::String {
fn from(value: PublishedConfigTokenLabelsItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for PublishedConfigTokenLabelsItem {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PublishedConfigTokenLabelsItem {
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 PublishedConfigTokenLabelsItem {
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 PublishedConfigTokenLabelsItem {
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 PublishedConfigTokenLabelsItem {
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())
})
}
}
///`PublishedConfigVetterLabelsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PublishedConfigVetterLabelsItem(::std::string::String);
impl ::std::ops::Deref for PublishedConfigVetterLabelsItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PublishedConfigVetterLabelsItem> for ::std::string::String {
fn from(value: PublishedConfigVetterLabelsItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for PublishedConfigVetterLabelsItem {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PublishedConfigVetterLabelsItem {
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 PublishedConfigVetterLabelsItem {
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 PublishedConfigVetterLabelsItem {
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 PublishedConfigVetterLabelsItem {
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())
})
}
}
///The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "PublishedEvent",
/// "description": "The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.",
/// "type": "object",
/// "required": [
/// "endDate",
/// "eventId",
/// "groupFloor",
/// "startDate",
/// "tiers"
/// ],
/// "properties": {
/// "endDate": {
/// "type": "string",
/// "format": "date"
/// },
/// "eventId": {
/// "type": "string",
/// "minLength": 1
/// },
/// "groupFloor": {
/// "type": "integer",
/// "minimum": 1.0
/// },
/// "startDate": {
/// "type": "string",
/// "format": "date"
/// },
/// "tiers": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Tier"
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct PublishedEvent {
#[serde(rename = "endDate")]
pub end_date: ::chrono::naive::NaiveDate,
#[serde(rename = "eventId")]
pub event_id: PublishedEventEventId,
#[serde(rename = "groupFloor")]
pub group_floor: ::std::num::NonZeroU64,
#[serde(rename = "startDate")]
pub start_date: ::chrono::naive::NaiveDate,
pub tiers: ::std::vec::Vec<Tier>,
}
impl PublishedEvent {
pub fn builder() -> builder::PublishedEvent {
Default::default()
}
}
///`PublishedEventEventId`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PublishedEventEventId(::std::string::String);
impl ::std::ops::Deref for PublishedEventEventId {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PublishedEventEventId> for ::std::string::String {
fn from(value: PublishedEventEventId) -> Self {
value.0
}
}
impl ::std::str::FromStr for PublishedEventEventId {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PublishedEventEventId {
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 PublishedEventEventId {
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 PublishedEventEventId {
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 PublishedEventEventId {
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())
})
}
}
///`Response`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Response",
/// "type": "object",
/// "required": [
/// "request"
/// ],
/// "properties": {
/// "ext": {
/// "$ref": "#/definitions/Ext"
/// },
/// "request": {
/// "$ref": "#/definitions/RootRequest"
/// }
/// },
/// "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 request: RootRequest,
}
impl Response {
pub fn builder() -> builder::Response {
Default::default()
}
}
///The payload of a vtc/vetting/vetters/pcs-root/0.1 request, without its ext: what the client sends the community.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "RootRequest",
/// "description": "The payload of a vtc/vetting/vetters/pcs-root/0.1 request, without its ext: what the client sends the community.",
/// "type": "object",
/// "required": [
/// "id",
/// "label",
/// "request"
/// ],
/// "properties": {
/// "id": {
/// "description": "The vetter's PCS identifier for this community.",
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
/// },
/// "label": {
/// "type": "string",
/// "pattern": "^vetter/[0-9]{4}-[0-9]{2}$"
/// },
/// "request": {
/// "type": "object",
/// "required": [
/// "proof"
/// ],
/// "properties": {
/// "encoding": {
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
/// },
/// "proof": {
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
/// },
/// "t0": {
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
/// }
/// },
/// "additionalProperties": false
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct RootRequest {
///The vetter's PCS identifier for this community.
pub id: RootRequestId,
pub label: RootRequestLabel,
pub request: RootRequestRequest,
}
impl RootRequest {
pub fn builder() -> builder::RootRequest {
Default::default()
}
}
///The vetter's PCS identifier for this community.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The vetter's PCS identifier for this community.",
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct RootRequestId(::std::string::String);
impl ::std::ops::Deref for RootRequestId {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<RootRequestId> for ::std::string::String {
fn from(value: RootRequestId) -> Self {
value.0
}
}
impl ::std::str::FromStr for RootRequestId {
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("^z[1-9A-HJ-NP-Za-km-z]+$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^z[1-9A-HJ-NP-Za-km-z]+$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for RootRequestId {
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 RootRequestId {
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 RootRequestId {
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 RootRequestId {
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())
})
}
}
///`RootRequestLabel`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^vetter/[0-9]{4}-[0-9]{2}$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct RootRequestLabel(::std::string::String);
impl ::std::ops::Deref for RootRequestLabel {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<RootRequestLabel> for ::std::string::String {
fn from(value: RootRequestLabel) -> Self {
value.0
}
}
impl ::std::str::FromStr for RootRequestLabel {
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("^vetter/[0-9]{4}-[0-9]{2}$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^vetter/[0-9]{4}-[0-9]{2}$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for RootRequestLabel {
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 RootRequestLabel {
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 RootRequestLabel {
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 RootRequestLabel {
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())
})
}
}
///`RootRequestRequest`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "object",
/// "required": [
/// "proof"
/// ],
/// "properties": {
/// "encoding": {
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
/// },
/// "proof": {
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
/// },
/// "t0": {
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct RootRequestRequest {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub encoding: ::std::option::Option<RootRequestRequestEncoding>,
pub proof: RootRequestRequestProof,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub t0: ::std::option::Option<RootRequestRequestT0>,
}
impl RootRequestRequest {
pub fn builder() -> builder::RootRequestRequest {
Default::default()
}
}
///`RootRequestRequestEncoding`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct RootRequestRequestEncoding(::std::string::String);
impl ::std::ops::Deref for RootRequestRequestEncoding {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<RootRequestRequestEncoding> for ::std::string::String {
fn from(value: RootRequestRequestEncoding) -> Self {
value.0
}
}
impl ::std::str::FromStr for RootRequestRequestEncoding {
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("^z[1-9A-HJ-NP-Za-km-z]+$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^z[1-9A-HJ-NP-Za-km-z]+$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for RootRequestRequestEncoding {
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 RootRequestRequestEncoding {
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 RootRequestRequestEncoding {
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 RootRequestRequestEncoding {
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())
})
}
}
///`RootRequestRequestProof`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct RootRequestRequestProof(::std::string::String);
impl ::std::ops::Deref for RootRequestRequestProof {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<RootRequestRequestProof> for ::std::string::String {
fn from(value: RootRequestRequestProof) -> Self {
value.0
}
}
impl ::std::str::FromStr for RootRequestRequestProof {
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("^z[1-9A-HJ-NP-Za-km-z]+$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^z[1-9A-HJ-NP-Za-km-z]+$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for RootRequestRequestProof {
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 RootRequestRequestProof {
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 RootRequestRequestProof {
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 RootRequestRequestProof {
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())
})
}
}
///`RootRequestRequestT0`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct RootRequestRequestT0(::std::string::String);
impl ::std::ops::Deref for RootRequestRequestT0 {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<RootRequestRequestT0> for ::std::string::String {
fn from(value: RootRequestRequestT0) -> Self {
value.0
}
}
impl ::std::str::FromStr for RootRequestRequestT0 {
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("^z[1-9A-HJ-NP-Za-km-z]+$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^z[1-9A-HJ-NP-Za-km-z]+$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for RootRequestRequestT0 {
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 RootRequestRequestT0 {
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 RootRequestRequestT0 {
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 RootRequestRequestT0 {
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())
})
}
}
///The length of one tick of the drip, as an ISO 8601 duration in days and/or hours — at least `PT1H`. A label's tick `t` is the window starting `t` tick lengths after the label's start (`vtc/vetting/vetters/pcs-tokens`).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "TickLength",
/// "description": "The length of one tick of the drip, as an ISO 8601 duration in days and/or hours — at least `PT1H`. A label's tick `t` is the window starting `t` tick lengths after the label's start (`vtc/vetting/vetters/pcs-tokens`).",
/// "type": "string",
/// "pattern": "^P(?:\\d+D(?:T\\d+H)?|T\\d+H)$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TickLength(::std::string::String);
impl ::std::ops::Deref for TickLength {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<TickLength> for ::std::string::String {
fn from(value: TickLength) -> Self {
value.0
}
}
impl ::std::str::FromStr for TickLength {
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("^P(?:\\d+D(?:T\\d+H)?|T\\d+H)$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^P(?:\\d+D(?:T\\d+H)?|T\\d+H)$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for TickLength {
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 TickLength {
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 TickLength {
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 TickLength {
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())
})
}
}
///`Tier`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Tier",
/// "type": "object",
/// "required": [
/// "dripPerTick",
/// "name"
/// ],
/// "properties": {
/// "dripPerTick": {
/// "description": "How many tokens a tick under this tier yields.",
/// "type": "integer",
/// "minimum": 1.0
/// },
/// "name": {
/// "description": "How the menu names it: desk, busy-desk.",
/// "type": "string",
/// "minLength": 1
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct Tier {
///How many tokens a tick under this tier yields.
#[serde(rename = "dripPerTick")]
pub drip_per_tick: ::std::num::NonZeroU64,
///How the menu names it: desk, busy-desk.
pub name: TierName,
}
impl Tier {
pub fn builder() -> builder::Tier {
Default::default()
}
}
///How the menu names it: desk, busy-desk.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "How the menu names it: desk, busy-desk.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TierName(::std::string::String);
impl ::std::ops::Deref for TierName {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<TierName> for ::std::string::String {
fn from(value: TierName) -> Self {
value.0
}
}
impl ::std::str::FromStr for TierName {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for TierName {
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 TierName {
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 TierName {
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 TierName {
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 {
community: ::std::result::Result<super::PayloadCommunity, ::std::string::String>,
context_id: ::std::result::Result<super::PayloadContextId, ::std::string::String>,
ext: ::std::result::Result<::std::option::Option<super::Ext>, ::std::string::String>,
label: ::std::result::Result<super::PayloadLabel, ::std::string::String>,
member_did: ::std::result::Result<super::PayloadMemberDid, ::std::string::String>,
parameters: ::std::result::Result<super::CommunityParameters, ::std::string::String>,
}
impl ::std::default::Default for Payload {
fn default() -> Self {
Self {
community: Err("no value supplied for community".to_string()),
context_id: Err("no value supplied for context_id".to_string()),
ext: Ok(Default::default()),
label: Err("no value supplied for label".to_string()),
member_did: Err("no value supplied for member_did".to_string()),
parameters: Err("no value supplied for parameters".to_string()),
}
}
}
impl Payload {
pub fn community<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PayloadCommunity>,
T::Error: ::std::fmt::Display,
{
self.community = value
.try_into()
.map_err(|e| format!("error converting supplied value for community: {e}"));
self
}
pub fn context_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PayloadContextId>,
T::Error: ::std::fmt::Display,
{
self.context_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for context_id: {e}"));
self
}
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 label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PayloadLabel>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn member_did<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PayloadMemberDid>,
T::Error: ::std::fmt::Display,
{
self.member_did = value
.try_into()
.map_err(|e| format!("error converting supplied value for member_did: {e}"));
self
}
pub fn parameters<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::CommunityParameters>,
T::Error: ::std::fmt::Display,
{
self.parameters = value
.try_into()
.map_err(|e| format!("error converting supplied value for parameters: {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 {
community: value.community?,
context_id: value.context_id?,
ext: value.ext?,
label: value.label?,
member_did: value.member_did?,
parameters: value.parameters?,
})
}
}
impl ::std::convert::From<super::Payload> for Payload {
fn from(value: super::Payload) -> Self {
Self {
community: Ok(value.community),
context_id: Ok(value.context_id),
ext: Ok(value.ext),
label: Ok(value.label),
member_did: Ok(value.member_did),
parameters: Ok(value.parameters),
}
}
}
#[derive(Clone, Debug)]
pub struct PublishedConfig {
drip_per_tick: ::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
events:
::std::result::Result<::std::vec::Vec<super::PublishedEvent>, ::std::string::String>,
helper_key: ::std::result::Result<super::PublishedConfigHelperKey, ::std::string::String>,
suite: ::std::result::Result<super::PublishedConfigSuite, ::std::string::String>,
tick_length: ::std::result::Result<super::TickLength, ::std::string::String>,
token_key: ::std::result::Result<super::PublishedConfigTokenKey, ::std::string::String>,
token_labels: ::std::result::Result<
::std::vec::Vec<super::PublishedConfigTokenLabelsItem>,
::std::string::String,
>,
vetter_labels: ::std::result::Result<
::std::vec::Vec<super::PublishedConfigVetterLabelsItem>,
::std::string::String,
>,
}
impl ::std::default::Default for PublishedConfig {
fn default() -> Self {
Self {
drip_per_tick: Err("no value supplied for drip_per_tick".to_string()),
events: Err("no value supplied for events".to_string()),
helper_key: Err("no value supplied for helper_key".to_string()),
suite: Err("no value supplied for suite".to_string()),
tick_length: Err("no value supplied for tick_length".to_string()),
token_key: Err("no value supplied for token_key".to_string()),
token_labels: Err("no value supplied for token_labels".to_string()),
vetter_labels: Err("no value supplied for vetter_labels".to_string()),
}
}
}
impl PublishedConfig {
pub fn drip_per_tick<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.drip_per_tick = value
.try_into()
.map_err(|e| format!("error converting supplied value for drip_per_tick: {e}"));
self
}
pub fn events<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::PublishedEvent>>,
T::Error: ::std::fmt::Display,
{
self.events = value
.try_into()
.map_err(|e| format!("error converting supplied value for events: {e}"));
self
}
pub fn helper_key<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PublishedConfigHelperKey>,
T::Error: ::std::fmt::Display,
{
self.helper_key = value
.try_into()
.map_err(|e| format!("error converting supplied value for helper_key: {e}"));
self
}
pub fn suite<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PublishedConfigSuite>,
T::Error: ::std::fmt::Display,
{
self.suite = value
.try_into()
.map_err(|e| format!("error converting supplied value for suite: {e}"));
self
}
pub fn tick_length<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::TickLength>,
T::Error: ::std::fmt::Display,
{
self.tick_length = value
.try_into()
.map_err(|e| format!("error converting supplied value for tick_length: {e}"));
self
}
pub fn token_key<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PublishedConfigTokenKey>,
T::Error: ::std::fmt::Display,
{
self.token_key = value
.try_into()
.map_err(|e| format!("error converting supplied value for token_key: {e}"));
self
}
pub fn token_labels<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::PublishedConfigTokenLabelsItem>>,
T::Error: ::std::fmt::Display,
{
self.token_labels = value
.try_into()
.map_err(|e| format!("error converting supplied value for token_labels: {e}"));
self
}
pub fn vetter_labels<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::PublishedConfigVetterLabelsItem>>,
T::Error: ::std::fmt::Display,
{
self.vetter_labels = value
.try_into()
.map_err(|e| format!("error converting supplied value for vetter_labels: {e}"));
self
}
}
impl ::std::convert::TryFrom<PublishedConfig> for super::PublishedConfig {
type Error = super::error::ConversionError;
fn try_from(
value: PublishedConfig,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
drip_per_tick: value.drip_per_tick?,
events: value.events?,
helper_key: value.helper_key?,
suite: value.suite?,
tick_length: value.tick_length?,
token_key: value.token_key?,
token_labels: value.token_labels?,
vetter_labels: value.vetter_labels?,
})
}
}
impl ::std::convert::From<super::PublishedConfig> for PublishedConfig {
fn from(value: super::PublishedConfig) -> Self {
Self {
drip_per_tick: Ok(value.drip_per_tick),
events: Ok(value.events),
helper_key: Ok(value.helper_key),
suite: Ok(value.suite),
tick_length: Ok(value.tick_length),
token_key: Ok(value.token_key),
token_labels: Ok(value.token_labels),
vetter_labels: Ok(value.vetter_labels),
}
}
}
#[derive(Clone, Debug)]
pub struct PublishedEvent {
end_date: ::std::result::Result<::chrono::naive::NaiveDate, ::std::string::String>,
event_id: ::std::result::Result<super::PublishedEventEventId, ::std::string::String>,
group_floor: ::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
start_date: ::std::result::Result<::chrono::naive::NaiveDate, ::std::string::String>,
tiers: ::std::result::Result<::std::vec::Vec<super::Tier>, ::std::string::String>,
}
impl ::std::default::Default for PublishedEvent {
fn default() -> Self {
Self {
end_date: Err("no value supplied for end_date".to_string()),
event_id: Err("no value supplied for event_id".to_string()),
group_floor: Err("no value supplied for group_floor".to_string()),
start_date: Err("no value supplied for start_date".to_string()),
tiers: Err("no value supplied for tiers".to_string()),
}
}
}
impl PublishedEvent {
pub fn end_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::chrono::naive::NaiveDate>,
T::Error: ::std::fmt::Display,
{
self.end_date = value
.try_into()
.map_err(|e| format!("error converting supplied value for end_date: {e}"));
self
}
pub fn event_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PublishedEventEventId>,
T::Error: ::std::fmt::Display,
{
self.event_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for event_id: {e}"));
self
}
pub fn group_floor<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.group_floor = value
.try_into()
.map_err(|e| format!("error converting supplied value for group_floor: {e}"));
self
}
pub fn start_date<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::chrono::naive::NaiveDate>,
T::Error: ::std::fmt::Display,
{
self.start_date = value
.try_into()
.map_err(|e| format!("error converting supplied value for start_date: {e}"));
self
}
pub fn tiers<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::Tier>>,
T::Error: ::std::fmt::Display,
{
self.tiers = value
.try_into()
.map_err(|e| format!("error converting supplied value for tiers: {e}"));
self
}
}
impl ::std::convert::TryFrom<PublishedEvent> for super::PublishedEvent {
type Error = super::error::ConversionError;
fn try_from(
value: PublishedEvent,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
end_date: value.end_date?,
event_id: value.event_id?,
group_floor: value.group_floor?,
start_date: value.start_date?,
tiers: value.tiers?,
})
}
}
impl ::std::convert::From<super::PublishedEvent> for PublishedEvent {
fn from(value: super::PublishedEvent) -> Self {
Self {
end_date: Ok(value.end_date),
event_id: Ok(value.event_id),
group_floor: Ok(value.group_floor),
start_date: Ok(value.start_date),
tiers: Ok(value.tiers),
}
}
}
#[derive(Clone, Debug)]
pub struct Response {
ext: ::std::result::Result<::std::option::Option<super::Ext>, ::std::string::String>,
request: ::std::result::Result<super::RootRequest, ::std::string::String>,
}
impl ::std::default::Default for Response {
fn default() -> Self {
Self {
ext: Ok(Default::default()),
request: Err("no value supplied for request".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 request<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RootRequest>,
T::Error: ::std::fmt::Display,
{
self.request = value
.try_into()
.map_err(|e| format!("error converting supplied value for request: {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?,
request: value.request?,
})
}
}
impl ::std::convert::From<super::Response> for Response {
fn from(value: super::Response) -> Self {
Self {
ext: Ok(value.ext),
request: Ok(value.request),
}
}
}
#[derive(Clone, Debug)]
pub struct RootRequest {
id: ::std::result::Result<super::RootRequestId, ::std::string::String>,
label: ::std::result::Result<super::RootRequestLabel, ::std::string::String>,
request: ::std::result::Result<super::RootRequestRequest, ::std::string::String>,
}
impl ::std::default::Default for RootRequest {
fn default() -> Self {
Self {
id: Err("no value supplied for id".to_string()),
label: Err("no value supplied for label".to_string()),
request: Err("no value supplied for request".to_string()),
}
}
}
impl RootRequest {
pub fn id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RootRequestId>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RootRequestLabel>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn request<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RootRequestRequest>,
T::Error: ::std::fmt::Display,
{
self.request = value
.try_into()
.map_err(|e| format!("error converting supplied value for request: {e}"));
self
}
}
impl ::std::convert::TryFrom<RootRequest> for super::RootRequest {
type Error = super::error::ConversionError;
fn try_from(
value: RootRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
id: value.id?,
label: value.label?,
request: value.request?,
})
}
}
impl ::std::convert::From<super::RootRequest> for RootRequest {
fn from(value: super::RootRequest) -> Self {
Self {
id: Ok(value.id),
label: Ok(value.label),
request: Ok(value.request),
}
}
}
#[derive(Clone, Debug)]
pub struct RootRequestRequest {
encoding: ::std::result::Result<
::std::option::Option<super::RootRequestRequestEncoding>,
::std::string::String,
>,
proof: ::std::result::Result<super::RootRequestRequestProof, ::std::string::String>,
t0: ::std::result::Result<
::std::option::Option<super::RootRequestRequestT0>,
::std::string::String,
>,
}
impl ::std::default::Default for RootRequestRequest {
fn default() -> Self {
Self {
encoding: Ok(Default::default()),
proof: Err("no value supplied for proof".to_string()),
t0: Ok(Default::default()),
}
}
}
impl RootRequestRequest {
pub fn encoding<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::RootRequestRequestEncoding>>,
T::Error: ::std::fmt::Display,
{
self.encoding = value
.try_into()
.map_err(|e| format!("error converting supplied value for encoding: {e}"));
self
}
pub fn proof<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::RootRequestRequestProof>,
T::Error: ::std::fmt::Display,
{
self.proof = value
.try_into()
.map_err(|e| format!("error converting supplied value for proof: {e}"));
self
}
pub fn t0<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::RootRequestRequestT0>>,
T::Error: ::std::fmt::Display,
{
self.t0 = value
.try_into()
.map_err(|e| format!("error converting supplied value for t0: {e}"));
self
}
}
impl ::std::convert::TryFrom<RootRequestRequest> for super::RootRequestRequest {
type Error = super::error::ConversionError;
fn try_from(
value: RootRequestRequest,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
encoding: value.encoding?,
proof: value.proof?,
t0: value.t0?,
})
}
}
impl ::std::convert::From<super::RootRequestRequest> for RootRequestRequest {
fn from(value: super::RootRequestRequest) -> Self {
Self {
encoding: Ok(value.encoding),
proof: Ok(value.proof),
t0: Ok(value.t0),
}
}
}
#[derive(Clone, Debug)]
pub struct Tier {
drip_per_tick: ::std::result::Result<::std::num::NonZeroU64, ::std::string::String>,
name: ::std::result::Result<super::TierName, ::std::string::String>,
}
impl ::std::default::Default for Tier {
fn default() -> Self {
Self {
drip_per_tick: Err("no value supplied for drip_per_tick".to_string()),
name: Err("no value supplied for name".to_string()),
}
}
}
impl Tier {
pub fn drip_per_tick<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::num::NonZeroU64>,
T::Error: ::std::fmt::Display,
{
self.drip_per_tick = value
.try_into()
.map_err(|e| format!("error converting supplied value for drip_per_tick: {e}"));
self
}
pub fn name<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::TierName>,
T::Error: ::std::fmt::Display,
{
self.name = value
.try_into()
.map_err(|e| format!("error converting supplied value for name: {e}"));
self
}
}
impl ::std::convert::TryFrom<Tier> for super::Tier {
type Error = super::error::ConversionError;
fn try_from(value: Tier) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
drip_per_tick: value.drip_per_tick?,
name: value.name?,
})
}
}
impl ::std::convert::From<super::Tier> for Tier {
fn from(value: super::Tier) -> Self {
Self {
drip_per_tick: Ok(value.drip_per_tick),
name: Ok(value.name),
}
}
}
}
impl crate::Payload for Payload {
const TYPE_URI: &'static str = "https://trusttasks.org/spec/vta/pcs/root-request/0.1";
const IS_PROOF_REQUIRED: bool = true;
const IS_ISSUED_AT_REQUIRED: bool = true;
const IS_RECIPIENT_REQUIRED: bool = true;
const PAYLOAD_SCHEMA: Option<&'static str> = Some(
"{\n \"$defs\": {\n \"CommunityParameters\": {\n \"$ref\": \"#/$defs/PublishedConfig\",\n \"description\": \"The community's hidden-vetting parameters exactly as its join manifest publishes them, under the criterion's `vetting.ext`. The caller copies them in verbatim on every call that needs them, because the community rotates labels and the engine keeps no copy of its own: a stale copy costs the caller a refused proof, never a mistaken one.\",\n \"title\": \"CommunityParameters\"\n },\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 \"PublishedConfig\": {\n \"additionalProperties\": false,\n \"description\": \"The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.\",\n \"properties\": {\n \"dripPerTick\": {\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"events\": {\n \"items\": {\n \"$ref\": \"#/$defs/PublishedEvent\"\n },\n \"type\": \"array\"\n },\n \"helperKey\": {\n \"description\": \"The helper verification key, multibase — named for its role on the wire rather than for hvk.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"suite\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"tickLength\": {\n \"$ref\": \"#/$defs/TickLength\"\n },\n \"tokenKey\": {\n \"description\": \"The token verification key, multibase — named for its role on the wire rather than for tvk.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"tokenLabels\": {\n \"items\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"vetterLabels\": {\n \"description\": \"Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period.\",\n \"items\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"suite\",\n \"helperKey\",\n \"tokenKey\",\n \"vetterLabels\",\n \"tokenLabels\",\n \"dripPerTick\",\n \"tickLength\",\n \"events\"\n ],\n \"title\": \"PublishedConfig\",\n \"type\": \"object\"\n },\n \"PublishedEvent\": {\n \"additionalProperties\": false,\n \"description\": \"The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.\",\n \"properties\": {\n \"endDate\": {\n \"format\": \"date\",\n \"type\": \"string\"\n },\n \"eventId\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"groupFloor\": {\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"startDate\": {\n \"format\": \"date\",\n \"type\": \"string\"\n },\n \"tiers\": {\n \"items\": {\n \"$ref\": \"#/$defs/Tier\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"eventId\",\n \"startDate\",\n \"endDate\",\n \"groupFloor\",\n \"tiers\"\n ],\n \"title\": \"PublishedEvent\",\n \"type\": \"object\"\n },\n \"Response\": {\n \"$anchor\": \"response\",\n \"additionalProperties\": false,\n \"properties\": {\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\"\n },\n \"request\": {\n \"$ref\": \"#/$defs/RootRequest\"\n }\n },\n \"required\": [\n \"request\"\n ],\n \"title\": \"VTA PCS — Root Request — response payload\",\n \"type\": \"object\"\n },\n \"RootRequest\": {\n \"additionalProperties\": false,\n \"description\": \"The payload of a vtc/vetting/vetters/pcs-root/0.1 request, without its ext: what the client sends the community.\",\n \"properties\": {\n \"id\": {\n \"description\": \"The vetter's PCS identifier for this community.\",\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n },\n \"label\": {\n \"pattern\": \"^vetter/[0-9]{4}-[0-9]{2}$\",\n \"type\": \"string\"\n },\n \"request\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"encoding\": {\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n },\n \"proof\": {\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n },\n \"t0\": {\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"proof\"\n ],\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"label\",\n \"id\",\n \"request\"\n ],\n \"title\": \"RootRequest\",\n \"type\": \"object\"\n },\n \"TickLength\": {\n \"description\": \"The length of one tick of the drip, as an ISO 8601 duration in days and/or hours — at least `PT1H`. A label's tick `t` is the window starting `t` tick lengths after the label's start (`vtc/vetting/vetters/pcs-tokens`).\",\n \"pattern\": \"^P(?:\\\\d+D(?:T\\\\d+H)?|T\\\\d+H)$\",\n \"title\": \"TickLength\",\n \"type\": \"string\"\n },\n \"Tier\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"dripPerTick\": {\n \"description\": \"How many tokens a tick under this tier yields.\",\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"name\": {\n \"description\": \"How the menu names it: desk, busy-desk.\",\n \"minLength\": 1,\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\",\n \"dripPerTick\"\n ],\n \"title\": \"Tier\",\n \"type\": \"object\"\n }\n },\n \"$id\": \"https://trusttasks.org/spec/vta/pcs/root-request/0.1\",\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"additionalProperties\": false,\n \"description\": \"A vetter's client asks its VTA for the blinded request that enrols the vetter with a community for a vetting period; the VTA creates the vetter's PCS key on first use and keeps the blinding state.\",\n \"properties\": {\n \"community\": {\n \"description\": \"The community's DID: the helper whose parameters the engine runs under.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"contextId\": {\n \"description\": \"The context the engine belongs to. Its key is derived from this context's base.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\"\n },\n \"label\": {\n \"description\": \"The class label to enrol under: the community's current one.\",\n \"pattern\": \"^vetter/[0-9]{4}-[0-9]{2}$\",\n \"type\": \"string\"\n },\n \"memberDid\": {\n \"description\": \"The vetter's member DID in the community: the DID that signs the requests the client sends on the vetter's behalf.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"parameters\": {\n \"$ref\": \"#/$defs/CommunityParameters\",\n \"description\": \"The community's published hidden-vetting parameters, copied verbatim from its join manifest.\"\n }\n },\n \"required\": [\n \"contextId\",\n \"community\",\n \"memberDid\",\n \"parameters\",\n \"label\"\n ],\n \"title\": \"VTA PCS — Root Request — payload\",\n \"type\": \"object\"\n}\n",
);
}
impl crate::Payload for Response {
const TYPE_URI: &'static str = "https://trusttasks.org/spec/vta/pcs/root-request/0.1#response";
const IS_ISSUED_AT_REQUIRED: bool = true;
const IS_RECIPIENT_REQUIRED: bool = true;
const PAYLOAD_SCHEMA: Option<&'static str> = Some(
"{\n \"$defs\": {\n \"CommunityParameters\": {\n \"$ref\": \"#/$defs/PublishedConfig\",\n \"description\": \"The community's hidden-vetting parameters exactly as its join manifest publishes them, under the criterion's `vetting.ext`. The caller copies them in verbatim on every call that needs them, because the community rotates labels and the engine keeps no copy of its own: a stale copy costs the caller a refused proof, never a mistaken one.\",\n \"title\": \"CommunityParameters\"\n },\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 \"PublishedConfig\": {\n \"additionalProperties\": false,\n \"description\": \"The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.\",\n \"properties\": {\n \"dripPerTick\": {\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"events\": {\n \"items\": {\n \"$ref\": \"#/$defs/PublishedEvent\"\n },\n \"type\": \"array\"\n },\n \"helperKey\": {\n \"description\": \"The helper verification key, multibase — named for its role on the wire rather than for hvk.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"suite\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"tickLength\": {\n \"$ref\": \"#/$defs/TickLength\"\n },\n \"tokenKey\": {\n \"description\": \"The token verification key, multibase — named for its role on the wire rather than for tvk.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"tokenLabels\": {\n \"items\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"vetterLabels\": {\n \"description\": \"Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period.\",\n \"items\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"suite\",\n \"helperKey\",\n \"tokenKey\",\n \"vetterLabels\",\n \"tokenLabels\",\n \"dripPerTick\",\n \"tickLength\",\n \"events\"\n ],\n \"title\": \"PublishedConfig\",\n \"type\": \"object\"\n },\n \"PublishedEvent\": {\n \"additionalProperties\": false,\n \"description\": \"The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.\",\n \"properties\": {\n \"endDate\": {\n \"format\": \"date\",\n \"type\": \"string\"\n },\n \"eventId\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"groupFloor\": {\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"startDate\": {\n \"format\": \"date\",\n \"type\": \"string\"\n },\n \"tiers\": {\n \"items\": {\n \"$ref\": \"#/$defs/Tier\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"eventId\",\n \"startDate\",\n \"endDate\",\n \"groupFloor\",\n \"tiers\"\n ],\n \"title\": \"PublishedEvent\",\n \"type\": \"object\"\n },\n \"Response\": {\n \"$anchor\": \"response\",\n \"additionalProperties\": false,\n \"properties\": {\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\"\n },\n \"request\": {\n \"$ref\": \"#/$defs/RootRequest\"\n }\n },\n \"required\": [\n \"request\"\n ],\n \"title\": \"VTA PCS — Root Request — response payload\",\n \"type\": \"object\"\n },\n \"RootRequest\": {\n \"additionalProperties\": false,\n \"description\": \"The payload of a vtc/vetting/vetters/pcs-root/0.1 request, without its ext: what the client sends the community.\",\n \"properties\": {\n \"id\": {\n \"description\": \"The vetter's PCS identifier for this community.\",\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n },\n \"label\": {\n \"pattern\": \"^vetter/[0-9]{4}-[0-9]{2}$\",\n \"type\": \"string\"\n },\n \"request\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"encoding\": {\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n },\n \"proof\": {\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n },\n \"t0\": {\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"proof\"\n ],\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"label\",\n \"id\",\n \"request\"\n ],\n \"title\": \"RootRequest\",\n \"type\": \"object\"\n },\n \"TickLength\": {\n \"description\": \"The length of one tick of the drip, as an ISO 8601 duration in days and/or hours — at least `PT1H`. A label's tick `t` is the window starting `t` tick lengths after the label's start (`vtc/vetting/vetters/pcs-tokens`).\",\n \"pattern\": \"^P(?:\\\\d+D(?:T\\\\d+H)?|T\\\\d+H)$\",\n \"title\": \"TickLength\",\n \"type\": \"string\"\n },\n \"Tier\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"dripPerTick\": {\n \"description\": \"How many tokens a tick under this tier yields.\",\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"name\": {\n \"description\": \"How the menu names it: desk, busy-desk.\",\n \"minLength\": 1,\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\",\n \"dripPerTick\"\n ],\n \"title\": \"Tier\",\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;
}
/// The extended error codes this specification declares (SPEC §7.3 item 9,
/// §8.5), in declaration order. Empty when it declares none.
pub const ERROR_CODES: &[crate::DeclaredErrorCode] = &[
error_codes::UNSUPPORTED_SUITE,
error_codes::PARAMETERS_INVALID,
error_codes::MEMBER_MISMATCH,
error_codes::LABEL_NOT_LIVE,
];
/// One constant per extended error code this specification declares
/// (SPEC §7.3 item 9), named for its local part.
///
/// Emit these rather than a string literal: the code is read from the
/// specification, so it cannot name a code the specification never
/// declared.
pub mod error_codes {
/// `vta/pcs/root-request:unsupportedSuite`
///
/// The parameters name a suite the engine does not implement.
///
/// Declared `retryable: false`.
pub const UNSUPPORTED_SUITE: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
code: "vta/pcs/root-request:unsupportedSuite",
retryable: false,
details_schema: ::core::option::Option::None,
};
/// `vta/pcs/root-request:parametersInvalid`
///
/// The community parameters cannot be decoded.
///
/// Declared `retryable: false`.
pub const PARAMETERS_INVALID: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
code: "vta/pcs/root-request:parametersInvalid",
retryable: false,
details_schema: ::core::option::Option::None,
};
/// `vta/pcs/root-request:memberMismatch`
///
/// A vetter engine exists for this context and community under another member DID.
///
/// Declared `retryable: false`.
pub const MEMBER_MISMATCH: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
code: "vta/pcs/root-request:memberMismatch",
retryable: false,
details_schema: ::core::option::Option::None,
};
/// `vta/pcs/root-request:labelNotLive`
///
/// `label` is not among the parameters' `vetterLabels`.
///
/// Declared `retryable: false`.
pub const LABEL_NOT_LIVE: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
code: "vta/pcs/root-request:labelNotLive",
retryable: false,
details_schema: ::core::option::Option::None,
};
}