// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: tools.ozone.verification.revokeVerifications // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct RevokeVerifications<'a> { /// Reason for revoking the verification. This is optional and can be omitted if not needed. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub revoke_reason: std::option::Option>, /// Array of verification record uris to revoke #[serde(borrow)] pub uris: Vec>, } pub mod revoke_verifications_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 Uris; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uris = Unset; } ///State transition - sets the `uris` field to Set pub struct SetUris(PhantomData S>); impl sealed::Sealed for SetUris {} impl State for SetUris { type Uris = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `uris` field pub struct uris(()); } } /// Builder for constructing an instance of this type pub struct RevokeVerificationsBuilder<'a, S: revoke_verifications_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> RevokeVerifications<'a> { /// Create a new builder for this type pub fn new() -> RevokeVerificationsBuilder<'a, revoke_verifications_state::Empty> { RevokeVerificationsBuilder::new() } } impl<'a> RevokeVerificationsBuilder<'a, revoke_verifications_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { RevokeVerificationsBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S: revoke_verifications_state::State> RevokeVerificationsBuilder<'a, S> { /// Set the `revokeReason` field (optional) pub fn revoke_reason( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.0 = 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.0 = value; self } } impl<'a, S> RevokeVerificationsBuilder<'a, S> where S: revoke_verifications_state::State, S::Uris: revoke_verifications_state::IsUnset, { /// Set the `uris` field (required) pub fn uris( mut self, value: impl Into>>, ) -> RevokeVerificationsBuilder<'a, revoke_verifications_state::SetUris> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); RevokeVerificationsBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> RevokeVerificationsBuilder<'a, S> where S: revoke_verifications_state::State, S::Uris: revoke_verifications_state::IsSet, { /// Build the final struct pub fn build(self) -> RevokeVerifications<'a> { RevokeVerifications { revoke_reason: self.__unsafe_private_named.0, uris: self.__unsafe_private_named.1.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>, >, ) -> RevokeVerifications<'a> { RevokeVerifications { revoke_reason: self.__unsafe_private_named.0, uris: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct RevokeVerificationsOutput<'a> { /// List of verification uris that couldn't be revoked, including failure reasons #[serde(borrow)] pub failed_revocations: Vec< crate::tools_ozone::verification::revoke_verifications::RevokeError<'a>, >, /// List of verification uris successfully revoked #[serde(borrow)] pub revoked_verifications: Vec>, } /// Response type for ///tools.ozone.verification.revokeVerifications pub struct RevokeVerificationsResponse; impl jacquard_common::xrpc::XrpcResp for RevokeVerificationsResponse { const NSID: &'static str = "tools.ozone.verification.revokeVerifications"; const ENCODING: &'static str = "application/json"; type Output<'de> = RevokeVerificationsOutput<'de>; type Err<'de> = jacquard_common::xrpc::GenericError<'de>; } impl<'a> jacquard_common::xrpc::XrpcRequest for RevokeVerifications<'a> { const NSID: &'static str = "tools.ozone.verification.revokeVerifications"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( "application/json", ); type Response = RevokeVerificationsResponse; } /// Endpoint type for ///tools.ozone.verification.revokeVerifications pub struct RevokeVerificationsRequest; impl jacquard_common::xrpc::XrpcEndpoint for RevokeVerificationsRequest { const PATH: &'static str = "/xrpc/tools.ozone.verification.revokeVerifications"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( "application/json", ); type Request<'de> = RevokeVerifications<'de>; type Response = RevokeVerificationsResponse; } /// Error object for failed revocations #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct RevokeError<'a> { /// Description of the error that occurred during revocation. #[serde(borrow)] pub error: jacquard_common::CowStr<'a>, /// The AT-URI of the verification record that failed to revoke. #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, } pub mod revoke_error_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 Error; type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Error = Unset; type Uri = Unset; } ///State transition - sets the `error` field to Set pub struct SetError(PhantomData S>); impl sealed::Sealed for SetError {} impl State for SetError { type Error = Set; type Uri = S::Uri; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Error = S::Error; type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `error` field pub struct error(()); ///Marker type for the `uri` field pub struct uri(()); } } /// Builder for constructing an instance of this type pub struct RevokeErrorBuilder<'a, S: revoke_error_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> RevokeError<'a> { /// Create a new builder for this type pub fn new() -> RevokeErrorBuilder<'a, revoke_error_state::Empty> { RevokeErrorBuilder::new() } } impl<'a> RevokeErrorBuilder<'a, revoke_error_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { RevokeErrorBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> RevokeErrorBuilder<'a, S> where S: revoke_error_state::State, S::Error: revoke_error_state::IsUnset, { /// Set the `error` field (required) pub fn error( mut self, value: impl Into>, ) -> RevokeErrorBuilder<'a, revoke_error_state::SetError> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); RevokeErrorBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> RevokeErrorBuilder<'a, S> where S: revoke_error_state::State, S::Uri: revoke_error_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> RevokeErrorBuilder<'a, revoke_error_state::SetUri> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); RevokeErrorBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> RevokeErrorBuilder<'a, S> where S: revoke_error_state::State, S::Error: revoke_error_state::IsSet, S::Uri: revoke_error_state::IsSet, { /// Build the final struct pub fn build(self) -> RevokeError<'a> { RevokeError { error: self.__unsafe_private_named.0.unwrap(), uri: self.__unsafe_private_named.1.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>, >, ) -> RevokeError<'a> { RevokeError { error: self.__unsafe_private_named.0.unwrap(), uri: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } fn lexicon_doc_tools_ozone_verification_revokeVerifications() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static( "tools.ozone.verification.revokeVerifications", ), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("main"), ::jacquard_lexicon::lexicon::LexUserType::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { description: None, parameters: None, input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { description: None, encoding: ::jacquard_common::CowStr::new_static( "application/json", ), schema: Some( ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uris") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); 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( "Reason for revoking the verification. This is optional and can be omitted if not needed.", ), ), format: None, default: None, min_length: None, max_length: Some(1000usize), min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("uris"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: Some( ::jacquard_common::CowStr::new_static( "Array of verification record uris to revoke", ), ), items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The AT-URI of the verification record to revoke.", ), ), 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, }), min_length: None, max_length: Some(100usize), }), ); map }, }), ), }), output: None, errors: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("revokeError"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Error object for failed revocations", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("error") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("error"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "Description of the error that occurred during revocation.", ), ), 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("uri"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The AT-URI of the verification record that failed to revoke.", ), ), 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 RevokeError<'a> { fn nsid() -> &'static str { "tools.ozone.verification.revokeVerifications" } fn def_name() -> &'static str { "revokeError" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_tools_ozone_verification_revokeVerifications() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } }