// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: tools.ozone.verification.defs // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. pub mod grant_verifications; pub mod list_verifications; pub mod revoke_verifications; /// Verification data for the associated subject. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct VerificationView<'a> { /// Timestamp when the verification was created. pub created_at: jacquard_common::types::string::Datetime, /// Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying. #[serde(borrow)] pub display_name: jacquard_common::CowStr<'a>, /// Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying. #[serde(borrow)] pub handle: jacquard_common::types::string::Handle<'a>, /// The user who issued this verification. #[serde(borrow)] pub issuer: jacquard_common::types::string::Did<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub issuer_profile: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub issuer_repo: std::option::Option>, /// Describes the reason for revocation, also indicating that the verification is no longer valid. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub revoke_reason: std::option::Option>, /// Timestamp when the verification was revoked. #[serde(skip_serializing_if = "std::option::Option::is_none")] pub revoked_at: std::option::Option, /// The user who revoked this verification. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub revoked_by: std::option::Option>, /// The subject of the verification. #[serde(borrow)] pub subject: jacquard_common::types::string::Did<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub subject_profile: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub subject_repo: std::option::Option>, /// The AT-URI of the verification record. #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, } pub mod verification_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Handle; type CreatedAt; type Uri; type DisplayName; type Issuer; type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Handle = Unset; type CreatedAt = Unset; type Uri = Unset; type DisplayName = Unset; type Issuer = Unset; type Subject = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { type Handle = Set; type CreatedAt = S::CreatedAt; type Uri = S::Uri; type DisplayName = S::DisplayName; type Issuer = S::Issuer; type Subject = S::Subject; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type Handle = S::Handle; type CreatedAt = Set; type Uri = S::Uri; type DisplayName = S::DisplayName; type Issuer = S::Issuer; type Subject = S::Subject; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Handle = S::Handle; type CreatedAt = S::CreatedAt; type Uri = Set; type DisplayName = S::DisplayName; type Issuer = S::Issuer; type Subject = S::Subject; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { type Handle = S::Handle; type CreatedAt = S::CreatedAt; type Uri = S::Uri; type DisplayName = Set; type Issuer = S::Issuer; type Subject = S::Subject; } ///State transition - sets the `issuer` field to Set pub struct SetIssuer(PhantomData S>); impl sealed::Sealed for SetIssuer {} impl State for SetIssuer { type Handle = S::Handle; type CreatedAt = S::CreatedAt; type Uri = S::Uri; type DisplayName = S::DisplayName; type Issuer = Set; type Subject = S::Subject; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { type Handle = S::Handle; type CreatedAt = S::CreatedAt; type Uri = S::Uri; type DisplayName = S::DisplayName; type Issuer = S::Issuer; type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `handle` field pub struct handle(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `display_name` field pub struct display_name(()); ///Marker type for the `issuer` field pub struct issuer(()); ///Marker type for the `subject` field pub struct subject(()); } } /// Builder for constructing an instance of this type pub struct VerificationViewBuilder<'a, S: verification_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> VerificationView<'a> { /// Create a new builder for this type pub fn new() -> VerificationViewBuilder<'a, verification_view_state::Empty> { VerificationViewBuilder::new() } } impl<'a> VerificationViewBuilder<'a, verification_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { VerificationViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: ( None, None, None, None, None, None, None, None, None, None, None, None, None, ), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> VerificationViewBuilder<'a, S> where S: verification_view_state::State, S::CreatedAt: verification_view_state::IsUnset, { /// Set the `createdAt` field (required) pub fn created_at( mut self, value: impl Into, ) -> VerificationViewBuilder<'a, verification_view_state::SetCreatedAt> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); VerificationViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> VerificationViewBuilder<'a, S> where S: verification_view_state::State, S::DisplayName: verification_view_state::IsUnset, { /// Set the `displayName` field (required) pub fn display_name( mut self, value: impl Into>, ) -> VerificationViewBuilder<'a, verification_view_state::SetDisplayName> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); VerificationViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> VerificationViewBuilder<'a, S> where S: verification_view_state::State, S::Handle: verification_view_state::IsUnset, { /// Set the `handle` field (required) pub fn handle( mut self, value: impl Into>, ) -> VerificationViewBuilder<'a, verification_view_state::SetHandle> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); VerificationViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> VerificationViewBuilder<'a, S> where S: verification_view_state::State, S::Issuer: verification_view_state::IsUnset, { /// Set the `issuer` field (required) pub fn issuer( mut self, value: impl Into>, ) -> VerificationViewBuilder<'a, verification_view_state::SetIssuer> { self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); VerificationViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { /// Set the `issuerProfile` field (optional) pub fn issuer_profile( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.4 = value.into(); self } /// Set the `issuerProfile` field to an Option value (optional) pub fn maybe_issuer_profile( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.4 = value; self } } impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { /// Set the `issuerRepo` field (optional) pub fn issuer_repo( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.5 = value.into(); self } /// Set the `issuerRepo` field to an Option value (optional) pub fn maybe_issuer_repo( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.5 = value; self } } impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { /// Set the `revokeReason` field (optional) pub fn revoke_reason( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.6 = value.into(); self } /// Set the `revokeReason` field to an Option value (optional) pub fn maybe_revoke_reason( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.6 = value; self } } impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { /// Set the `revokedAt` field (optional) pub fn revoked_at( mut self, value: impl Into>, ) -> Self { self.__unsafe_private_named.7 = value.into(); self } /// Set the `revokedAt` field to an Option value (optional) pub fn maybe_revoked_at( mut self, value: Option, ) -> Self { self.__unsafe_private_named.7 = value; self } } impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { /// Set the `revokedBy` field (optional) pub fn revoked_by( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.8 = value.into(); self } /// Set the `revokedBy` field to an Option value (optional) pub fn maybe_revoked_by( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.8 = value; self } } impl<'a, S> VerificationViewBuilder<'a, S> where S: verification_view_state::State, S::Subject: verification_view_state::IsUnset, { /// Set the `subject` field (required) pub fn subject( mut self, value: impl Into>, ) -> VerificationViewBuilder<'a, verification_view_state::SetSubject> { self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); VerificationViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { /// Set the `subjectProfile` field (optional) pub fn subject_profile( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.10 = value.into(); self } /// Set the `subjectProfile` field to an Option value (optional) pub fn maybe_subject_profile( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.10 = value; self } } impl<'a, S: verification_view_state::State> VerificationViewBuilder<'a, S> { /// Set the `subjectRepo` field (optional) pub fn subject_repo( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.11 = value.into(); self } /// Set the `subjectRepo` field to an Option value (optional) pub fn maybe_subject_repo( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.11 = value; self } } impl<'a, S> VerificationViewBuilder<'a, S> where S: verification_view_state::State, S::Uri: verification_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> VerificationViewBuilder<'a, verification_view_state::SetUri> { self.__unsafe_private_named.12 = ::core::option::Option::Some(value.into()); VerificationViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> VerificationViewBuilder<'a, S> where S: verification_view_state::State, S::Handle: verification_view_state::IsSet, S::CreatedAt: verification_view_state::IsSet, S::Uri: verification_view_state::IsSet, S::DisplayName: verification_view_state::IsSet, S::Issuer: verification_view_state::IsSet, S::Subject: verification_view_state::IsSet, { /// Build the final struct pub fn build(self) -> VerificationView<'a> { VerificationView { created_at: self.__unsafe_private_named.0.unwrap(), display_name: self.__unsafe_private_named.1.unwrap(), handle: self.__unsafe_private_named.2.unwrap(), issuer: self.__unsafe_private_named.3.unwrap(), issuer_profile: self.__unsafe_private_named.4, issuer_repo: self.__unsafe_private_named.5, revoke_reason: self.__unsafe_private_named.6, revoked_at: self.__unsafe_private_named.7, revoked_by: self.__unsafe_private_named.8, subject: self.__unsafe_private_named.9.unwrap(), subject_profile: self.__unsafe_private_named.10, subject_repo: self.__unsafe_private_named.11, uri: self.__unsafe_private_named.12.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> VerificationView<'a> { VerificationView { created_at: self.__unsafe_private_named.0.unwrap(), display_name: self.__unsafe_private_named.1.unwrap(), handle: self.__unsafe_private_named.2.unwrap(), issuer: self.__unsafe_private_named.3.unwrap(), issuer_profile: self.__unsafe_private_named.4, issuer_repo: self.__unsafe_private_named.5, revoke_reason: self.__unsafe_private_named.6, revoked_at: self.__unsafe_private_named.7, revoked_by: self.__unsafe_private_named.8, subject: self.__unsafe_private_named.9.unwrap(), subject_profile: self.__unsafe_private_named.10, subject_repo: self.__unsafe_private_named.11, uri: self.__unsafe_private_named.12.unwrap(), extra_data: Some(extra_data), } } } #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum VerificationViewIssuerRepo<'a> { #[serde(rename = "tools.ozone.moderation.defs#repoViewDetail")] RepoViewDetail(Box>), #[serde(rename = "tools.ozone.moderation.defs#repoViewNotFound")] RepoViewNotFound(Box>), } #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum VerificationViewSubjectRepo<'a> { #[serde(rename = "tools.ozone.moderation.defs#repoViewDetail")] RepoViewDetail(Box>), #[serde(rename = "tools.ozone.moderation.defs#repoViewNotFound")] RepoViewNotFound(Box>), } fn lexicon_doc_tools_ozone_verification_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("tools.ozone.verification.defs"), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("verificationView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Verification data for the associated subject.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("issuer"), ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("subject"), ::jacquard_common::smol_str::SmolStr::new_static("handle"), ::jacquard_common::smol_str::SmolStr::new_static("displayName"), ::jacquard_common::smol_str::SmolStr::new_static("createdAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "createdAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "Timestamp when the verification was created.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "displayName", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying.", ), ), format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("handle"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Handle, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("issuer"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The user who issued this verification.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Did, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "issuerProfile", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { description: None, refs: vec![], closed: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "issuerRepo", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { description: None, refs: vec![ ::jacquard_common::CowStr::new_static("tools.ozone.moderation.defs#repoViewDetail"), ::jacquard_common::CowStr::new_static("tools.ozone.moderation.defs#repoViewNotFound") ], closed: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "revokeReason", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "Describes the reason for revocation, also indicating that the verification is no longer valid.", ), ), format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "revokedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "Timestamp when the verification was revoked.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "revokedBy", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The user who revoked this verification.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Did, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("subject"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The subject of the verification.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Did, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "subjectProfile", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { description: None, refs: vec![], closed: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "subjectRepo", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { description: None, refs: vec![ ::jacquard_common::CowStr::new_static("tools.ozone.moderation.defs#repoViewDetail"), ::jacquard_common::CowStr::new_static("tools.ozone.moderation.defs#repoViewNotFound") ], closed: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The AT-URI of the verification record.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map }, } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for VerificationView<'a> { fn nsid() -> &'static str { "tools.ozone.verification.defs" } fn def_name() -> &'static str { "verificationView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_tools_ozone_verification_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } }