//! Generated by `trust-tasks-codegen` — do not edit by hand.
//!
//! Spec slug: `vta/pcs/applications/create`. Version: `0.1`.
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
/// Error types.
pub mod error {
/// Error from a `TryFrom` or `FromStr` implementation.
pub struct ConversionError(::std::borrow::Cow<'static, str>);
impl ::std::error::Error for ConversionError {}
impl ::std::fmt::Display for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Display::fmt(&self.0, f)
}
}
impl ::std::fmt::Debug for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
///An applicant engine as the VTA holds it, without its key.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "ApplicationSummary",
/// "description": "An applicant engine as the VTA holds it, without its key.",
/// "type": "object",
/// "required": [
/// "applicationId",
/// "attestations",
/// "community",
/// "contextId",
/// "createdAt",
/// "id",
/// "joinDid",
/// "suite"
/// ],
/// "properties": {
/// "applicationId": {
/// "description": "The VTA's handle for this application. Opaque; never sent to the community.",
/// "type": "string",
/// "maxLength": 128,
/// "minLength": 1
/// },
/// "attestations": {
/// "description": "The metadata of each attestation held, in the order received. Metadata names no vetter.",
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/StatementMeta"
/// }
/// },
/// "community": {
/// "description": "The community's DID.",
/// "type": "string",
/// "minLength": 1
/// },
/// "contextId": {
/// "description": "The context the application's key is derived in.",
/// "type": "string",
/// "minLength": 1
/// },
/// "createdAt": {
/// "type": "string",
/// "format": "date-time"
/// },
/// "id": {
/// "description": "The applicant's PCS identifier: what a vetter attests to, carried in a vetting/request's `ext`.",
/// "$ref": "#/definitions/Multibase"
/// },
/// "joinDid": {
/// "description": "The DID the application joins as.",
/// "type": "string",
/// "minLength": 1
/// },
/// "suite": {
/// "type": "string",
/// "maxLength": 64,
/// "minLength": 1
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct ApplicationSummary {
///The VTA's handle for this application. Opaque; never sent to the community.
#[serde(rename = "applicationId")]
pub application_id: ApplicationSummaryApplicationId,
///The metadata of each attestation held, in the order received. Metadata names no vetter.
pub attestations: ::std::vec::Vec<StatementMeta>,
///The community's DID.
pub community: ApplicationSummaryCommunity,
///The context the application's key is derived in.
#[serde(rename = "contextId")]
pub context_id: ApplicationSummaryContextId,
#[serde(rename = "createdAt")]
pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
///The applicant's PCS identifier: what a vetter attests to, carried in a vetting/request's `ext`.
pub id: Multibase,
///The DID the application joins as.
#[serde(rename = "joinDid")]
pub join_did: ApplicationSummaryJoinDid,
pub suite: ApplicationSummarySuite,
}
impl ApplicationSummary {
pub fn builder() -> builder::ApplicationSummary {
Default::default()
}
}
///The VTA's handle for this application. Opaque; never sent to the community.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The VTA's handle for this application. Opaque; never sent to the community.",
/// "type": "string",
/// "maxLength": 128,
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ApplicationSummaryApplicationId(::std::string::String);
impl ::std::ops::Deref for ApplicationSummaryApplicationId {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ApplicationSummaryApplicationId> for ::std::string::String {
fn from(value: ApplicationSummaryApplicationId) -> Self {
value.0
}
}
impl ::std::str::FromStr for ApplicationSummaryApplicationId {
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 ApplicationSummaryApplicationId {
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 ApplicationSummaryApplicationId {
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 ApplicationSummaryApplicationId {
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 ApplicationSummaryApplicationId {
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 community's DID.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The community's DID.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ApplicationSummaryCommunity(::std::string::String);
impl ::std::ops::Deref for ApplicationSummaryCommunity {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ApplicationSummaryCommunity> for ::std::string::String {
fn from(value: ApplicationSummaryCommunity) -> Self {
value.0
}
}
impl ::std::str::FromStr for ApplicationSummaryCommunity {
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 ApplicationSummaryCommunity {
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 ApplicationSummaryCommunity {
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 ApplicationSummaryCommunity {
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 ApplicationSummaryCommunity {
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 application's key is derived in.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The context the application's key is derived in.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ApplicationSummaryContextId(::std::string::String);
impl ::std::ops::Deref for ApplicationSummaryContextId {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ApplicationSummaryContextId> for ::std::string::String {
fn from(value: ApplicationSummaryContextId) -> Self {
value.0
}
}
impl ::std::str::FromStr for ApplicationSummaryContextId {
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 ApplicationSummaryContextId {
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 ApplicationSummaryContextId {
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 ApplicationSummaryContextId {
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 ApplicationSummaryContextId {
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 DID the application joins as.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The DID the application joins as.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ApplicationSummaryJoinDid(::std::string::String);
impl ::std::ops::Deref for ApplicationSummaryJoinDid {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ApplicationSummaryJoinDid> for ::std::string::String {
fn from(value: ApplicationSummaryJoinDid) -> Self {
value.0
}
}
impl ::std::str::FromStr for ApplicationSummaryJoinDid {
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 ApplicationSummaryJoinDid {
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 ApplicationSummaryJoinDid {
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 ApplicationSummaryJoinDid {
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 ApplicationSummaryJoinDid {
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())
})
}
}
///`ApplicationSummarySuite`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "maxLength": 64,
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ApplicationSummarySuite(::std::string::String);
impl ::std::ops::Deref for ApplicationSummarySuite {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ApplicationSummarySuite> for ::std::string::String {
fn from(value: ApplicationSummarySuite) -> Self {
value.0
}
}
impl ::std::str::FromStr for ApplicationSummarySuite {
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 ApplicationSummarySuite {
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 ApplicationSummarySuite {
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 ApplicationSummarySuite {
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 ApplicationSummarySuite {
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 community's hidden-vetting parameters exactly as its join manifest publishes them, under the criterion's `vetting.ext`. The caller copies them in verbatim on every call that needs them, because the community rotates labels and the engine keeps no copy of its own: a stale copy costs the caller a refused proof, never a mistaken one.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "CommunityParameters",
/// "description": "The community's hidden-vetting parameters exactly as its join manifest publishes them, under the criterion's `vetting.ext`. The caller copies them in verbatim on every call that needs them, because the community rotates labels and the engine keeps no copy of its own: a stale copy costs the caller a refused proof, never a mistaken one.",
/// "$ref": "#/definitions/PublishedConfig"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct CommunityParameters(pub PublishedConfig);
impl ::std::ops::Deref for CommunityParameters {
type Target = PublishedConfig;
fn deref(&self) -> &PublishedConfig {
&self.0
}
}
impl ::std::convert::From<CommunityParameters> for PublishedConfig {
fn from(value: CommunityParameters) -> Self {
value.0
}
}
impl ::std::convert::From<PublishedConfig> for CommunityParameters {
fn from(value: PublishedConfig) -> Self {
Self(value)
}
}
///Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Ext",
/// "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
/// "type": "object",
/// "minProperties": 1,
/// "additionalProperties": true,
/// "propertyNames": {
/// "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
/// }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Ext(pub ::std::collections::HashMap<ExtKey, ::serde_json::Value>);
impl ::std::ops::Deref for Ext {
type Target = ::std::collections::HashMap<ExtKey, ::serde_json::Value>;
fn deref(&self) -> &::std::collections::HashMap<ExtKey, ::serde_json::Value> {
&self.0
}
}
impl ::std::convert::From<Ext> for ::std::collections::HashMap<ExtKey, ::serde_json::Value> {
fn from(value: Ext) -> Self {
value.0
}
}
impl ::std::convert::From<::std::collections::HashMap<ExtKey, ::serde_json::Value>> for Ext {
fn from(value: ::std::collections::HashMap<ExtKey, ::serde_json::Value>) -> Self {
Self(value)
}
}
///`ExtKey`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ExtKey(::std::string::String);
impl ::std::ops::Deref for ExtKey {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ExtKey> for ::std::string::String {
fn from(value: ExtKey) -> Self {
value.0
}
}
impl ::std::str::FromStr for ExtKey {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| {
::regress::Regex::new("^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ExtKey {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ExtKey {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ExtKey {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ExtKey {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///A binary value, multibase base58btc over the suite's canonical encoding.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Multibase",
/// "description": "A binary value, multibase base58btc over the suite's canonical encoding.",
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct 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())
})
}
}
///An applicant's client asks its VTA to start a hidden-vetting application: the VTA derives a fresh PCS key for it, keeps the key, and returns the PCS identifier vetters attest to.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "$id": "https://trusttasks.org/spec/vta/pcs/applications/create/0.1",
/// "title": "Payload",
/// "description": "An applicant's client asks its VTA to start a hidden-vetting application: the VTA derives a fresh PCS key for it, keeps the key, and returns the PCS identifier vetters attest to.",
/// "type": "object",
/// "required": [
/// "community",
/// "contextId",
/// "joinDid",
/// "parameters"
/// ],
/// "properties": {
/// "community": {
/// "description": "The community's DID: the helper whose parameters the engine runs under.",
/// "type": "string",
/// "minLength": 1
/// },
/// "contextId": {
/// "description": "The context the engine belongs to. Its key is derived from this context's base.",
/// "type": "string",
/// "minLength": 1
/// },
/// "ext": {
/// "$ref": "#/definitions/Ext"
/// },
/// "joinDid": {
/// "description": "The DID the applicant joins the community as. Bound into the proof, so the proof cannot be carried to another join.",
/// "type": "string",
/// "minLength": 1
/// },
/// "parameters": {
/// "description": "The community's published hidden-vetting parameters, copied verbatim from its join manifest.",
/// "$ref": "#/definitions/CommunityParameters"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct Payload {
///The community's DID: the helper whose parameters the engine runs under.
pub community: PayloadCommunity,
///The context the engine belongs to. Its key is derived from this context's base.
#[serde(rename = "contextId")]
pub context_id: PayloadContextId,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ext: ::std::option::Option<Ext>,
///The DID the applicant joins the community as. Bound into the proof, so the proof cannot be carried to another join.
#[serde(rename = "joinDid")]
pub join_did: PayloadJoinDid,
///The community's published hidden-vetting parameters, copied verbatim from its join manifest.
pub parameters: CommunityParameters,
}
impl Payload {
pub fn builder() -> builder::Payload {
Default::default()
}
}
///The community's DID: the helper whose parameters the engine runs under.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The community's DID: the helper whose parameters the engine runs under.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PayloadCommunity(::std::string::String);
impl ::std::ops::Deref for PayloadCommunity {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PayloadCommunity> for ::std::string::String {
fn from(value: PayloadCommunity) -> Self {
value.0
}
}
impl ::std::str::FromStr for PayloadCommunity {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PayloadCommunity {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PayloadCommunity {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PayloadCommunity {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for PayloadCommunity {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///The context the engine belongs to. Its key is derived from this context's base.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The context the engine belongs to. Its key is derived from this context's base.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PayloadContextId(::std::string::String);
impl ::std::ops::Deref for PayloadContextId {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PayloadContextId> for ::std::string::String {
fn from(value: PayloadContextId) -> Self {
value.0
}
}
impl ::std::str::FromStr for PayloadContextId {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PayloadContextId {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PayloadContextId {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PayloadContextId {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for PayloadContextId {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///The DID the applicant joins the community as. Bound into the proof, so the proof cannot be carried to another join.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The DID the applicant joins the community as. Bound into the proof, so the proof cannot be carried to another join.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PayloadJoinDid(::std::string::String);
impl ::std::ops::Deref for PayloadJoinDid {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PayloadJoinDid> for ::std::string::String {
fn from(value: PayloadJoinDid) -> Self {
value.0
}
}
impl ::std::str::FromStr for PayloadJoinDid {
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 PayloadJoinDid {
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 PayloadJoinDid {
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 PayloadJoinDid {
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 PayloadJoinDid {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "PublishedConfig",
/// "description": "The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.",
/// "type": "object",
/// "required": [
/// "dripPerTick",
/// "events",
/// "helperKey",
/// "suite",
/// "tickLength",
/// "tokenKey",
/// "tokenLabels",
/// "vetterLabels"
/// ],
/// "properties": {
/// "dripPerTick": {
/// "type": "integer",
/// "minimum": 1.0
/// },
/// "events": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/PublishedEvent"
/// }
/// },
/// "helperKey": {
/// "description": "The helper verification key, multibase — named for its role on the wire rather than for hvk.",
/// "type": "string",
/// "minLength": 1
/// },
/// "suite": {
/// "type": "string",
/// "minLength": 1
/// },
/// "tickLength": {
/// "$ref": "#/definitions/TickLength"
/// },
/// "tokenKey": {
/// "description": "The token verification key, multibase — named for its role on the wire rather than for tvk.",
/// "type": "string",
/// "minLength": 1
/// },
/// "tokenLabels": {
/// "type": "array",
/// "items": {
/// "type": "string",
/// "minLength": 1
/// }
/// },
/// "vetterLabels": {
/// "description": "Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period.",
/// "type": "array",
/// "items": {
/// "type": "string",
/// "minLength": 1
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct PublishedConfig {
#[serde(rename = "dripPerTick")]
pub drip_per_tick: ::std::num::NonZeroU64,
pub events: ::std::vec::Vec<PublishedEvent>,
///The helper verification key, multibase — named for its role on the wire rather than for hvk.
#[serde(rename = "helperKey")]
pub helper_key: PublishedConfigHelperKey,
pub suite: PublishedConfigSuite,
#[serde(rename = "tickLength")]
pub tick_length: TickLength,
///The token verification key, multibase — named for its role on the wire rather than for tvk.
#[serde(rename = "tokenKey")]
pub token_key: PublishedConfigTokenKey,
#[serde(rename = "tokenLabels")]
pub token_labels: ::std::vec::Vec<PublishedConfigTokenLabelsItem>,
///Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period.
#[serde(rename = "vetterLabels")]
pub vetter_labels: ::std::vec::Vec<PublishedConfigVetterLabelsItem>,
}
impl PublishedConfig {
pub fn builder() -> builder::PublishedConfig {
Default::default()
}
}
///The helper verification key, multibase — named for its role on the wire rather than for hvk.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The helper verification key, multibase — named for its role on the wire rather than for hvk.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PublishedConfigHelperKey(::std::string::String);
impl ::std::ops::Deref for PublishedConfigHelperKey {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PublishedConfigHelperKey> for ::std::string::String {
fn from(value: PublishedConfigHelperKey) -> Self {
value.0
}
}
impl ::std::str::FromStr for PublishedConfigHelperKey {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PublishedConfigHelperKey {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublishedConfigHelperKey {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublishedConfigHelperKey {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for PublishedConfigHelperKey {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`PublishedConfigSuite`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PublishedConfigSuite(::std::string::String);
impl ::std::ops::Deref for PublishedConfigSuite {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PublishedConfigSuite> for ::std::string::String {
fn from(value: PublishedConfigSuite) -> Self {
value.0
}
}
impl ::std::str::FromStr for PublishedConfigSuite {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PublishedConfigSuite {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublishedConfigSuite {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublishedConfigSuite {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for PublishedConfigSuite {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///The token verification key, multibase — named for its role on the wire rather than for tvk.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The token verification key, multibase — named for its role on the wire rather than for tvk.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PublishedConfigTokenKey(::std::string::String);
impl ::std::ops::Deref for PublishedConfigTokenKey {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PublishedConfigTokenKey> for ::std::string::String {
fn from(value: PublishedConfigTokenKey) -> Self {
value.0
}
}
impl ::std::str::FromStr for PublishedConfigTokenKey {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PublishedConfigTokenKey {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublishedConfigTokenKey {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublishedConfigTokenKey {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for PublishedConfigTokenKey {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`PublishedConfigTokenLabelsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PublishedConfigTokenLabelsItem(::std::string::String);
impl ::std::ops::Deref for PublishedConfigTokenLabelsItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PublishedConfigTokenLabelsItem> for ::std::string::String {
fn from(value: PublishedConfigTokenLabelsItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for PublishedConfigTokenLabelsItem {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PublishedConfigTokenLabelsItem {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublishedConfigTokenLabelsItem {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublishedConfigTokenLabelsItem {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for PublishedConfigTokenLabelsItem {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`PublishedConfigVetterLabelsItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PublishedConfigVetterLabelsItem(::std::string::String);
impl ::std::ops::Deref for PublishedConfigVetterLabelsItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PublishedConfigVetterLabelsItem> for ::std::string::String {
fn from(value: PublishedConfigVetterLabelsItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for PublishedConfigVetterLabelsItem {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PublishedConfigVetterLabelsItem {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublishedConfigVetterLabelsItem {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublishedConfigVetterLabelsItem {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for PublishedConfigVetterLabelsItem {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "PublishedEvent",
/// "description": "The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.",
/// "type": "object",
/// "required": [
/// "endDate",
/// "eventId",
/// "groupFloor",
/// "startDate",
/// "tiers"
/// ],
/// "properties": {
/// "endDate": {
/// "type": "string",
/// "format": "date"
/// },
/// "eventId": {
/// "type": "string",
/// "minLength": 1
/// },
/// "groupFloor": {
/// "type": "integer",
/// "minimum": 1.0
/// },
/// "startDate": {
/// "type": "string",
/// "format": "date"
/// },
/// "tiers": {
/// "type": "array",
/// "items": {
/// "$ref": "#/definitions/Tier"
/// }
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct PublishedEvent {
#[serde(rename = "endDate")]
pub end_date: ::chrono::naive::NaiveDate,
#[serde(rename = "eventId")]
pub event_id: PublishedEventEventId,
#[serde(rename = "groupFloor")]
pub group_floor: ::std::num::NonZeroU64,
#[serde(rename = "startDate")]
pub start_date: ::chrono::naive::NaiveDate,
pub tiers: ::std::vec::Vec<Tier>,
}
impl PublishedEvent {
pub fn builder() -> builder::PublishedEvent {
Default::default()
}
}
///`PublishedEventEventId`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PublishedEventEventId(::std::string::String);
impl ::std::ops::Deref for PublishedEventEventId {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<PublishedEventEventId> for ::std::string::String {
fn from(value: PublishedEventEventId) -> Self {
value.0
}
}
impl ::std::str::FromStr for PublishedEventEventId {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for PublishedEventEventId {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for PublishedEventEventId {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for PublishedEventEventId {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for PublishedEventEventId {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`Response`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Response",
/// "type": "object",
/// "required": [
/// "application"
/// ],
/// "properties": {
/// "application": {
/// "$ref": "#/definitions/ApplicationSummary"
/// },
/// "ext": {
/// "$ref": "#/definitions/Ext"
/// }
/// },
/// "additionalProperties": false,
/// "$anchor": "response"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct Response {
pub application: ApplicationSummary,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ext: ::std::option::Option<Ext>,
}
impl Response {
pub fn builder() -> builder::Response {
Default::default()
}
}
///What a Vetting Statement would have said, minus its issuer.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "What a Vetting Statement would have said, minus its issuer.",
/// "type": "object",
/// "required": [
/// "cardDigestMultibase",
/// "claimsVerified",
/// "community",
/// "declaredRelationship",
/// "identityCommitment",
/// "livenessConfirmed",
/// "method",
/// "requirementsDigest",
/// "tokenLabel",
/// "tokenSerial",
/// "validFrom",
/// "validUntil"
/// ],
/// "properties": {
/// "cardDigestMultibase": {
/// "description": "Digest of that card, as the vetter verified it.",
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
/// },
/// "claimsVerified": {
/// "description": "The claim types the vetter checked.",
/// "type": "array",
/// "items": {
/// "type": "string",
/// "minLength": 1
/// },
/// "minItems": 1
/// },
/// "community": {
/// "description": "The community this attestation is for. An attestation is not portable between communities.",
/// "type": "string",
/// "minLength": 1
/// },
/// "declaredRelationship": {
/// "description": "The relationship the vetter declared, which the community's independence rules count.",
/// "type": "string",
/// "enum": [
/// "none",
/// "family",
/// "sameEmployer",
/// "closeFriend",
/// "other"
/// ]
/// },
/// "identityCommitment": {
/// "description": "The commitment on the Vetting Card the applicant showed. Consistency across attestations is what stops two applicants pooling them.",
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
/// },
/// "livenessConfirmed": {
/// "description": "Whether the vetter confirmed a live person.",
/// "type": "boolean"
/// },
/// "method": {
/// "description": "How the vetter met the applicant.",
/// "type": "string",
/// "enum": [
/// "inPerson",
/// "video",
/// "priorAcquaintance"
/// ]
/// },
/// "requirementsDigest": {
/// "description": "The digest of the criterion's requirements as the vetter read them.",
/// "type": "string",
/// "minLength": 1
/// },
/// "tokenLabel": {
/// "description": "The token label spent, repeated inside the bound facts so it cannot be swapped in transit.",
/// "type": "string",
/// "maxLength": 128,
/// "minLength": 1
/// },
/// "tokenSerial": {
/// "description": "The token serial spent, likewise bound.",
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
/// },
/// "validFrom": {
/// "description": "A DATE, never a timestamp: an exact time would let a community line an attestation up with a vetter's activity, which undoes the proof without touching it.",
/// "type": "string",
/// "format": "date"
/// },
/// "validUntil": {
/// "description": "A date, for the same reason.",
/// "type": "string",
/// "format": "date"
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct StatementMeta {
///Digest of that card, as the vetter verified it.
#[serde(rename = "cardDigestMultibase")]
pub card_digest_multibase: StatementMetaCardDigestMultibase,
///The claim types the vetter checked.
#[serde(rename = "claimsVerified")]
pub claims_verified: ::std::vec::Vec<StatementMetaClaimsVerifiedItem>,
///The community this attestation is for. An attestation is not portable between communities.
pub community: StatementMetaCommunity,
///The relationship the vetter declared, which the community's independence rules count.
#[serde(rename = "declaredRelationship")]
pub declared_relationship: StatementMetaDeclaredRelationship,
///The commitment on the Vetting Card the applicant showed. Consistency across attestations is what stops two applicants pooling them.
#[serde(rename = "identityCommitment")]
pub identity_commitment: StatementMetaIdentityCommitment,
///Whether the vetter confirmed a live person.
#[serde(rename = "livenessConfirmed")]
pub liveness_confirmed: bool,
///How the vetter met the applicant.
pub method: StatementMetaMethod,
///The digest of the criterion's requirements as the vetter read them.
#[serde(rename = "requirementsDigest")]
pub requirements_digest: StatementMetaRequirementsDigest,
///The token label spent, repeated inside the bound facts so it cannot be swapped in transit.
#[serde(rename = "tokenLabel")]
pub token_label: StatementMetaTokenLabel,
///The token serial spent, likewise bound.
#[serde(rename = "tokenSerial")]
pub token_serial: StatementMetaTokenSerial,
///A DATE, never a timestamp: an exact time would let a community line an attestation up with a vetter's activity, which undoes the proof without touching it.
#[serde(rename = "validFrom")]
pub valid_from: ::chrono::naive::NaiveDate,
///A date, for the same reason.
#[serde(rename = "validUntil")]
pub valid_until: ::chrono::naive::NaiveDate,
}
impl StatementMeta {
pub fn builder() -> builder::StatementMeta {
Default::default()
}
}
///Digest of that card, as the vetter verified it.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "Digest of that card, as the vetter verified it.",
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct StatementMetaCardDigestMultibase(::std::string::String);
impl ::std::ops::Deref for StatementMetaCardDigestMultibase {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<StatementMetaCardDigestMultibase> for ::std::string::String {
fn from(value: StatementMetaCardDigestMultibase) -> Self {
value.0
}
}
impl ::std::str::FromStr for StatementMetaCardDigestMultibase {
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 StatementMetaCardDigestMultibase {
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 StatementMetaCardDigestMultibase {
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 StatementMetaCardDigestMultibase {
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 StatementMetaCardDigestMultibase {
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())
})
}
}
///`StatementMetaClaimsVerifiedItem`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct StatementMetaClaimsVerifiedItem(::std::string::String);
impl ::std::ops::Deref for StatementMetaClaimsVerifiedItem {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<StatementMetaClaimsVerifiedItem> for ::std::string::String {
fn from(value: StatementMetaClaimsVerifiedItem) -> Self {
value.0
}
}
impl ::std::str::FromStr for StatementMetaClaimsVerifiedItem {
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 StatementMetaClaimsVerifiedItem {
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 StatementMetaClaimsVerifiedItem {
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 StatementMetaClaimsVerifiedItem {
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 StatementMetaClaimsVerifiedItem {
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 community this attestation is for. An attestation is not portable between communities.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The community this attestation is for. An attestation is not portable between communities.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct StatementMetaCommunity(::std::string::String);
impl ::std::ops::Deref for StatementMetaCommunity {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<StatementMetaCommunity> for ::std::string::String {
fn from(value: StatementMetaCommunity) -> Self {
value.0
}
}
impl ::std::str::FromStr for StatementMetaCommunity {
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 StatementMetaCommunity {
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 StatementMetaCommunity {
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 StatementMetaCommunity {
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 StatementMetaCommunity {
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 relationship the vetter declared, which the community's independence rules count.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The relationship the vetter declared, which the community's independence rules count.",
/// "type": "string",
/// "enum": [
/// "none",
/// "family",
/// "sameEmployer",
/// "closeFriend",
/// "other"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
#[non_exhaustive]
pub enum StatementMetaDeclaredRelationship {
#[serde(rename = "none")]
None,
#[serde(rename = "family")]
Family,
#[serde(rename = "sameEmployer")]
SameEmployer,
#[serde(rename = "closeFriend")]
CloseFriend,
#[serde(rename = "other")]
Other,
}
impl ::std::fmt::Display for StatementMetaDeclaredRelationship {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::None => f.write_str("none"),
Self::Family => f.write_str("family"),
Self::SameEmployer => f.write_str("sameEmployer"),
Self::CloseFriend => f.write_str("closeFriend"),
Self::Other => f.write_str("other"),
}
}
}
impl ::std::str::FromStr for StatementMetaDeclaredRelationship {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"none" => Ok(Self::None),
"family" => Ok(Self::Family),
"sameEmployer" => Ok(Self::SameEmployer),
"closeFriend" => Ok(Self::CloseFriend),
"other" => Ok(Self::Other),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for StatementMetaDeclaredRelationship {
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 StatementMetaDeclaredRelationship {
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 StatementMetaDeclaredRelationship {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///The commitment on the Vetting Card the applicant showed. Consistency across attestations is what stops two applicants pooling them.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The commitment on the Vetting Card the applicant showed. Consistency across attestations is what stops two applicants pooling them.",
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct StatementMetaIdentityCommitment(::std::string::String);
impl ::std::ops::Deref for StatementMetaIdentityCommitment {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<StatementMetaIdentityCommitment> for ::std::string::String {
fn from(value: StatementMetaIdentityCommitment) -> Self {
value.0
}
}
impl ::std::str::FromStr for StatementMetaIdentityCommitment {
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 StatementMetaIdentityCommitment {
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 StatementMetaIdentityCommitment {
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 StatementMetaIdentityCommitment {
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 StatementMetaIdentityCommitment {
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())
})
}
}
///How the vetter met the applicant.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "How the vetter met the applicant.",
/// "type": "string",
/// "enum": [
/// "inPerson",
/// "video",
/// "priorAcquaintance"
/// ]
///}
/// ```
/// </details>
#[derive(
::serde::Deserialize,
::serde::Serialize,
Clone,
Copy,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
)]
#[non_exhaustive]
pub enum StatementMetaMethod {
#[serde(rename = "inPerson")]
InPerson,
#[serde(rename = "video")]
Video,
#[serde(rename = "priorAcquaintance")]
PriorAcquaintance,
}
impl ::std::fmt::Display for StatementMetaMethod {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match *self {
Self::InPerson => f.write_str("inPerson"),
Self::Video => f.write_str("video"),
Self::PriorAcquaintance => f.write_str("priorAcquaintance"),
}
}
}
impl ::std::str::FromStr for StatementMetaMethod {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
match value {
"inPerson" => Ok(Self::InPerson),
"video" => Ok(Self::Video),
"priorAcquaintance" => Ok(Self::PriorAcquaintance),
_ => Err("invalid value".into()),
}
}
}
impl ::std::convert::TryFrom<&str> for StatementMetaMethod {
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 StatementMetaMethod {
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 StatementMetaMethod {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
///The digest of the criterion's requirements as the vetter read them.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The digest of the criterion's requirements as the vetter read them.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct StatementMetaRequirementsDigest(::std::string::String);
impl ::std::ops::Deref for StatementMetaRequirementsDigest {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<StatementMetaRequirementsDigest> for ::std::string::String {
fn from(value: StatementMetaRequirementsDigest) -> Self {
value.0
}
}
impl ::std::str::FromStr for StatementMetaRequirementsDigest {
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 StatementMetaRequirementsDigest {
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 StatementMetaRequirementsDigest {
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 StatementMetaRequirementsDigest {
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 StatementMetaRequirementsDigest {
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 label spent, repeated inside the bound facts so it cannot be swapped in transit.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The token label spent, repeated inside the bound facts so it cannot be swapped in transit.",
/// "type": "string",
/// "maxLength": 128,
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct StatementMetaTokenLabel(::std::string::String);
impl ::std::ops::Deref for StatementMetaTokenLabel {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<StatementMetaTokenLabel> for ::std::string::String {
fn from(value: StatementMetaTokenLabel) -> Self {
value.0
}
}
impl ::std::str::FromStr for StatementMetaTokenLabel {
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 StatementMetaTokenLabel {
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 StatementMetaTokenLabel {
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 StatementMetaTokenLabel {
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 StatementMetaTokenLabel {
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 serial spent, likewise bound.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "The token serial spent, likewise bound.",
/// "type": "string",
/// "pattern": "^z[1-9A-HJ-NP-Za-km-z]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct StatementMetaTokenSerial(::std::string::String);
impl ::std::ops::Deref for StatementMetaTokenSerial {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<StatementMetaTokenSerial> for ::std::string::String {
fn from(value: StatementMetaTokenSerial) -> Self {
value.0
}
}
impl ::std::str::FromStr for StatementMetaTokenSerial {
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 StatementMetaTokenSerial {
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 StatementMetaTokenSerial {
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 StatementMetaTokenSerial {
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 StatementMetaTokenSerial {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///The length of one tick of the drip, as an ISO 8601 duration in days and/or hours — at least `PT1H`. A label's tick `t` is the window starting `t` tick lengths after the label's start (`vtc/vetting/vetters/pcs-tokens`).
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "TickLength",
/// "description": "The length of one tick of the drip, as an ISO 8601 duration in days and/or hours — at least `PT1H`. A label's tick `t` is the window starting `t` tick lengths after the label's start (`vtc/vetting/vetters/pcs-tokens`).",
/// "type": "string",
/// "pattern": "^P(?:\\d+D(?:T\\d+H)?|T\\d+H)$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TickLength(::std::string::String);
impl ::std::ops::Deref for TickLength {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<TickLength> for ::std::string::String {
fn from(value: TickLength) -> Self {
value.0
}
}
impl ::std::str::FromStr for TickLength {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| {
::regress::Regex::new("^P(?:\\d+D(?:T\\d+H)?|T\\d+H)$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^P(?:\\d+D(?:T\\d+H)?|T\\d+H)$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for TickLength {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TickLength {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TickLength {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for TickLength {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`Tier`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "title": "Tier",
/// "type": "object",
/// "required": [
/// "dripPerTick",
/// "name"
/// ],
/// "properties": {
/// "dripPerTick": {
/// "description": "How many tokens a tick under this tier yields.",
/// "type": "integer",
/// "minimum": 1.0
/// },
/// "name": {
/// "description": "How the menu names it: desk, busy-desk.",
/// "type": "string",
/// "minLength": 1
/// }
/// },
/// "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct Tier {
///How many tokens a tick under this tier yields.
#[serde(rename = "dripPerTick")]
pub drip_per_tick: ::std::num::NonZeroU64,
///How the menu names it: desk, busy-desk.
pub name: TierName,
}
impl Tier {
pub fn builder() -> builder::Tier {
Default::default()
}
}
///How the menu names it: desk, busy-desk.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
/// "description": "How the menu names it: desk, busy-desk.",
/// "type": "string",
/// "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct TierName(::std::string::String);
impl ::std::ops::Deref for TierName {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<TierName> for ::std::string::String {
fn from(value: TierName) -> Self {
value.0
}
}
impl ::std::str::FromStr for TierName {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
if value.chars().count() < 1usize {
return Err("shorter than 1 characters".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for TierName {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for TierName {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for TierName {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for TierName {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
/// Types for composing complex structures.
pub mod builder {
#[derive(Clone, Debug)]
pub struct ApplicationSummary {
application_id:
::std::result::Result<super::ApplicationSummaryApplicationId, ::std::string::String>,
attestations:
::std::result::Result<::std::vec::Vec<super::StatementMeta>, ::std::string::String>,
community: ::std::result::Result<super::ApplicationSummaryCommunity, ::std::string::String>,
context_id:
::std::result::Result<super::ApplicationSummaryContextId, ::std::string::String>,
created_at:
::std::result::Result<::chrono::DateTime<::chrono::offset::Utc>, ::std::string::String>,
id: ::std::result::Result<super::Multibase, ::std::string::String>,
join_did: ::std::result::Result<super::ApplicationSummaryJoinDid, ::std::string::String>,
suite: ::std::result::Result<super::ApplicationSummarySuite, ::std::string::String>,
}
impl ::std::default::Default for ApplicationSummary {
fn default() -> Self {
Self {
application_id: Err("no value supplied for application_id".to_string()),
attestations: Err("no value supplied for attestations".to_string()),
community: Err("no value supplied for community".to_string()),
context_id: Err("no value supplied for context_id".to_string()),
created_at: Err("no value supplied for created_at".to_string()),
id: Err("no value supplied for id".to_string()),
join_did: Err("no value supplied for join_did".to_string()),
suite: Err("no value supplied for suite".to_string()),
}
}
}
impl ApplicationSummary {
pub fn application_id<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ApplicationSummaryApplicationId>,
T::Error: ::std::fmt::Display,
{
self.application_id = value
.try_into()
.map_err(|e| format!("error converting supplied value for application_id: {e}"));
self
}
pub fn attestations<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::StatementMeta>>,
T::Error: ::std::fmt::Display,
{
self.attestations = value
.try_into()
.map_err(|e| format!("error converting supplied value for attestations: {e}"));
self
}
pub fn community<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ApplicationSummaryCommunity>,
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::ApplicationSummaryContextId>,
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 created_at<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::chrono::DateTime<::chrono::offset::Utc>>,
T::Error: ::std::fmt::Display,
{
self.created_at = value
.try_into()
.map_err(|e| format!("error converting supplied value for created_at: {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 join_did<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ApplicationSummaryJoinDid>,
T::Error: ::std::fmt::Display,
{
self.join_did = value
.try_into()
.map_err(|e| format!("error converting supplied value for join_did: {e}"));
self
}
pub fn suite<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ApplicationSummarySuite>,
T::Error: ::std::fmt::Display,
{
self.suite = value
.try_into()
.map_err(|e| format!("error converting supplied value for suite: {e}"));
self
}
}
impl ::std::convert::TryFrom<ApplicationSummary> for super::ApplicationSummary {
type Error = super::error::ConversionError;
fn try_from(
value: ApplicationSummary,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
application_id: value.application_id?,
attestations: value.attestations?,
community: value.community?,
context_id: value.context_id?,
created_at: value.created_at?,
id: value.id?,
join_did: value.join_did?,
suite: value.suite?,
})
}
}
impl ::std::convert::From<super::ApplicationSummary> for ApplicationSummary {
fn from(value: super::ApplicationSummary) -> Self {
Self {
application_id: Ok(value.application_id),
attestations: Ok(value.attestations),
community: Ok(value.community),
context_id: Ok(value.context_id),
created_at: Ok(value.created_at),
id: Ok(value.id),
join_did: Ok(value.join_did),
suite: Ok(value.suite),
}
}
}
#[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>,
join_did: ::std::result::Result<super::PayloadJoinDid, ::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()),
join_did: Err("no value supplied for join_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 join_did<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::PayloadJoinDid>,
T::Error: ::std::fmt::Display,
{
self.join_did = value
.try_into()
.map_err(|e| format!("error converting supplied value for join_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?,
join_did: value.join_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),
join_did: Ok(value.join_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 {
application: ::std::result::Result<super::ApplicationSummary, ::std::string::String>,
ext: ::std::result::Result<::std::option::Option<super::Ext>, ::std::string::String>,
}
impl ::std::default::Default for Response {
fn default() -> Self {
Self {
application: Err("no value supplied for application".to_string()),
ext: Ok(Default::default()),
}
}
}
impl Response {
pub fn application<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::ApplicationSummary>,
T::Error: ::std::fmt::Display,
{
self.application = value
.try_into()
.map_err(|e| format!("error converting supplied value for application: {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
}
}
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 {
application: value.application?,
ext: value.ext?,
})
}
}
impl ::std::convert::From<super::Response> for Response {
fn from(value: super::Response) -> Self {
Self {
application: Ok(value.application),
ext: Ok(value.ext),
}
}
}
#[derive(Clone, Debug)]
pub struct StatementMeta {
card_digest_multibase:
::std::result::Result<super::StatementMetaCardDigestMultibase, ::std::string::String>,
claims_verified: ::std::result::Result<
::std::vec::Vec<super::StatementMetaClaimsVerifiedItem>,
::std::string::String,
>,
community: ::std::result::Result<super::StatementMetaCommunity, ::std::string::String>,
declared_relationship:
::std::result::Result<super::StatementMetaDeclaredRelationship, ::std::string::String>,
identity_commitment:
::std::result::Result<super::StatementMetaIdentityCommitment, ::std::string::String>,
liveness_confirmed: ::std::result::Result<bool, ::std::string::String>,
method: ::std::result::Result<super::StatementMetaMethod, ::std::string::String>,
requirements_digest:
::std::result::Result<super::StatementMetaRequirementsDigest, ::std::string::String>,
token_label: ::std::result::Result<super::StatementMetaTokenLabel, ::std::string::String>,
token_serial: ::std::result::Result<super::StatementMetaTokenSerial, ::std::string::String>,
valid_from: ::std::result::Result<::chrono::naive::NaiveDate, ::std::string::String>,
valid_until: ::std::result::Result<::chrono::naive::NaiveDate, ::std::string::String>,
}
impl ::std::default::Default for StatementMeta {
fn default() -> Self {
Self {
card_digest_multibase: Err(
"no value supplied for card_digest_multibase".to_string()
),
claims_verified: Err("no value supplied for claims_verified".to_string()),
community: Err("no value supplied for community".to_string()),
declared_relationship: Err(
"no value supplied for declared_relationship".to_string()
),
identity_commitment: Err("no value supplied for identity_commitment".to_string()),
liveness_confirmed: Err("no value supplied for liveness_confirmed".to_string()),
method: Err("no value supplied for method".to_string()),
requirements_digest: Err("no value supplied for requirements_digest".to_string()),
token_label: Err("no value supplied for token_label".to_string()),
token_serial: Err("no value supplied for token_serial".to_string()),
valid_from: Err("no value supplied for valid_from".to_string()),
valid_until: Err("no value supplied for valid_until".to_string()),
}
}
}
impl StatementMeta {
pub fn card_digest_multibase<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::StatementMetaCardDigestMultibase>,
T::Error: ::std::fmt::Display,
{
self.card_digest_multibase = value.try_into().map_err(|e| {
format!("error converting supplied value for card_digest_multibase: {e}")
});
self
}
pub fn claims_verified<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::StatementMetaClaimsVerifiedItem>>,
T::Error: ::std::fmt::Display,
{
self.claims_verified = value
.try_into()
.map_err(|e| format!("error converting supplied value for claims_verified: {e}"));
self
}
pub fn community<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::StatementMetaCommunity>,
T::Error: ::std::fmt::Display,
{
self.community = value
.try_into()
.map_err(|e| format!("error converting supplied value for community: {e}"));
self
}
pub fn declared_relationship<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::StatementMetaDeclaredRelationship>,
T::Error: ::std::fmt::Display,
{
self.declared_relationship = value.try_into().map_err(|e| {
format!("error converting supplied value for declared_relationship: {e}")
});
self
}
pub fn identity_commitment<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::StatementMetaIdentityCommitment>,
T::Error: ::std::fmt::Display,
{
self.identity_commitment = value.try_into().map_err(|e| {
format!("error converting supplied value for identity_commitment: {e}")
});
self
}
pub fn liveness_confirmed<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<bool>,
T::Error: ::std::fmt::Display,
{
self.liveness_confirmed = value.try_into().map_err(|e| {
format!("error converting supplied value for liveness_confirmed: {e}")
});
self
}
pub fn method<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::StatementMetaMethod>,
T::Error: ::std::fmt::Display,
{
self.method = value
.try_into()
.map_err(|e| format!("error converting supplied value for method: {e}"));
self
}
pub fn requirements_digest<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::StatementMetaRequirementsDigest>,
T::Error: ::std::fmt::Display,
{
self.requirements_digest = value.try_into().map_err(|e| {
format!("error converting supplied value for requirements_digest: {e}")
});
self
}
pub fn token_label<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::StatementMetaTokenLabel>,
T::Error: ::std::fmt::Display,
{
self.token_label = value
.try_into()
.map_err(|e| format!("error converting supplied value for token_label: {e}"));
self
}
pub fn token_serial<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::StatementMetaTokenSerial>,
T::Error: ::std::fmt::Display,
{
self.token_serial = value
.try_into()
.map_err(|e| format!("error converting supplied value for token_serial: {e}"));
self
}
pub fn valid_from<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::chrono::naive::NaiveDate>,
T::Error: ::std::fmt::Display,
{
self.valid_from = value
.try_into()
.map_err(|e| format!("error converting supplied value for valid_from: {e}"));
self
}
pub fn valid_until<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::chrono::naive::NaiveDate>,
T::Error: ::std::fmt::Display,
{
self.valid_until = value
.try_into()
.map_err(|e| format!("error converting supplied value for valid_until: {e}"));
self
}
}
impl ::std::convert::TryFrom<StatementMeta> for super::StatementMeta {
type Error = super::error::ConversionError;
fn try_from(
value: StatementMeta,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
card_digest_multibase: value.card_digest_multibase?,
claims_verified: value.claims_verified?,
community: value.community?,
declared_relationship: value.declared_relationship?,
identity_commitment: value.identity_commitment?,
liveness_confirmed: value.liveness_confirmed?,
method: value.method?,
requirements_digest: value.requirements_digest?,
token_label: value.token_label?,
token_serial: value.token_serial?,
valid_from: value.valid_from?,
valid_until: value.valid_until?,
})
}
}
impl ::std::convert::From<super::StatementMeta> for StatementMeta {
fn from(value: super::StatementMeta) -> Self {
Self {
card_digest_multibase: Ok(value.card_digest_multibase),
claims_verified: Ok(value.claims_verified),
community: Ok(value.community),
declared_relationship: Ok(value.declared_relationship),
identity_commitment: Ok(value.identity_commitment),
liveness_confirmed: Ok(value.liveness_confirmed),
method: Ok(value.method),
requirements_digest: Ok(value.requirements_digest),
token_label: Ok(value.token_label),
token_serial: Ok(value.token_serial),
valid_from: Ok(value.valid_from),
valid_until: Ok(value.valid_until),
}
}
}
#[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/applications/create/0.1";
const IS_PROOF_REQUIRED: bool = true;
const IS_ISSUED_AT_REQUIRED: bool = true;
const IS_RECIPIENT_REQUIRED: bool = true;
const PAYLOAD_SCHEMA: Option<&'static str> = Some(
"{\n \"$defs\": {\n \"ApplicationSummary\": {\n \"additionalProperties\": false,\n \"description\": \"An applicant engine as the VTA holds it, without its key.\",\n \"properties\": {\n \"applicationId\": {\n \"description\": \"The VTA's handle for this application. Opaque; never sent to the community.\",\n \"maxLength\": 128,\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"attestations\": {\n \"description\": \"The metadata of each attestation held, in the order received. Metadata names no vetter.\",\n \"items\": {\n \"$ref\": \"#/$defs/StatementMeta\"\n },\n \"type\": \"array\"\n },\n \"community\": {\n \"description\": \"The community's DID.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"contextId\": {\n \"description\": \"The context the application's key is derived in.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"createdAt\": {\n \"format\": \"date-time\",\n \"type\": \"string\"\n },\n \"id\": {\n \"$ref\": \"#/$defs/Multibase\",\n \"description\": \"The applicant's PCS identifier: what a vetter attests to, carried in a vetting/request's `ext`.\"\n },\n \"joinDid\": {\n \"description\": \"The DID the application joins as.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"suite\": {\n \"maxLength\": 64,\n \"minLength\": 1,\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"applicationId\",\n \"contextId\",\n \"community\",\n \"joinDid\",\n \"suite\",\n \"id\",\n \"attestations\",\n \"createdAt\"\n ],\n \"title\": \"ApplicationSummary\",\n \"type\": \"object\"\n },\n \"CommunityParameters\": {\n \"$ref\": \"#/$defs/PublishedConfig\",\n \"description\": \"The community's hidden-vetting parameters exactly as its join manifest publishes them, under the criterion's `vetting.ext`. The caller copies them in verbatim on every call that needs them, because the community rotates labels and the engine keeps no copy of its own: a stale copy costs the caller a refused proof, never a mistaken one.\",\n \"title\": \"CommunityParameters\"\n },\n \"Ext\": {\n \"additionalProperties\": true,\n \"description\": \"Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.\",\n \"minProperties\": 1,\n \"propertyNames\": {\n \"pattern\": \"^[a-z][a-z0-9-]*(\\\\.[a-z0-9-]+)+$\"\n },\n \"title\": \"Ext\",\n \"type\": \"object\"\n },\n \"Multibase\": {\n \"description\": \"A binary value, multibase base58btc over the suite's canonical encoding.\",\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"title\": \"Multibase\",\n \"type\": \"string\"\n },\n \"PublishedConfig\": {\n \"additionalProperties\": false,\n \"description\": \"The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.\",\n \"properties\": {\n \"dripPerTick\": {\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"events\": {\n \"items\": {\n \"$ref\": \"#/$defs/PublishedEvent\"\n },\n \"type\": \"array\"\n },\n \"helperKey\": {\n \"description\": \"The helper verification key, multibase — named for its role on the wire rather than for hvk.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"suite\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"tickLength\": {\n \"$ref\": \"#/$defs/TickLength\"\n },\n \"tokenKey\": {\n \"description\": \"The token verification key, multibase — named for its role on the wire rather than for tvk.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"tokenLabels\": {\n \"items\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"vetterLabels\": {\n \"description\": \"Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period.\",\n \"items\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"suite\",\n \"helperKey\",\n \"tokenKey\",\n \"vetterLabels\",\n \"tokenLabels\",\n \"dripPerTick\",\n \"tickLength\",\n \"events\"\n ],\n \"title\": \"PublishedConfig\",\n \"type\": \"object\"\n },\n \"PublishedEvent\": {\n \"additionalProperties\": false,\n \"description\": \"The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.\",\n \"properties\": {\n \"endDate\": {\n \"format\": \"date\",\n \"type\": \"string\"\n },\n \"eventId\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"groupFloor\": {\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"startDate\": {\n \"format\": \"date\",\n \"type\": \"string\"\n },\n \"tiers\": {\n \"items\": {\n \"$ref\": \"#/$defs/Tier\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"eventId\",\n \"startDate\",\n \"endDate\",\n \"groupFloor\",\n \"tiers\"\n ],\n \"title\": \"PublishedEvent\",\n \"type\": \"object\"\n },\n \"Response\": {\n \"$anchor\": \"response\",\n \"additionalProperties\": false,\n \"properties\": {\n \"application\": {\n \"$ref\": \"#/$defs/ApplicationSummary\"\n },\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\"\n }\n },\n \"required\": [\n \"application\"\n ],\n \"title\": \"VTA PCS — Applications — Create — response payload\",\n \"type\": \"object\"\n },\n \"StatementMeta\": {\n \"additionalProperties\": false,\n \"description\": \"What a Vetting Statement would have said, minus its issuer.\",\n \"properties\": {\n \"cardDigestMultibase\": {\n \"description\": \"Digest of that card, as the vetter verified it.\",\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n },\n \"claimsVerified\": {\n \"description\": \"The claim types the vetter checked.\",\n \"items\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"minItems\": 1,\n \"type\": \"array\"\n },\n \"community\": {\n \"description\": \"The community this attestation is for. An attestation is not portable between communities.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"declaredRelationship\": {\n \"description\": \"The relationship the vetter declared, which the community's independence rules count.\",\n \"enum\": [\n \"none\",\n \"family\",\n \"sameEmployer\",\n \"closeFriend\",\n \"other\"\n ],\n \"type\": \"string\"\n },\n \"identityCommitment\": {\n \"description\": \"The commitment on the Vetting Card the applicant showed. Consistency across attestations is what stops two applicants pooling them.\",\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n },\n \"livenessConfirmed\": {\n \"description\": \"Whether the vetter confirmed a live person.\",\n \"type\": \"boolean\"\n },\n \"method\": {\n \"description\": \"How the vetter met the applicant.\",\n \"enum\": [\n \"inPerson\",\n \"video\",\n \"priorAcquaintance\"\n ],\n \"type\": \"string\"\n },\n \"requirementsDigest\": {\n \"description\": \"The digest of the criterion's requirements as the vetter read them.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"tokenLabel\": {\n \"description\": \"The token label spent, repeated inside the bound facts so it cannot be swapped in transit.\",\n \"maxLength\": 128,\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"tokenSerial\": {\n \"description\": \"The token serial spent, likewise bound.\",\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n },\n \"validFrom\": {\n \"description\": \"A DATE, never a timestamp: an exact time would let a community line an attestation up with a vetter's activity, which undoes the proof without touching it.\",\n \"format\": \"date\",\n \"type\": \"string\"\n },\n \"validUntil\": {\n \"description\": \"A date, for the same reason.\",\n \"format\": \"date\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"community\",\n \"requirementsDigest\",\n \"method\",\n \"claimsVerified\",\n \"livenessConfirmed\",\n \"declaredRelationship\",\n \"identityCommitment\",\n \"cardDigestMultibase\",\n \"validFrom\",\n \"validUntil\",\n \"tokenLabel\",\n \"tokenSerial\"\n ],\n \"type\": \"object\"\n },\n \"TickLength\": {\n \"description\": \"The length of one tick of the drip, as an ISO 8601 duration in days and/or hours — at least `PT1H`. A label's tick `t` is the window starting `t` tick lengths after the label's start (`vtc/vetting/vetters/pcs-tokens`).\",\n \"pattern\": \"^P(?:\\\\d+D(?:T\\\\d+H)?|T\\\\d+H)$\",\n \"title\": \"TickLength\",\n \"type\": \"string\"\n },\n \"Tier\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"dripPerTick\": {\n \"description\": \"How many tokens a tick under this tier yields.\",\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"name\": {\n \"description\": \"How the menu names it: desk, busy-desk.\",\n \"minLength\": 1,\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\",\n \"dripPerTick\"\n ],\n \"title\": \"Tier\",\n \"type\": \"object\"\n }\n },\n \"$id\": \"https://trusttasks.org/spec/vta/pcs/applications/create/0.1\",\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"additionalProperties\": false,\n \"description\": \"An applicant's client asks its VTA to start a hidden-vetting application: the VTA derives a fresh PCS key for it, keeps the key, and returns the PCS identifier vetters attest to.\",\n \"properties\": {\n \"community\": {\n \"description\": \"The community's DID: the helper whose parameters the engine runs under.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"contextId\": {\n \"description\": \"The context the engine belongs to. Its key is derived from this context's base.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\"\n },\n \"joinDid\": {\n \"description\": \"The DID the applicant joins the community as. Bound into the proof, so the proof cannot be carried to another join.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"parameters\": {\n \"$ref\": \"#/$defs/CommunityParameters\",\n \"description\": \"The community's published hidden-vetting parameters, copied verbatim from its join manifest.\"\n }\n },\n \"required\": [\n \"contextId\",\n \"community\",\n \"joinDid\",\n \"parameters\"\n ],\n \"title\": \"VTA PCS — Applications — Create — payload\",\n \"type\": \"object\"\n}\n",
);
}
impl crate::Payload for Response {
const TYPE_URI: &'static str =
"https://trusttasks.org/spec/vta/pcs/applications/create/0.1#response";
const IS_ISSUED_AT_REQUIRED: bool = true;
const IS_RECIPIENT_REQUIRED: bool = true;
const PAYLOAD_SCHEMA: Option<&'static str> = Some(
"{\n \"$defs\": {\n \"ApplicationSummary\": {\n \"additionalProperties\": false,\n \"description\": \"An applicant engine as the VTA holds it, without its key.\",\n \"properties\": {\n \"applicationId\": {\n \"description\": \"The VTA's handle for this application. Opaque; never sent to the community.\",\n \"maxLength\": 128,\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"attestations\": {\n \"description\": \"The metadata of each attestation held, in the order received. Metadata names no vetter.\",\n \"items\": {\n \"$ref\": \"#/$defs/StatementMeta\"\n },\n \"type\": \"array\"\n },\n \"community\": {\n \"description\": \"The community's DID.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"contextId\": {\n \"description\": \"The context the application's key is derived in.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"createdAt\": {\n \"format\": \"date-time\",\n \"type\": \"string\"\n },\n \"id\": {\n \"$ref\": \"#/$defs/Multibase\",\n \"description\": \"The applicant's PCS identifier: what a vetter attests to, carried in a vetting/request's `ext`.\"\n },\n \"joinDid\": {\n \"description\": \"The DID the application joins as.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"suite\": {\n \"maxLength\": 64,\n \"minLength\": 1,\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"applicationId\",\n \"contextId\",\n \"community\",\n \"joinDid\",\n \"suite\",\n \"id\",\n \"attestations\",\n \"createdAt\"\n ],\n \"title\": \"ApplicationSummary\",\n \"type\": \"object\"\n },\n \"CommunityParameters\": {\n \"$ref\": \"#/$defs/PublishedConfig\",\n \"description\": \"The community's hidden-vetting parameters exactly as its join manifest publishes them, under the criterion's `vetting.ext`. The caller copies them in verbatim on every call that needs them, because the community rotates labels and the engine keeps no copy of its own: a stale copy costs the caller a refused proof, never a mistaken one.\",\n \"title\": \"CommunityParameters\"\n },\n \"Ext\": {\n \"additionalProperties\": true,\n \"description\": \"Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.\",\n \"minProperties\": 1,\n \"propertyNames\": {\n \"pattern\": \"^[a-z][a-z0-9-]*(\\\\.[a-z0-9-]+)+$\"\n },\n \"title\": \"Ext\",\n \"type\": \"object\"\n },\n \"Multibase\": {\n \"description\": \"A binary value, multibase base58btc over the suite's canonical encoding.\",\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"title\": \"Multibase\",\n \"type\": \"string\"\n },\n \"PublishedConfig\": {\n \"additionalProperties\": false,\n \"description\": \"The parameters exactly as they now appear in this community's join manifest, under vetting.ext. What an applicant and a vetter read.\",\n \"properties\": {\n \"dripPerTick\": {\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"events\": {\n \"items\": {\n \"$ref\": \"#/$defs/PublishedEvent\"\n },\n \"type\": \"array\"\n },\n \"helperKey\": {\n \"description\": \"The helper verification key, multibase — named for its role on the wire rather than for hvk.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"suite\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"tickLength\": {\n \"$ref\": \"#/$defs/TickLength\"\n },\n \"tokenKey\": {\n \"description\": \"The token verification key, multibase — named for its role on the wire rather than for tvk.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"tokenLabels\": {\n \"items\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"vetterLabels\": {\n \"description\": \"Class labels published whole, e.g. vetter/2026-09 — a request names one of these, not the bare period.\",\n \"items\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"suite\",\n \"helperKey\",\n \"tokenKey\",\n \"vetterLabels\",\n \"tokenLabels\",\n \"dripPerTick\",\n \"tickLength\",\n \"events\"\n ],\n \"title\": \"PublishedConfig\",\n \"type\": \"object\"\n },\n \"PublishedEvent\": {\n \"additionalProperties\": false,\n \"description\": \"The published shape drops approvedBy and graceDays: who approved is the community's own record, and a vetter is told closesAfter when its request is approved rather than being handed the raw grace period here.\",\n \"properties\": {\n \"endDate\": {\n \"format\": \"date\",\n \"type\": \"string\"\n },\n \"eventId\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"groupFloor\": {\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"startDate\": {\n \"format\": \"date\",\n \"type\": \"string\"\n },\n \"tiers\": {\n \"items\": {\n \"$ref\": \"#/$defs/Tier\"\n },\n \"type\": \"array\"\n }\n },\n \"required\": [\n \"eventId\",\n \"startDate\",\n \"endDate\",\n \"groupFloor\",\n \"tiers\"\n ],\n \"title\": \"PublishedEvent\",\n \"type\": \"object\"\n },\n \"Response\": {\n \"$anchor\": \"response\",\n \"additionalProperties\": false,\n \"properties\": {\n \"application\": {\n \"$ref\": \"#/$defs/ApplicationSummary\"\n },\n \"ext\": {\n \"$ref\": \"#/$defs/Ext\"\n }\n },\n \"required\": [\n \"application\"\n ],\n \"title\": \"VTA PCS — Applications — Create — response payload\",\n \"type\": \"object\"\n },\n \"StatementMeta\": {\n \"additionalProperties\": false,\n \"description\": \"What a Vetting Statement would have said, minus its issuer.\",\n \"properties\": {\n \"cardDigestMultibase\": {\n \"description\": \"Digest of that card, as the vetter verified it.\",\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n },\n \"claimsVerified\": {\n \"description\": \"The claim types the vetter checked.\",\n \"items\": {\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"minItems\": 1,\n \"type\": \"array\"\n },\n \"community\": {\n \"description\": \"The community this attestation is for. An attestation is not portable between communities.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"declaredRelationship\": {\n \"description\": \"The relationship the vetter declared, which the community's independence rules count.\",\n \"enum\": [\n \"none\",\n \"family\",\n \"sameEmployer\",\n \"closeFriend\",\n \"other\"\n ],\n \"type\": \"string\"\n },\n \"identityCommitment\": {\n \"description\": \"The commitment on the Vetting Card the applicant showed. Consistency across attestations is what stops two applicants pooling them.\",\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n },\n \"livenessConfirmed\": {\n \"description\": \"Whether the vetter confirmed a live person.\",\n \"type\": \"boolean\"\n },\n \"method\": {\n \"description\": \"How the vetter met the applicant.\",\n \"enum\": [\n \"inPerson\",\n \"video\",\n \"priorAcquaintance\"\n ],\n \"type\": \"string\"\n },\n \"requirementsDigest\": {\n \"description\": \"The digest of the criterion's requirements as the vetter read them.\",\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"tokenLabel\": {\n \"description\": \"The token label spent, repeated inside the bound facts so it cannot be swapped in transit.\",\n \"maxLength\": 128,\n \"minLength\": 1,\n \"type\": \"string\"\n },\n \"tokenSerial\": {\n \"description\": \"The token serial spent, likewise bound.\",\n \"pattern\": \"^z[1-9A-HJ-NP-Za-km-z]+$\",\n \"type\": \"string\"\n },\n \"validFrom\": {\n \"description\": \"A DATE, never a timestamp: an exact time would let a community line an attestation up with a vetter's activity, which undoes the proof without touching it.\",\n \"format\": \"date\",\n \"type\": \"string\"\n },\n \"validUntil\": {\n \"description\": \"A date, for the same reason.\",\n \"format\": \"date\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"community\",\n \"requirementsDigest\",\n \"method\",\n \"claimsVerified\",\n \"livenessConfirmed\",\n \"declaredRelationship\",\n \"identityCommitment\",\n \"cardDigestMultibase\",\n \"validFrom\",\n \"validUntil\",\n \"tokenLabel\",\n \"tokenSerial\"\n ],\n \"type\": \"object\"\n },\n \"TickLength\": {\n \"description\": \"The length of one tick of the drip, as an ISO 8601 duration in days and/or hours — at least `PT1H`. A label's tick `t` is the window starting `t` tick lengths after the label's start (`vtc/vetting/vetters/pcs-tokens`).\",\n \"pattern\": \"^P(?:\\\\d+D(?:T\\\\d+H)?|T\\\\d+H)$\",\n \"title\": \"TickLength\",\n \"type\": \"string\"\n },\n \"Tier\": {\n \"additionalProperties\": false,\n \"properties\": {\n \"dripPerTick\": {\n \"description\": \"How many tokens a tick under this tier yields.\",\n \"minimum\": 1,\n \"type\": \"integer\"\n },\n \"name\": {\n \"description\": \"How the menu names it: desk, busy-desk.\",\n \"minLength\": 1,\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\",\n \"dripPerTick\"\n ],\n \"title\": \"Tier\",\n \"type\": \"object\"\n }\n },\n \"$ref\": \"#/$defs/Response\",\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\"\n}\n",
);
}
impl crate::RequestPayload for Payload {
type Response = Response;
}
/// The extended error codes this specification declares (SPEC §7.3 item 9,
/// §8.5), in declaration order. Empty when it declares none.
pub const ERROR_CODES: &[crate::DeclaredErrorCode] = &[
error_codes::UNSUPPORTED_SUITE,
error_codes::PARAMETERS_INVALID,
];
/// 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/applications/create: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/applications/create:unsupportedSuite",
retryable: false,
details_schema: ::core::option::Option::None,
};
/// `vta/pcs/applications/create:parametersInvalid`
///
/// The community parameters cannot be decoded.
///
/// Declared `retryable: false`.
pub const PARAMETERS_INVALID: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
code: "vta/pcs/applications/create:parametersInvalid",
retryable: false,
details_schema: ::core::option::Option::None,
};
}