//! Generated by `trust-tasks-codegen` — do not edit by hand.
//!
//! Spec slug: `vta/pcs/root-request`. Version: `0.1`.
/// Why this specification version is deprecated (SPEC "Superseded and
/// Withdrawn Versions"), or `None` while it is current.
pub const DEPRECATION: Option<&str> = None;
#[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.
///
#[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.
///
#[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`
///
#[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.
///
#[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.
///
#[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.
///
#[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.
///
#[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.
///
#[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.
///
#[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.
///
#[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`
///
#[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.
///
#[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`
///
#[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`
///
#[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.
///
#[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`
///
#[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`
///
#[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.
///
#[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.
///
#[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`
///
#[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`
///
#[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`
///
#[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`
///
#[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`
///
#[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`).
///
#[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`
///
#[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.
///
#[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(
"{\"$defs\":{\"CommunityParameters\":{\"$ref\":\"#/$defs/PublishedConfig\",\"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.\",\"title\":\"CommunityParameters\"},\"Ext\":{\"additionalProperties\":true,\"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.\",\"minProperties\":1,\"propertyNames\":{\"pattern\":\"^[a-z][a-z0-9-]*(\\\\.[a-z0-9-]+)+$\"},\"title\":\"Ext\",\"type\":\"object\"},\"PublishedConfig\":{\"additionalProperties\":false,\"description\":\"The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.\",\"properties\":{\"dripPerTick\":{\"minimum\":1,\"type\":\"integer\"},\"events\":{\"items\":{\"$ref\":\"#/$defs/PublishedEvent\"},\"type\":\"array\"},\"helperKey\":{\"description\":\"The helper verification key, multibase — named for its role on the wire rather than for hvk.\",\"minLength\":1,\"type\":\"string\"},\"suite\":{\"minLength\":1,\"type\":\"string\"},\"tickLength\":{\"$ref\":\"#/$defs/TickLength\"},\"tokenKey\":{\"description\":\"The token verification key, multibase — named for its role on the wire rather than for tvk.\",\"minLength\":1,\"type\":\"string\"},\"tokenLabels\":{\"items\":{\"minLength\":1,\"type\":\"string\"},\"type\":\"array\"},\"vetterLabels\":{\"description\":\"Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period.\",\"items\":{\"minLength\":1,\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"suite\",\"helperKey\",\"tokenKey\",\"vetterLabels\",\"tokenLabels\",\"dripPerTick\",\"tickLength\",\"events\"],\"title\":\"PublishedConfig\",\"type\":\"object\"},\"PublishedEvent\":{\"additionalProperties\":false,\"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.\",\"properties\":{\"endDate\":{\"format\":\"date\",\"type\":\"string\"},\"eventId\":{\"minLength\":1,\"type\":\"string\"},\"groupFloor\":{\"minimum\":1,\"type\":\"integer\"},\"startDate\":{\"format\":\"date\",\"type\":\"string\"},\"tiers\":{\"items\":{\"$ref\":\"#/$defs/Tier\"},\"type\":\"array\"}},\"required\":[\"eventId\",\"startDate\",\"endDate\",\"groupFloor\",\"tiers\"],\"title\":\"PublishedEvent\",\"type\":\"object\"},\"Response\":{\"$anchor\":\"response\",\"additionalProperties\":false,\"properties\":{\"ext\":{\"$ref\":\"#/$defs/Ext\"},\"request\":{\"$ref\":\"#/$defs/RootRequest\"}},\"required\":[\"request\"],\"title\":\"VTA PCS — Root Request — response payload\",\"type\":\"object\"},\"RootRequest\":{\"additionalProperties\":false,\"description\":\"The payload of a vtc/vetting/vetters/pcs-root/0.1 request, without its ext: what the client sends the community.\",\"properties\":{\"id\":{\"description\":\"The vetter's PCS identifier for this community.\",\"pattern\":\"^z[1-9A-HJ-NP-Za-km-z]+$\",\"type\":\"string\"},\"label\":{\"pattern\":\"^vetter/[0-9]{4}-[0-9]{2}$\",\"type\":\"string\"},\"request\":{\"additionalProperties\":false,\"properties\":{\"encoding\":{\"pattern\":\"^z[1-9A-HJ-NP-Za-km-z]+$\",\"type\":\"string\"},\"proof\":{\"pattern\":\"^z[1-9A-HJ-NP-Za-km-z]+$\",\"type\":\"string\"},\"t0\":{\"pattern\":\"^z[1-9A-HJ-NP-Za-km-z]+$\",\"type\":\"string\"}},\"required\":[\"proof\"],\"type\":\"object\"}},\"required\":[\"label\",\"id\",\"request\"],\"title\":\"RootRequest\",\"type\":\"object\"},\"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`).\",\"pattern\":\"^P(?:\\\\d+D(?:T\\\\d+H)?|T\\\\d+H)$\",\"title\":\"TickLength\",\"type\":\"string\"},\"Tier\":{\"additionalProperties\":false,\"properties\":{\"dripPerTick\":{\"description\":\"How many tokens a tick under this tier yields.\",\"minimum\":1,\"type\":\"integer\"},\"name\":{\"description\":\"How the menu names it: desk, busy-desk.\",\"minLength\":1,\"type\":\"string\"}},\"required\":[\"name\",\"dripPerTick\"],\"title\":\"Tier\",\"type\":\"object\"}},\"$id\":\"https://trusttasks.org/spec/vta/pcs/root-request/0.1\",\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"additionalProperties\":false,\"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.\",\"properties\":{\"community\":{\"description\":\"The community's DID: the helper whose parameters the engine runs under.\",\"minLength\":1,\"type\":\"string\"},\"contextId\":{\"description\":\"The context the engine belongs to. Its key is derived from this context's base.\",\"minLength\":1,\"type\":\"string\"},\"ext\":{\"$ref\":\"#/$defs/Ext\"},\"label\":{\"description\":\"The class label to enrol under: the community's current one.\",\"pattern\":\"^vetter/[0-9]{4}-[0-9]{2}$\",\"type\":\"string\"},\"memberDid\":{\"description\":\"The vetter's member DID in the community: the DID that signs the requests the client sends on the vetter's behalf.\",\"minLength\":1,\"type\":\"string\"},\"parameters\":{\"$ref\":\"#/$defs/CommunityParameters\",\"description\":\"The community's published hidden-vetting parameters, copied verbatim from its join manifest.\"}},\"required\":[\"contextId\",\"community\",\"memberDid\",\"parameters\",\"label\"],\"title\":\"VTA PCS — Root Request — payload\",\"type\":\"object\"}\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(
"{\"$defs\":{\"CommunityParameters\":{\"$ref\":\"#/$defs/PublishedConfig\",\"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.\",\"title\":\"CommunityParameters\"},\"Ext\":{\"additionalProperties\":true,\"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.\",\"minProperties\":1,\"propertyNames\":{\"pattern\":\"^[a-z][a-z0-9-]*(\\\\.[a-z0-9-]+)+$\"},\"title\":\"Ext\",\"type\":\"object\"},\"PublishedConfig\":{\"additionalProperties\":false,\"description\":\"The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.\",\"properties\":{\"dripPerTick\":{\"minimum\":1,\"type\":\"integer\"},\"events\":{\"items\":{\"$ref\":\"#/$defs/PublishedEvent\"},\"type\":\"array\"},\"helperKey\":{\"description\":\"The helper verification key, multibase — named for its role on the wire rather than for hvk.\",\"minLength\":1,\"type\":\"string\"},\"suite\":{\"minLength\":1,\"type\":\"string\"},\"tickLength\":{\"$ref\":\"#/$defs/TickLength\"},\"tokenKey\":{\"description\":\"The token verification key, multibase — named for its role on the wire rather than for tvk.\",\"minLength\":1,\"type\":\"string\"},\"tokenLabels\":{\"items\":{\"minLength\":1,\"type\":\"string\"},\"type\":\"array\"},\"vetterLabels\":{\"description\":\"Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period.\",\"items\":{\"minLength\":1,\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"suite\",\"helperKey\",\"tokenKey\",\"vetterLabels\",\"tokenLabels\",\"dripPerTick\",\"tickLength\",\"events\"],\"title\":\"PublishedConfig\",\"type\":\"object\"},\"PublishedEvent\":{\"additionalProperties\":false,\"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.\",\"properties\":{\"endDate\":{\"format\":\"date\",\"type\":\"string\"},\"eventId\":{\"minLength\":1,\"type\":\"string\"},\"groupFloor\":{\"minimum\":1,\"type\":\"integer\"},\"startDate\":{\"format\":\"date\",\"type\":\"string\"},\"tiers\":{\"items\":{\"$ref\":\"#/$defs/Tier\"},\"type\":\"array\"}},\"required\":[\"eventId\",\"startDate\",\"endDate\",\"groupFloor\",\"tiers\"],\"title\":\"PublishedEvent\",\"type\":\"object\"},\"Response\":{\"$anchor\":\"response\",\"additionalProperties\":false,\"properties\":{\"ext\":{\"$ref\":\"#/$defs/Ext\"},\"request\":{\"$ref\":\"#/$defs/RootRequest\"}},\"required\":[\"request\"],\"title\":\"VTA PCS — Root Request — response payload\",\"type\":\"object\"},\"RootRequest\":{\"additionalProperties\":false,\"description\":\"The payload of a vtc/vetting/vetters/pcs-root/0.1 request, without its ext: what the client sends the community.\",\"properties\":{\"id\":{\"description\":\"The vetter's PCS identifier for this community.\",\"pattern\":\"^z[1-9A-HJ-NP-Za-km-z]+$\",\"type\":\"string\"},\"label\":{\"pattern\":\"^vetter/[0-9]{4}-[0-9]{2}$\",\"type\":\"string\"},\"request\":{\"additionalProperties\":false,\"properties\":{\"encoding\":{\"pattern\":\"^z[1-9A-HJ-NP-Za-km-z]+$\",\"type\":\"string\"},\"proof\":{\"pattern\":\"^z[1-9A-HJ-NP-Za-km-z]+$\",\"type\":\"string\"},\"t0\":{\"pattern\":\"^z[1-9A-HJ-NP-Za-km-z]+$\",\"type\":\"string\"}},\"required\":[\"proof\"],\"type\":\"object\"}},\"required\":[\"label\",\"id\",\"request\"],\"title\":\"RootRequest\",\"type\":\"object\"},\"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`).\",\"pattern\":\"^P(?:\\\\d+D(?:T\\\\d+H)?|T\\\\d+H)$\",\"title\":\"TickLength\",\"type\":\"string\"},\"Tier\":{\"additionalProperties\":false,\"properties\":{\"dripPerTick\":{\"description\":\"How many tokens a tick under this tier yields.\",\"minimum\":1,\"type\":\"integer\"},\"name\":{\"description\":\"How the menu names it: desk, busy-desk.\",\"minLength\":1,\"type\":\"string\"}},\"required\":[\"name\",\"dripPerTick\"],\"title\":\"Tier\",\"type\":\"object\"}},\"$ref\":\"#/$defs/Response\",\"$schema\":\"https://json-schema.org/draft/2020-12/schema\"}\n",
);
}
impl crate::RequestPayload for Payload {
type Response = Response;
}
/// The earlier `MAJOR.MINOR` of this slug that this version declares it
/// extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
/// `None`. Only the direct declaration; walk a chain with
/// [`crate::extension::extends_for`].
pub const EXTENDS: Option<&str> = None;
/// 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,
};
}