//! Generated by `trust-tasks-codegen` — do not edit by hand.
//!
//! Spec slug: `vtc/relationships/graph`. Version: `0.1`.
#![allow(deprecated)]
/// Why this specification version is deprecated (SPEC "Superseded and
/// Withdrawn Versions"), or `None` while it is current.
pub const DEPRECATION: Option<&str> = Some("retired; use vtc/relationships/graph/0.2");
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
/// Error types.
pub mod error {
/// Error from a `TryFrom` or `FromStr` implementation.
pub struct ConversionError(::std::borrow::Cow<'static, str>);
impl ::std::error::Error for ConversionError {}
impl ::std::fmt::Display for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Display::fmt(&self.0, f)
}
}
impl ::std::fmt::Debug for ConversionError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
::std::fmt::Debug::fmt(&self.0, f)
}
}
impl From<&'static str> for ConversionError {
fn from(value: &'static str) -> Self {
Self(value.into())
}
}
impl From<String> for ConversionError {
fn from(value: String) -> Self {
Self(value.into())
}
}
}
///Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Ext(pub ::std::collections::HashMap<ExtKey, ::serde_json::Value>);
impl ::std::ops::Deref for Ext {
type Target = ::std::collections::HashMap<ExtKey, ::serde_json::Value>;
fn deref(&self) -> &::std::collections::HashMap<ExtKey, ::serde_json::Value> {
&self.0
}
}
impl ::std::convert::From<Ext> for ::std::collections::HashMap<ExtKey, ::serde_json::Value> {
fn from(value: Ext) -> Self {
value.0
}
}
impl ::std::convert::From<::std::collections::HashMap<ExtKey, ::serde_json::Value>> for Ext {
fn from(value: ::std::collections::HashMap<ExtKey, ::serde_json::Value>) -> Self {
Self(value)
}
}
///`ExtKey`
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ExtKey(::std::string::String);
impl ::std::ops::Deref for ExtKey {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<ExtKey> for ::std::string::String {
fn from(value: ExtKey) -> Self {
value.0
}
}
impl ::std::str::FromStr for ExtKey {
type Err = self::error::ConversionError;
fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
::std::sync::LazyLock::new(|| {
::regress::Regex::new("^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$").unwrap()
});
if PATTERN.find(value).is_none() {
return Err("doesn't match pattern \"^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$\"".into());
}
Ok(Self(value.to_string()))
}
}
impl ::std::convert::TryFrom<&str> for ExtKey {
type Error = self::error::ConversionError;
fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for ExtKey {
type Error = self::error::ConversionError;
fn try_from(
value: &::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for ExtKey {
type Error = self::error::ConversionError;
fn try_from(
value: ::std::string::String,
) -> ::std::result::Result<Self, self::error::ConversionError> {
value.parse()
}
}
impl<'de> ::serde::Deserialize<'de> for ExtKey {
fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
::std::string::String::deserialize(deserializer)?
.parse()
.map_err(|e: self::error::ConversionError| {
<D::Error as ::serde::de::Error>::custom(e.to_string())
})
}
}
///`GraphEdge`
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct GraphEdge {
///When the relationship was published.
#[serde(rename = "createdAt")]
pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
///Relationship credential identifier.
pub id: GraphEdgeId,
///The vouching party.
#[serde(rename = "issuerDid")]
pub issuer_did: GraphEdgeIssuerDid,
///The vouched-for party.
#[serde(rename = "subjectDid")]
pub subject_did: GraphEdgeSubjectDid,
}
impl GraphEdge {
pub fn builder() -> builder::GraphEdge {
Default::default()
}
}
///Relationship credential identifier.
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct GraphEdgeId(::std::string::String);
impl ::std::ops::Deref for GraphEdgeId {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<GraphEdgeId> for ::std::string::String {
fn from(value: GraphEdgeId) -> Self {
value.0
}
}
impl ::std::str::FromStr for GraphEdgeId {
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 GraphEdgeId {
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 GraphEdgeId {
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 GraphEdgeId {
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 GraphEdgeId {
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 vouching party.
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct GraphEdgeIssuerDid(::std::string::String);
impl ::std::ops::Deref for GraphEdgeIssuerDid {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<GraphEdgeIssuerDid> for ::std::string::String {
fn from(value: GraphEdgeIssuerDid) -> Self {
value.0
}
}
impl ::std::str::FromStr for GraphEdgeIssuerDid {
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 GraphEdgeIssuerDid {
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 GraphEdgeIssuerDid {
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 GraphEdgeIssuerDid {
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 GraphEdgeIssuerDid {
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 vouched-for party.
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct GraphEdgeSubjectDid(::std::string::String);
impl ::std::ops::Deref for GraphEdgeSubjectDid {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<GraphEdgeSubjectDid> for ::std::string::String {
fn from(value: GraphEdgeSubjectDid) -> Self {
value.0
}
}
impl ::std::str::FromStr for GraphEdgeSubjectDid {
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 GraphEdgeSubjectDid {
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 GraphEdgeSubjectDid {
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 GraphEdgeSubjectDid {
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 GraphEdgeSubjectDid {
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())
})
}
}
///`GraphNode`
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct GraphNode {
///A DID participating in at least one live relationship.
pub did: GraphNodeDid,
}
impl GraphNode {
pub fn builder() -> builder::GraphNode {
Default::default()
}
}
///A DID participating in at least one live relationship.
///
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct GraphNodeDid(::std::string::String);
impl ::std::ops::Deref for GraphNodeDid {
type Target = ::std::string::String;
fn deref(&self) -> &::std::string::String {
&self.0
}
}
impl ::std::convert::From<GraphNodeDid> for ::std::string::String {
fn from(value: GraphNodeDid) -> Self {
value.0
}
}
impl ::std::str::FromStr for GraphNodeDid {
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 GraphNodeDid {
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 GraphNodeDid {
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 GraphNodeDid {
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 GraphNodeDid {
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())
})
}
}
///`Payload`
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
#[deprecated(note = "retired; use vtc/relationships/graph/0.2")]
pub struct Payload {
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ext: ::std::option::Option<Ext>,
}
impl ::std::default::Default for Payload {
fn default() -> Self {
Self {
ext: Default::default(),
}
}
}
impl Payload {
pub fn builder() -> builder::Payload {
Default::default()
}
}
///`Response`
///
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
#[deprecated(note = "retired; use vtc/relationships/graph/0.2")]
pub struct Response {
///One per unrevoked relationship credential, directed issuer -> subject.
pub edges: ::std::vec::Vec<GraphEdge>,
#[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
pub ext: ::std::option::Option<Ext>,
///One per distinct DID appearing in a live edge. No isolated nodes.
pub nodes: ::std::vec::Vec<GraphNode>,
}
impl Response {
pub fn builder() -> builder::Response {
Default::default()
}
}
/// Types for composing complex structures.
pub mod builder {
#[derive(Clone, Debug)]
pub struct GraphEdge {
created_at:
::std::result::Result<::chrono::DateTime<::chrono::offset::Utc>, ::std::string::String>,
id: ::std::result::Result<super::GraphEdgeId, ::std::string::String>,
issuer_did: ::std::result::Result<super::GraphEdgeIssuerDid, ::std::string::String>,
subject_did: ::std::result::Result<super::GraphEdgeSubjectDid, ::std::string::String>,
}
impl ::std::default::Default for GraphEdge {
fn default() -> Self {
Self {
created_at: Err("no value supplied for created_at".to_string()),
id: Err("no value supplied for id".to_string()),
issuer_did: Err("no value supplied for issuer_did".to_string()),
subject_did: Err("no value supplied for subject_did".to_string()),
}
}
}
impl GraphEdge {
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::GraphEdgeId>,
T::Error: ::std::fmt::Display,
{
self.id = value
.try_into()
.map_err(|e| format!("error converting supplied value for id: {e}"));
self
}
pub fn issuer_did<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::GraphEdgeIssuerDid>,
T::Error: ::std::fmt::Display,
{
self.issuer_did = value
.try_into()
.map_err(|e| format!("error converting supplied value for issuer_did: {e}"));
self
}
pub fn subject_did<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::GraphEdgeSubjectDid>,
T::Error: ::std::fmt::Display,
{
self.subject_did = value
.try_into()
.map_err(|e| format!("error converting supplied value for subject_did: {e}"));
self
}
}
impl ::std::convert::TryFrom<GraphEdge> for super::GraphEdge {
type Error = super::error::ConversionError;
fn try_from(
value: GraphEdge,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self {
created_at: value.created_at?,
id: value.id?,
issuer_did: value.issuer_did?,
subject_did: value.subject_did?,
})
}
}
impl ::std::convert::From<super::GraphEdge> for GraphEdge {
fn from(value: super::GraphEdge) -> Self {
Self {
created_at: Ok(value.created_at),
id: Ok(value.id),
issuer_did: Ok(value.issuer_did),
subject_did: Ok(value.subject_did),
}
}
}
#[derive(Clone, Debug)]
pub struct GraphNode {
did: ::std::result::Result<super::GraphNodeDid, ::std::string::String>,
}
impl ::std::default::Default for GraphNode {
fn default() -> Self {
Self {
did: Err("no value supplied for did".to_string()),
}
}
}
impl GraphNode {
pub fn did<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<super::GraphNodeDid>,
T::Error: ::std::fmt::Display,
{
self.did = value
.try_into()
.map_err(|e| format!("error converting supplied value for did: {e}"));
self
}
}
impl ::std::convert::TryFrom<GraphNode> for super::GraphNode {
type Error = super::error::ConversionError;
fn try_from(
value: GraphNode,
) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { did: value.did? })
}
}
impl ::std::convert::From<super::GraphNode> for GraphNode {
fn from(value: super::GraphNode) -> Self {
Self { did: Ok(value.did) }
}
}
#[derive(Clone, Debug)]
pub struct Payload {
ext: ::std::result::Result<::std::option::Option<super::Ext>, ::std::string::String>,
}
impl ::std::default::Default for Payload {
fn default() -> Self {
Self {
ext: Ok(Default::default()),
}
}
}
impl Payload {
pub fn ext<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::option::Option<super::Ext>>,
T::Error: ::std::fmt::Display,
{
self.ext = value
.try_into()
.map_err(|e| format!("error converting supplied value for ext: {e}"));
self
}
}
impl ::std::convert::TryFrom<Payload> for super::Payload {
type Error = super::error::ConversionError;
fn try_from(value: Payload) -> ::std::result::Result<Self, super::error::ConversionError> {
Ok(Self { ext: value.ext? })
}
}
impl ::std::convert::From<super::Payload> for Payload {
fn from(value: super::Payload) -> Self {
Self { ext: Ok(value.ext) }
}
}
#[derive(Clone, Debug)]
pub struct Response {
edges: ::std::result::Result<::std::vec::Vec<super::GraphEdge>, ::std::string::String>,
ext: ::std::result::Result<::std::option::Option<super::Ext>, ::std::string::String>,
nodes: ::std::result::Result<::std::vec::Vec<super::GraphNode>, ::std::string::String>,
}
impl ::std::default::Default for Response {
fn default() -> Self {
Self {
edges: Err("no value supplied for edges".to_string()),
ext: Ok(Default::default()),
nodes: Err("no value supplied for nodes".to_string()),
}
}
}
impl Response {
pub fn edges<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::GraphEdge>>,
T::Error: ::std::fmt::Display,
{
self.edges = value
.try_into()
.map_err(|e| format!("error converting supplied value for edges: {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 nodes<T>(mut self, value: T) -> Self
where
T: ::std::convert::TryInto<::std::vec::Vec<super::GraphNode>>,
T::Error: ::std::fmt::Display,
{
self.nodes = value
.try_into()
.map_err(|e| format!("error converting supplied value for nodes: {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 {
edges: value.edges?,
ext: value.ext?,
nodes: value.nodes?,
})
}
}
impl ::std::convert::From<super::Response> for Response {
fn from(value: super::Response) -> Self {
Self {
edges: Ok(value.edges),
ext: Ok(value.ext),
nodes: Ok(value.nodes),
}
}
}
}
impl crate::Payload for Payload {
const TYPE_URI: &'static str = "https://trusttasks.org/spec/vtc/relationships/graph/0.1";
const IS_RECIPIENT_REQUIRED: bool = true;
const PAYLOAD_SCHEMA: Option<&'static str> = Some(
"{\"$defs\":{\"Ext\":{\"additionalProperties\":true,\"description\":\"Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.\",\"minProperties\":1,\"propertyNames\":{\"pattern\":\"^[a-z][a-z0-9-]*(\\\\.[a-z0-9-]+)+$\"},\"title\":\"Ext\",\"type\":\"object\"},\"GraphEdge\":{\"$anchor\":\"graphEdge\",\"additionalProperties\":false,\"properties\":{\"createdAt\":{\"description\":\"When the relationship was published.\",\"format\":\"date-time\",\"type\":\"string\"},\"id\":{\"description\":\"Relationship credential identifier.\",\"minLength\":1,\"type\":\"string\"},\"issuerDid\":{\"description\":\"The vouching party.\",\"minLength\":1,\"type\":\"string\"},\"subjectDid\":{\"description\":\"The vouched-for party.\",\"minLength\":1,\"type\":\"string\"}},\"required\":[\"id\",\"issuerDid\",\"subjectDid\",\"createdAt\"],\"title\":\"GraphEdge\",\"type\":\"object\"},\"GraphNode\":{\"$anchor\":\"graphNode\",\"additionalProperties\":false,\"properties\":{\"did\":{\"description\":\"A DID participating in at least one live relationship.\",\"minLength\":1,\"type\":\"string\"}},\"required\":[\"did\"],\"title\":\"GraphNode\",\"type\":\"object\"},\"Response\":{\"$anchor\":\"response\",\"additionalProperties\":false,\"properties\":{\"edges\":{\"description\":\"One per unrevoked relationship credential, directed issuer -> subject.\",\"items\":{\"$ref\":\"#/$defs/GraphEdge\"},\"type\":\"array\"},\"ext\":{\"$ref\":\"#/$defs/Ext\"},\"nodes\":{\"description\":\"One per distinct DID appearing in a live edge. No isolated nodes.\",\"items\":{\"$ref\":\"#/$defs/GraphNode\"},\"type\":\"array\"}},\"required\":[\"nodes\",\"edges\"],\"title\":\"VTC Relationships Graph — response payload\",\"type\":\"object\"}},\"$id\":\"https://trusttasks.org/spec/vtc/relationships/graph/0.1\",\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"additionalProperties\":false,\"properties\":{\"ext\":{\"$ref\":\"#/$defs/Ext\"}},\"title\":\"VTC Relationships Graph — payload\",\"type\":\"object\"}\n",
);
}
impl crate::Payload for Response {
const TYPE_URI: &'static str =
"https://trusttasks.org/spec/vtc/relationships/graph/0.1#response";
const IS_RECIPIENT_REQUIRED: bool = true;
const PAYLOAD_SCHEMA: Option<&'static str> = Some(
"{\"$defs\":{\"Ext\":{\"additionalProperties\":true,\"description\":\"Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.\",\"minProperties\":1,\"propertyNames\":{\"pattern\":\"^[a-z][a-z0-9-]*(\\\\.[a-z0-9-]+)+$\"},\"title\":\"Ext\",\"type\":\"object\"},\"GraphEdge\":{\"$anchor\":\"graphEdge\",\"additionalProperties\":false,\"properties\":{\"createdAt\":{\"description\":\"When the relationship was published.\",\"format\":\"date-time\",\"type\":\"string\"},\"id\":{\"description\":\"Relationship credential identifier.\",\"minLength\":1,\"type\":\"string\"},\"issuerDid\":{\"description\":\"The vouching party.\",\"minLength\":1,\"type\":\"string\"},\"subjectDid\":{\"description\":\"The vouched-for party.\",\"minLength\":1,\"type\":\"string\"}},\"required\":[\"id\",\"issuerDid\",\"subjectDid\",\"createdAt\"],\"title\":\"GraphEdge\",\"type\":\"object\"},\"GraphNode\":{\"$anchor\":\"graphNode\",\"additionalProperties\":false,\"properties\":{\"did\":{\"description\":\"A DID participating in at least one live relationship.\",\"minLength\":1,\"type\":\"string\"}},\"required\":[\"did\"],\"title\":\"GraphNode\",\"type\":\"object\"},\"Response\":{\"$anchor\":\"response\",\"additionalProperties\":false,\"properties\":{\"edges\":{\"description\":\"One per unrevoked relationship credential, directed issuer -> subject.\",\"items\":{\"$ref\":\"#/$defs/GraphEdge\"},\"type\":\"array\"},\"ext\":{\"$ref\":\"#/$defs/Ext\"},\"nodes\":{\"description\":\"One per distinct DID appearing in a live edge. No isolated nodes.\",\"items\":{\"$ref\":\"#/$defs/GraphNode\"},\"type\":\"array\"}},\"required\":[\"nodes\",\"edges\"],\"title\":\"VTC Relationships Graph — response payload\",\"type\":\"object\"}},\"$ref\":\"#/$defs/Response\",\"$schema\":\"https://json-schema.org/draft/2020-12/schema\"}\n",
);
}
impl crate::RequestPayload for Payload {
type Response = Response;
}
/// The earlier `MAJOR.MINOR` of this slug that this version declares it
/// extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
/// `None`. Only the direct declaration; walk a chain with
/// [`crate::extension::extends_for`].
pub const EXTENDS: Option<&str> = None;
/// The extended error codes this specification declares (SPEC §7.3 item 9,
/// §8.5), in declaration order. Empty when it declares none.
pub const ERROR_CODES: &[crate::DeclaredErrorCode] = &[error_codes::PERMISSION_DENIED];
/// 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 {
/// `vtc/relationships/graph:permissionDenied`
///
/// The consumer lacks the community-admin capability.
///
/// Declared `retryable: false`.
pub const PERMISSION_DENIED: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
code: "vtc/relationships/graph:permissionDenied",
retryable: false,
details_schema: ::core::option::Option::None,
};
}