//! Generated by `trust-tasks-codegen` — do not edit by hand.
//!
//! Spec slug: `vta/pcs/root-accept`. 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 binary value, multibase base58btc over the suite's canonical encoding.
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct Multibase(::std::string::String);
impl ::std::ops::Deref for Multibase {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<Multibase> for ::std::string::String {
fn from(value: Multibase) -> Self {
value.0
}
}
impl ::std::str::FromStr for Multibase {
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 Multibase {
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 Multibase {
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 Multibase {
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 Multibase {
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 hands its VTA the community's answer to a root request; the VTA unblinds it into the vetter's class credential for the period and keeps it.
///
#[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 community's published hidden-vetting parameters, copied verbatim from its join manifest.
pub parameters: CommunityParameters,
pub response: PayloadResponse,
}
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 payload of the community's vtc/vetting/vetters/pcs-root/0.1 response, without its ext.
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct PayloadResponse {
pub label: PayloadResponseLabel,
#[serde(rename = "preCredential")]
pub pre_credential: PayloadResponsePreCredential,
}
impl PayloadResponse {
pub fn builder() -> builder::PayloadResponse {
Default::default()
}
}
///`PayloadResponseLabel`
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PayloadResponseLabel(::std::string::String);
impl ::std::ops::Deref for PayloadResponseLabel {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PayloadResponseLabel> for ::std::string::String {
fn from(value: PayloadResponseLabel) -> Self {
value.0
}
}
impl ::std::str::FromStr for PayloadResponseLabel {
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 PayloadResponseLabel {
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 PayloadResponseLabel {
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 PayloadResponseLabel {
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 PayloadResponseLabel {
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())
})
}
}
///`PayloadResponsePreCredential`
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PayloadResponsePreCredential(::std::string::String);
impl ::std::ops::Deref for PayloadResponsePreCredential {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PayloadResponsePreCredential> for ::std::string::String {
fn from(value: PayloadResponsePreCredential) -> Self {
value.0
}
}
impl ::std::str::FromStr for PayloadResponsePreCredential {
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 PayloadResponsePreCredential {
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 PayloadResponsePreCredential {
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 PayloadResponsePreCredential {
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 PayloadResponsePreCredential {
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 vetter: VetterSummary,
}
impl Response {
pub fn builder() -> builder::Response {
Default::default()
}
}
///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())
})
}
}
///One draw of the token drip: a label and a tick.
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct TokenDraw {
pub label: TokenDrawLabel,
pub tick: u64,
}
impl TokenDraw {
pub fn builder() -> builder::TokenDraw {
Default::default()
}
}
///`TokenDrawLabel`
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TokenDrawLabel(::std::string::String);
impl ::std::ops::Deref for TokenDrawLabel {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<TokenDrawLabel> for ::std::string::String {
fn from(value: TokenDrawLabel) -> Self {
value.0
}
}
impl ::std::str::FromStr for TokenDrawLabel {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 128usize {
return Err("longer than 128 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for TokenDrawLabel {
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 TokenDrawLabel {
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 TokenDrawLabel {
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 TokenDrawLabel {
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 engine as the VTA holds it, without its key, its credentials or its tokens.
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct VetterSummary {
///Attestations made through this engine.
pub attested: u64,
pub community: VetterSummaryCommunity,
#[serde(rename = "contextId")]
pub context_id: VetterSummaryContextId,
///Draws requested and not yet accepted or abandoned.
#[serde(rename = "drawsInFlight")]
pub draws_in_flight: ::std::vec::Vec<TokenDraw>,
///Class labels this vetter holds a credential under, newest first.
#[serde(rename = "enrolledLabels")]
pub enrolled_labels: ::std::vec::Vec<VetterSummaryEnrolledLabelsItem>,
///The vetter's PCS identifier for this community.
pub id: Multibase,
///The member DID the engine draws tokens as. Bound into every token request.
#[serde(rename = "memberDid")]
pub member_did: VetterSummaryMemberDid,
///Class labels requested and not yet accepted.
#[serde(rename = "pendingLabels")]
pub pending_labels: ::std::vec::Vec<VetterSummaryPendingLabelsItem>,
pub suite: VetterSummarySuite,
///Tokens held and not reserved.
#[serde(rename = "tokensFree")]
pub tokens_free: u64,
///Tokens held in all.
#[serde(rename = "tokensHeld")]
pub tokens_held: u64,
}
impl VetterSummary {
pub fn builder() -> builder::VetterSummary {
Default::default()
}
}
///`VetterSummaryCommunity`
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct VetterSummaryCommunity(::std::string::String);
impl ::std::ops::Deref for VetterSummaryCommunity {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<VetterSummaryCommunity> for ::std::string::String {
fn from(value: VetterSummaryCommunity) -> Self {
value.0
}
}
impl ::std::str::FromStr for VetterSummaryCommunity {
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 VetterSummaryCommunity {
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 VetterSummaryCommunity {
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 VetterSummaryCommunity {
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 VetterSummaryCommunity {
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())
})
}
}
///`VetterSummaryContextId`
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct VetterSummaryContextId(::std::string::String);
impl ::std::ops::Deref for VetterSummaryContextId {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<VetterSummaryContextId> for ::std::string::String {
fn from(value: VetterSummaryContextId) -> Self {
value.0
}
}
impl ::std::str::FromStr for VetterSummaryContextId {
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 VetterSummaryContextId {
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 VetterSummaryContextId {
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 VetterSummaryContextId {
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 VetterSummaryContextId {
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())
})
}
}
///`VetterSummaryEnrolledLabelsItem`
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct VetterSummaryEnrolledLabelsItem(::std::string::String);
impl ::std::ops::Deref for VetterSummaryEnrolledLabelsItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<VetterSummaryEnrolledLabelsItem> for ::std::string::String {
fn from(value: VetterSummaryEnrolledLabelsItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for VetterSummaryEnrolledLabelsItem {
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 VetterSummaryEnrolledLabelsItem {
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 VetterSummaryEnrolledLabelsItem {
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 VetterSummaryEnrolledLabelsItem {
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 VetterSummaryEnrolledLabelsItem {
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 member DID the engine draws tokens as. Bound into every token request.
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct VetterSummaryMemberDid(::std::string::String);
impl ::std::ops::Deref for VetterSummaryMemberDid {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<VetterSummaryMemberDid> for ::std::string::String {
fn from(value: VetterSummaryMemberDid) -> Self {
value.0
}
}
impl ::std::str::FromStr for VetterSummaryMemberDid {
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 VetterSummaryMemberDid {
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 VetterSummaryMemberDid {
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 VetterSummaryMemberDid {
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 VetterSummaryMemberDid {
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())
})
}
}
///`VetterSummaryPendingLabelsItem`
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct VetterSummaryPendingLabelsItem(::std::string::String);
impl ::std::ops::Deref for VetterSummaryPendingLabelsItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<VetterSummaryPendingLabelsItem> for ::std::string::String {
fn from(value: VetterSummaryPendingLabelsItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for VetterSummaryPendingLabelsItem {
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 VetterSummaryPendingLabelsItem {
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 VetterSummaryPendingLabelsItem {
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 VetterSummaryPendingLabelsItem {
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 VetterSummaryPendingLabelsItem {
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())
})
}
}
///`VetterSummarySuite`
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct VetterSummarySuite(::std::string::String);
impl ::std::ops::Deref for VetterSummarySuite {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<VetterSummarySuite> for ::std::string::String {
fn from(value: VetterSummarySuite) -> Self {
value.0
}
}
impl ::std::str::FromStr for VetterSummarySuite {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() > 64usize {
return Err("longer than 64 characters".into());
}
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for VetterSummarySuite {
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 VetterSummarySuite {
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 VetterSummarySuite {
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 VetterSummarySuite {
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>,
parameters: ::std::result::Result<super::CommunityParameters, ::std::string::String>,
response: ::std::result::Result<super::PayloadResponse, ::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()),
parameters: Err("no value supplied for parameters".to_string()),
response: Err("no value supplied for response".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 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
}
pub fn response<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PayloadResponse>,
T::Error: ::std::fmt::Display,
{
self.response = value
.try_into()
.map_err(|e| format!("error converting supplied value for response: {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?,
parameters: value.parameters?,
response: value.response?,
})
}
}
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),
parameters: Ok(value.parameters),
response: Ok(value.response),
}
}
}
#[derive(Clone, Debug)]
pub struct PayloadResponse {
label: ::std::result::Result<super::PayloadResponseLabel, ::std::string::String>,
pre_credential:
::std::result::Result<super::PayloadResponsePreCredential, ::std::string::String>,
}
impl ::std::default::Default for PayloadResponse {
fn default() -> Self {
Self {
label: Err("no value supplied for label".to_string()),
pre_credential: Err("no value supplied for pre_credential".to_string()),
}
}
}
impl PayloadResponse {
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PayloadResponseLabel>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn pre_credential<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PayloadResponsePreCredential>,
T::Error: ::std::fmt::Display,
{
self.pre_credential = value
.try_into()
.map_err(|e| format!("error converting supplied value for pre_credential: {e}"));
self
}
}
impl ::std::convert::TryFrom<PayloadResponse> for super::PayloadResponse {
type Error = super::error::ConversionError;
fn try_from(
value: PayloadResponse,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
label: value.label?,
pre_credential: value.pre_credential?,
})
}
}
impl ::std::convert::From<super::PayloadResponse> for PayloadResponse {
fn from(value: super::PayloadResponse) -> Self {
Self {
label: Ok(value.label),
pre_credential: Ok(value.pre_credential),
}
}
}
#[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>,
vetter: ::std::result::Result<super::VetterSummary, ::std::string::String>,
}
impl ::std::default::Default for Response {
fn default() -> Self {
Self {
ext: Ok(Default::default()),
vetter: Err("no value supplied for vetter".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 vetter<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VetterSummary>,
T::Error: ::std::fmt::Display,
{
self.vetter = value
.try_into()
.map_err(|e| format!("error converting supplied value for vetter: {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?,
vetter: value.vetter?,
})
}
}
impl ::std::convert::From<super::Response> for Response {
fn from(value: super::Response) -> Self {
Self {
ext: Ok(value.ext),
vetter: Ok(value.vetter),
}
}
}
#[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),
}
}
}
#[derive(Clone, Debug)]
pub struct TokenDraw {
label: ::std::result::Result<super::TokenDrawLabel, ::std::string::String>,
tick: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for TokenDraw {
fn default() -> Self {
Self {
label: Err("no value supplied for label".to_string()),
tick: Err("no value supplied for tick".to_string()),
}
}
}
impl TokenDraw {
pub fn label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::TokenDrawLabel>,
T::Error: ::std::fmt::Display,
{
self.label = value
.try_into()
.map_err(|e| format!("error converting supplied value for label: {e}"));
self
}
pub fn tick<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.tick = value
.try_into()
.map_err(|e| format!("error converting supplied value for tick: {e}"));
self
}
}
impl ::std::convert::TryFrom<TokenDraw> for super::TokenDraw {
type Error = super::error::ConversionError;
fn try_from(
value: TokenDraw,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
label: value.label?,
tick: value.tick?,
})
}
}
impl ::std::convert::From<super::TokenDraw> for TokenDraw {
fn from(value: super::TokenDraw) -> Self {
Self {
label: Ok(value.label),
tick: Ok(value.tick),
}
}
}
#[derive(Clone, Debug)]
pub struct VetterSummary {
attested: ::std::result::Result<u64, ::std::string::String>,
community: ::std::result::Result<super::VetterSummaryCommunity, ::std::string::String>,
context_id: ::std::result::Result<super::VetterSummaryContextId, ::std::string::String>,
draws_in_flight:
::std::result::Result<::std::vec::Vec<super::TokenDraw>, ::std::string::String>,
enrolled_labels: ::std::result::Result<
::std::vec::Vec<super::VetterSummaryEnrolledLabelsItem>,
::std::string::String,
>,
id: ::std::result::Result<super::Multibase, ::std::string::String>,
member_did: ::std::result::Result<super::VetterSummaryMemberDid, ::std::string::String>,
pending_labels: ::std::result::Result<
::std::vec::Vec<super::VetterSummaryPendingLabelsItem>,
::std::string::String,
>,
suite: ::std::result::Result<super::VetterSummarySuite, ::std::string::String>,
tokens_free: ::std::result::Result<u64, ::std::string::String>,
tokens_held: ::std::result::Result<u64, ::std::string::String>,
}
impl ::std::default::Default for VetterSummary {
fn default() -> Self {
Self {
attested: Err("no value supplied for attested".to_string()),
community: Err("no value supplied for community".to_string()),
context_id: Err("no value supplied for context_id".to_string()),
draws_in_flight: Err("no value supplied for draws_in_flight".to_string()),
enrolled_labels: Err("no value supplied for enrolled_labels".to_string()),
id: Err("no value supplied for id".to_string()),
member_did: Err("no value supplied for member_did".to_string()),
pending_labels: Err("no value supplied for pending_labels".to_string()),
suite: Err("no value supplied for suite".to_string()),
tokens_free: Err("no value supplied for tokens_free".to_string()),
tokens_held: Err("no value supplied for tokens_held".to_string()),
}
}
}
impl VetterSummary {
pub fn attested<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.attested = value
.try_into()
.map_err(|e| format!("error converting supplied value for attested: {e}"));
self
}
pub fn community<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VetterSummaryCommunity>,
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::VetterSummaryContextId>,
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 draws_in_flight<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::TokenDraw>>,
T::Error: ::std::fmt::Display,
{
self.draws_in_flight = value
.try_into()
.map_err(|e| format!("error converting supplied value for draws_in_flight: {e}"));
self
}
pub fn enrolled_labels<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::VetterSummaryEnrolledLabelsItem>>,
T::Error: ::std::fmt::Display,
{
self.enrolled_labels = value
.try_into()
.map_err(|e| format!("error converting supplied value for enrolled_labels: {e}"));
self
}
pub fn id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::Multibase>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
pub fn member_did<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VetterSummaryMemberDid>,
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 pending_labels<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::VetterSummaryPendingLabelsItem>>,
T::Error: ::std::fmt::Display,
{
self.pending_labels = value
.try_into()
.map_err(|e| format!("error converting supplied value for pending_labels: {e}"));
self
}
pub fn suite<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::VetterSummarySuite>,
T::Error: ::std::fmt::Display,
{
self.suite = value
.try_into()
.map_err(|e| format!("error converting supplied value for suite: {e}"));
self
}
pub fn tokens_free<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.tokens_free = value
.try_into()
.map_err(|e| format!("error converting supplied value for tokens_free: {e}"));
self
}
pub fn tokens_held<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<u64>,
T::Error: ::std::fmt::Display,
{
self.tokens_held = value
.try_into()
.map_err(|e| format!("error converting supplied value for tokens_held: {e}"));
self
}
}
impl ::std::convert::TryFrom<VetterSummary> for super::VetterSummary {
type Error = super::error::ConversionError;
fn try_from(
value: VetterSummary,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
attested: value.attested?,
community: value.community?,
context_id: value.context_id?,
draws_in_flight: value.draws_in_flight?,
enrolled_labels: value.enrolled_labels?,
id: value.id?,
member_did: value.member_did?,
pending_labels: value.pending_labels?,
suite: value.suite?,
tokens_free: value.tokens_free?,
tokens_held: value.tokens_held?,
})
}
}
impl ::std::convert::From<super::VetterSummary> for VetterSummary {
fn from(value: super::VetterSummary) -> Self {
Self {
attested: Ok(value.attested),
community: Ok(value.community),
context_id: Ok(value.context_id),
draws_in_flight: Ok(value.draws_in_flight),
enrolled_labels: Ok(value.enrolled_labels),
id: Ok(value.id),
member_did: Ok(value.member_did),
pending_labels: Ok(value.pending_labels),
suite: Ok(value.suite),
tokens_free: Ok(value.tokens_free),
tokens_held: Ok(value.tokens_held),
}
}
}
}
impl crate::Payload for Payload {
const TYPE_URI: &'static str = "https://trusttasks.org/spec/vta/pcs/root-accept/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\"},\"Multibase\":{\"description\":\"A binary value, multibase base58btc over the suite's canonical encoding.\",\"pattern\":\"^z[1-9A-HJ-NP-Za-km-z]+$\",\"title\":\"Multibase\",\"type\":\"string\"},\"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\"},\"vetter\":{\"$ref\":\"#/$defs/VetterSummary\"}},\"required\":[\"vetter\"],\"title\":\"VTA PCS — Root Accept — response payload\",\"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\"},\"TokenDraw\":{\"additionalProperties\":false,\"description\":\"One draw of the token drip: a label and a tick.\",\"properties\":{\"label\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"tick\":{\"minimum\":0,\"type\":\"integer\"}},\"required\":[\"label\",\"tick\"],\"title\":\"TokenDraw\",\"type\":\"object\"},\"VetterSummary\":{\"additionalProperties\":false,\"description\":\"A vetter engine as the VTA holds it, without its key, its credentials or its tokens.\",\"properties\":{\"attested\":{\"description\":\"Attestations made through this engine.\",\"minimum\":0,\"type\":\"integer\"},\"community\":{\"minLength\":1,\"type\":\"string\"},\"contextId\":{\"minLength\":1,\"type\":\"string\"},\"drawsInFlight\":{\"description\":\"Draws requested and not yet accepted or abandoned.\",\"items\":{\"$ref\":\"#/$defs/TokenDraw\"},\"type\":\"array\"},\"enrolledLabels\":{\"description\":\"Class labels this vetter holds a credential under, newest first.\",\"items\":{\"pattern\":\"^vetter/[0-9]{4}-[0-9]{2}$\",\"type\":\"string\"},\"type\":\"array\"},\"id\":{\"$ref\":\"#/$defs/Multibase\",\"description\":\"The vetter's PCS identifier for this community.\"},\"memberDid\":{\"description\":\"The member DID the engine draws tokens as. Bound into every token request.\",\"minLength\":1,\"type\":\"string\"},\"pendingLabels\":{\"description\":\"Class labels requested and not yet accepted.\",\"items\":{\"pattern\":\"^vetter/[0-9]{4}-[0-9]{2}$\",\"type\":\"string\"},\"type\":\"array\"},\"suite\":{\"maxLength\":64,\"minLength\":1,\"type\":\"string\"},\"tokensFree\":{\"description\":\"Tokens held and not reserved.\",\"minimum\":0,\"type\":\"integer\"},\"tokensHeld\":{\"description\":\"Tokens held in all.\",\"minimum\":0,\"type\":\"integer\"}},\"required\":[\"contextId\",\"community\",\"memberDid\",\"suite\",\"id\",\"enrolledLabels\",\"pendingLabels\",\"tokensFree\",\"tokensHeld\",\"drawsInFlight\",\"attested\"],\"title\":\"VetterSummary\",\"type\":\"object\"}},\"$id\":\"https://trusttasks.org/spec/vta/pcs/root-accept/0.1\",\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"additionalProperties\":false,\"description\":\"A vetter's client hands its VTA the community's answer to a root request; the VTA unblinds it into the vetter's class credential for the period and keeps it.\",\"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\"},\"parameters\":{\"$ref\":\"#/$defs/CommunityParameters\",\"description\":\"The community's published hidden-vetting parameters, copied verbatim from its join manifest.\"},\"response\":{\"additionalProperties\":false,\"description\":\"The payload of the community's vtc/vetting/vetters/pcs-root/0.1 response, without its ext.\",\"properties\":{\"label\":{\"pattern\":\"^vetter/[0-9]{4}-[0-9]{2}$\",\"type\":\"string\"},\"preCredential\":{\"pattern\":\"^z[1-9A-HJ-NP-Za-km-z]+$\",\"type\":\"string\"}},\"required\":[\"label\",\"preCredential\"],\"type\":\"object\"}},\"required\":[\"contextId\",\"community\",\"parameters\",\"response\"],\"title\":\"VTA PCS — Root Accept — payload\",\"type\":\"object\"}\n",
);
}
impl crate::Payload for Response {
const TYPE_URI: &'static str = "https://trusttasks.org/spec/vta/pcs/root-accept/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\"},\"Multibase\":{\"description\":\"A binary value, multibase base58btc over the suite's canonical encoding.\",\"pattern\":\"^z[1-9A-HJ-NP-Za-km-z]+$\",\"title\":\"Multibase\",\"type\":\"string\"},\"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\"},\"vetter\":{\"$ref\":\"#/$defs/VetterSummary\"}},\"required\":[\"vetter\"],\"title\":\"VTA PCS — Root Accept — response payload\",\"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\"},\"TokenDraw\":{\"additionalProperties\":false,\"description\":\"One draw of the token drip: a label and a tick.\",\"properties\":{\"label\":{\"maxLength\":128,\"minLength\":1,\"type\":\"string\"},\"tick\":{\"minimum\":0,\"type\":\"integer\"}},\"required\":[\"label\",\"tick\"],\"title\":\"TokenDraw\",\"type\":\"object\"},\"VetterSummary\":{\"additionalProperties\":false,\"description\":\"A vetter engine as the VTA holds it, without its key, its credentials or its tokens.\",\"properties\":{\"attested\":{\"description\":\"Attestations made through this engine.\",\"minimum\":0,\"type\":\"integer\"},\"community\":{\"minLength\":1,\"type\":\"string\"},\"contextId\":{\"minLength\":1,\"type\":\"string\"},\"drawsInFlight\":{\"description\":\"Draws requested and not yet accepted or abandoned.\",\"items\":{\"$ref\":\"#/$defs/TokenDraw\"},\"type\":\"array\"},\"enrolledLabels\":{\"description\":\"Class labels this vetter holds a credential under, newest first.\",\"items\":{\"pattern\":\"^vetter/[0-9]{4}-[0-9]{2}$\",\"type\":\"string\"},\"type\":\"array\"},\"id\":{\"$ref\":\"#/$defs/Multibase\",\"description\":\"The vetter's PCS identifier for this community.\"},\"memberDid\":{\"description\":\"The member DID the engine draws tokens as. Bound into every token request.\",\"minLength\":1,\"type\":\"string\"},\"pendingLabels\":{\"description\":\"Class labels requested and not yet accepted.\",\"items\":{\"pattern\":\"^vetter/[0-9]{4}-[0-9]{2}$\",\"type\":\"string\"},\"type\":\"array\"},\"suite\":{\"maxLength\":64,\"minLength\":1,\"type\":\"string\"},\"tokensFree\":{\"description\":\"Tokens held and not reserved.\",\"minimum\":0,\"type\":\"integer\"},\"tokensHeld\":{\"description\":\"Tokens held in all.\",\"minimum\":0,\"type\":\"integer\"}},\"required\":[\"contextId\",\"community\",\"memberDid\",\"suite\",\"id\",\"enrolledLabels\",\"pendingLabels\",\"tokensFree\",\"tokensHeld\",\"drawsInFlight\",\"attested\"],\"title\":\"VetterSummary\",\"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::NOT_FOUND,
error_codes::NO_REQUEST_IN_FLIGHT,
error_codes::CREDENTIAL_INVALID,
error_codes::UNSUPPORTED_SUITE,
error_codes::PARAMETERS_INVALID,
];
/// 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-accept:notFound`
///
/// No vetter engine exists for this context and community.
///
/// Declared `retryable: false`.
pub const NOT_FOUND: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
code: "vta/pcs/root-accept:notFound",
retryable: false,
details_schema: ::core::option::Option::None,
};
/// `vta/pcs/root-accept:noRequestInFlight`
///
/// The engine holds no blinding state for the answer's label.
///
/// Declared `retryable: false`.
pub const NO_REQUEST_IN_FLIGHT: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
code: "vta/pcs/root-accept:noRequestInFlight",
retryable: false,
details_schema: ::core::option::Option::None,
};
/// `vta/pcs/root-accept:credentialInvalid`
///
/// The answer does not unblind into a credential that verifies under the parameters' helper key.
///
/// Declared `retryable: false`.
pub const CREDENTIAL_INVALID: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
code: "vta/pcs/root-accept:credentialInvalid",
retryable: false,
details_schema: ::core::option::Option::None,
};
/// `vta/pcs/root-accept: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-accept:unsupportedSuite",
retryable: false,
details_schema: ::core::option::Option::None,
};
/// `vta/pcs/root-accept:parametersInvalid`
///
/// The community parameters cannot be decoded.
///
/// Declared `retryable: false`.
pub const PARAMETERS_INVALID: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
code: "vta/pcs/root-accept:parametersInvalid",
retryable: false,
details_schema: ::core::option::Option::None,
};
}