// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: app.bsky.labeler.defs // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. pub mod get_services; pub mod service; #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct LabelerPolicies<'a> { /// Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub label_value_definitions: std::option::Option< Vec>, >, /// The label values which this labeler publishes. May include global or custom labels. #[serde(borrow)] pub label_values: Vec>, } pub mod labeler_policies_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 LabelValues; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type LabelValues = Unset; } ///State transition - sets the `label_values` field to Set pub struct SetLabelValues(PhantomData S>); impl sealed::Sealed for SetLabelValues {} impl State for SetLabelValues { type LabelValues = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `label_values` field pub struct label_values(()); } } /// Builder for constructing an instance of this type pub struct LabelerPoliciesBuilder<'a, S: labeler_policies_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>>, ::core::option::Option>>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> LabelerPolicies<'a> { /// Create a new builder for this type pub fn new() -> LabelerPoliciesBuilder<'a, labeler_policies_state::Empty> { LabelerPoliciesBuilder::new() } } impl<'a> LabelerPoliciesBuilder<'a, labeler_policies_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { LabelerPoliciesBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S: labeler_policies_state::State> LabelerPoliciesBuilder<'a, S> { /// Set the `labelValueDefinitions` field (optional) pub fn label_value_definitions( mut self, value: impl Into< Option>>, >, ) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `labelValueDefinitions` field to an Option value (optional) pub fn maybe_label_value_definitions( mut self, value: Option>>, ) -> Self { self.__unsafe_private_named.0 = value; self } } impl<'a, S> LabelerPoliciesBuilder<'a, S> where S: labeler_policies_state::State, S::LabelValues: labeler_policies_state::IsUnset, { /// Set the `labelValues` field (required) pub fn label_values( mut self, value: impl Into>>, ) -> LabelerPoliciesBuilder<'a, labeler_policies_state::SetLabelValues> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); LabelerPoliciesBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> LabelerPoliciesBuilder<'a, S> where S: labeler_policies_state::State, S::LabelValues: labeler_policies_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelerPolicies<'a> { LabelerPolicies { label_value_definitions: self.__unsafe_private_named.0, label_values: 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>, >, ) -> LabelerPolicies<'a> { LabelerPolicies { label_value_definitions: self.__unsafe_private_named.0, label_values: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } fn lexicon_doc_app_bsky_labeler_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("app.bsky.labeler.defs"), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("labelerPolicies"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("labelValues") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "labelValueDefinitions", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: Some( ::jacquard_common::CowStr::new_static( "Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.", ), ), items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "com.atproto.label.defs#labelValueDefinition", ), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "labelValues", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: Some( ::jacquard_common::CowStr::new_static( "The label values which this labeler publishes. May include global or custom labels.", ), ), items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "com.atproto.label.defs#labelValue", ), }), min_length: None, max_length: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("labelerView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_common::smol_str::SmolStr::new_static("creator"), ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Cid, ), 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("creator"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "app.bsky.actor.defs#profileView", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "indexedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, 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("labels"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "com.atproto.label.defs#label", ), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "likeCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: Some(0i64), maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, 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.insert( ::jacquard_common::smol_str::SmolStr::new_static("viewer"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#labelerViewerState", ), }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("labelerViewDetailed"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_common::smol_str::SmolStr::new_static("creator"), ::jacquard_common::smol_str::SmolStr::new_static("policies"), ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Cid, ), 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("creator"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "app.bsky.actor.defs#profileView", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "indexedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, 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("labels"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "com.atproto.label.defs#label", ), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "likeCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: Some(0i64), maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("policies"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "app.bsky.labeler.defs#labelerPolicies", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "reasonTypes", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: Some( ::jacquard_common::CowStr::new_static( "The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.", ), ), items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "com.atproto.moderation.defs#reasonType", ), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "subjectCollections", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: Some( ::jacquard_common::CowStr::new_static( "Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.", ), ), items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Nsid, ), 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: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "subjectTypes", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: Some( ::jacquard_common::CowStr::new_static( "The set of subject types (account, record, etc) this service accepts reports on.", ), ), items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "com.atproto.moderation.defs#subjectType", ), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, 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.insert( ::jacquard_common::smol_str::SmolStr::new_static("viewer"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#labelerViewerState", ), }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("labelerViewerState"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: None, nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("like"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, 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 LabelerPolicies<'a> { fn nsid() -> &'static str { "app.bsky.labeler.defs" } fn def_name() -> &'static str { "labelerPolicies" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_app_bsky_labeler_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct LabelerView<'a> { #[serde(borrow)] pub cid: jacquard_common::types::string::Cid<'a>, #[serde(borrow)] pub creator: crate::app_bsky::actor::ProfileView<'a>, pub indexed_at: jacquard_common::types::string::Datetime, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub labels: std::option::Option>>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub like_count: std::option::Option, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer: std::option::Option>, } pub mod labeler_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 IndexedAt; type Cid; type Creator; type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type IndexedAt = Unset; type Cid = Unset; type Creator = Unset; type Uri = Unset; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type IndexedAt = Set; type Cid = S::Cid; type Creator = S::Creator; type Uri = S::Uri; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type IndexedAt = S::IndexedAt; type Cid = Set; type Creator = S::Creator; type Uri = S::Uri; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { type IndexedAt = S::IndexedAt; type Cid = S::Cid; type Creator = 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 IndexedAt = S::IndexedAt; type Cid = S::Cid; type Creator = S::Creator; type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `creator` field pub struct creator(()); ///Marker type for the `uri` field pub struct uri(()); } } /// Builder for constructing an instance of this type pub struct LabelerViewBuilder<'a, S: labeler_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>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> LabelerView<'a> { /// Create a new builder for this type pub fn new() -> LabelerViewBuilder<'a, labeler_view_state::Empty> { LabelerViewBuilder::new() } } impl<'a> LabelerViewBuilder<'a, labeler_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { LabelerViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None, None, None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> LabelerViewBuilder<'a, S> where S: labeler_view_state::State, S::Cid: labeler_view_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> LabelerViewBuilder<'a, labeler_view_state::SetCid> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); LabelerViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> LabelerViewBuilder<'a, S> where S: labeler_view_state::State, S::Creator: labeler_view_state::IsUnset, { /// Set the `creator` field (required) pub fn creator( mut self, value: impl Into>, ) -> LabelerViewBuilder<'a, labeler_view_state::SetCreator> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); LabelerViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> LabelerViewBuilder<'a, S> where S: labeler_view_state::State, S::IndexedAt: labeler_view_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> LabelerViewBuilder<'a, labeler_view_state::SetIndexedAt> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); LabelerViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: labeler_view_state::State> LabelerViewBuilder<'a, S> { /// Set the `labels` field (optional) pub fn labels( mut self, value: impl Into>>>, ) -> Self { self.__unsafe_private_named.3 = value.into(); self } /// Set the `labels` field to an Option value (optional) pub fn maybe_labels( mut self, value: Option>>, ) -> Self { self.__unsafe_private_named.3 = value; self } } impl<'a, S: labeler_view_state::State> LabelerViewBuilder<'a, S> { /// Set the `likeCount` field (optional) pub fn like_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.4 = value.into(); self } /// Set the `likeCount` field to an Option value (optional) pub fn maybe_like_count(mut self, value: Option) -> Self { self.__unsafe_private_named.4 = value; self } } impl<'a, S> LabelerViewBuilder<'a, S> where S: labeler_view_state::State, S::Uri: labeler_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> LabelerViewBuilder<'a, labeler_view_state::SetUri> { self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); LabelerViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: labeler_view_state::State> LabelerViewBuilder<'a, S> { /// Set the `viewer` field (optional) pub fn viewer( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.6 = value.into(); self } /// Set the `viewer` field to an Option value (optional) pub fn maybe_viewer( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.6 = value; self } } impl<'a, S> LabelerViewBuilder<'a, S> where S: labeler_view_state::State, S::IndexedAt: labeler_view_state::IsSet, S::Cid: labeler_view_state::IsSet, S::Creator: labeler_view_state::IsSet, S::Uri: labeler_view_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelerView<'a> { LabelerView { cid: self.__unsafe_private_named.0.unwrap(), creator: self.__unsafe_private_named.1.unwrap(), indexed_at: self.__unsafe_private_named.2.unwrap(), labels: self.__unsafe_private_named.3, like_count: self.__unsafe_private_named.4, uri: self.__unsafe_private_named.5.unwrap(), viewer: self.__unsafe_private_named.6, 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>, >, ) -> LabelerView<'a> { LabelerView { cid: self.__unsafe_private_named.0.unwrap(), creator: self.__unsafe_private_named.1.unwrap(), indexed_at: self.__unsafe_private_named.2.unwrap(), labels: self.__unsafe_private_named.3, like_count: self.__unsafe_private_named.4, uri: self.__unsafe_private_named.5.unwrap(), viewer: self.__unsafe_private_named.6, extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LabelerView<'a> { fn nsid() -> &'static str { "app.bsky.labeler.defs" } fn def_name() -> &'static str { "labelerView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_app_bsky_labeler_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { if let Some(ref value) = self.like_count { if *value < 0i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "like_count", ), min: 0i64, actual: *value, }); } } Ok(()) } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct LabelerViewDetailed<'a> { #[serde(borrow)] pub cid: jacquard_common::types::string::Cid<'a>, #[serde(borrow)] pub creator: crate::app_bsky::actor::ProfileView<'a>, pub indexed_at: jacquard_common::types::string::Datetime, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub labels: std::option::Option>>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub like_count: std::option::Option, #[serde(borrow)] pub policies: crate::app_bsky::labeler::LabelerPolicies<'a>, /// The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub reason_types: std::option::Option< Vec>, >, /// Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub subject_collections: std::option::Option< Vec>, >, /// The set of subject types (account, record, etc) this service accepts reports on. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub subject_types: std::option::Option< Vec>, >, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer: std::option::Option>, } pub mod labeler_view_detailed_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 Cid; type Policies; type Uri; type Creator; type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Cid = Unset; type Policies = Unset; type Uri = Unset; type Creator = Unset; type IndexedAt = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Cid = Set; type Policies = S::Policies; type Uri = S::Uri; type Creator = S::Creator; type IndexedAt = S::IndexedAt; } ///State transition - sets the `policies` field to Set pub struct SetPolicies(PhantomData S>); impl sealed::Sealed for SetPolicies {} impl State for SetPolicies { type Cid = S::Cid; type Policies = Set; type Uri = S::Uri; type Creator = S::Creator; type IndexedAt = S::IndexedAt; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Cid = S::Cid; type Policies = S::Policies; type Uri = Set; type Creator = S::Creator; type IndexedAt = S::IndexedAt; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { type Cid = S::Cid; type Policies = S::Policies; type Uri = S::Uri; type Creator = Set; type IndexedAt = S::IndexedAt; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Cid = S::Cid; type Policies = S::Policies; type Uri = S::Uri; type Creator = S::Creator; type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `policies` field pub struct policies(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `creator` field pub struct creator(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); } } /// Builder for constructing an instance of this type pub struct LabelerViewDetailedBuilder<'a, S: labeler_view_detailed_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>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> LabelerViewDetailed<'a> { /// Create a new builder for this type pub fn new() -> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::Empty> { LabelerViewDetailedBuilder::new() } } impl<'a> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { LabelerViewDetailedBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: ( None, None, None, None, None, None, None, None, None, None, None, ), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> LabelerViewDetailedBuilder<'a, S> where S: labeler_view_detailed_state::State, S::Cid: labeler_view_detailed_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::SetCid> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); LabelerViewDetailedBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> LabelerViewDetailedBuilder<'a, S> where S: labeler_view_detailed_state::State, S::Creator: labeler_view_detailed_state::IsUnset, { /// Set the `creator` field (required) pub fn creator( mut self, value: impl Into>, ) -> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::SetCreator> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); LabelerViewDetailedBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> LabelerViewDetailedBuilder<'a, S> where S: labeler_view_detailed_state::State, S::IndexedAt: labeler_view_detailed_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::SetIndexedAt> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); LabelerViewDetailedBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S> { /// Set the `labels` field (optional) pub fn labels( mut self, value: impl Into>>>, ) -> Self { self.__unsafe_private_named.3 = value.into(); self } /// Set the `labels` field to an Option value (optional) pub fn maybe_labels( mut self, value: Option>>, ) -> Self { self.__unsafe_private_named.3 = value; self } } impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S> { /// Set the `likeCount` field (optional) pub fn like_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.4 = value.into(); self } /// Set the `likeCount` field to an Option value (optional) pub fn maybe_like_count(mut self, value: Option) -> Self { self.__unsafe_private_named.4 = value; self } } impl<'a, S> LabelerViewDetailedBuilder<'a, S> where S: labeler_view_detailed_state::State, S::Policies: labeler_view_detailed_state::IsUnset, { /// Set the `policies` field (required) pub fn policies( mut self, value: impl Into>, ) -> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::SetPolicies> { self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); LabelerViewDetailedBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S> { /// Set the `reasonTypes` field (optional) pub fn reason_types( mut self, value: impl Into>>>, ) -> Self { self.__unsafe_private_named.6 = value.into(); self } /// Set the `reasonTypes` field to an Option value (optional) pub fn maybe_reason_types( mut self, value: Option>>, ) -> Self { self.__unsafe_private_named.6 = value; self } } impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S> { /// Set the `subjectCollections` field (optional) pub fn subject_collections( mut self, value: impl Into>>>, ) -> Self { self.__unsafe_private_named.7 = value.into(); self } /// Set the `subjectCollections` field to an Option value (optional) pub fn maybe_subject_collections( mut self, value: Option>>, ) -> Self { self.__unsafe_private_named.7 = value; self } } impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S> { /// Set the `subjectTypes` field (optional) pub fn subject_types( mut self, value: impl Into>>>, ) -> Self { self.__unsafe_private_named.8 = value.into(); self } /// Set the `subjectTypes` field to an Option value (optional) pub fn maybe_subject_types( mut self, value: Option>>, ) -> Self { self.__unsafe_private_named.8 = value; self } } impl<'a, S> LabelerViewDetailedBuilder<'a, S> where S: labeler_view_detailed_state::State, S::Uri: labeler_view_detailed_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> LabelerViewDetailedBuilder<'a, labeler_view_detailed_state::SetUri> { self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); LabelerViewDetailedBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S> { /// Set the `viewer` field (optional) pub fn viewer( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.10 = value.into(); self } /// Set the `viewer` field to an Option value (optional) pub fn maybe_viewer( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.10 = value; self } } impl<'a, S> LabelerViewDetailedBuilder<'a, S> where S: labeler_view_detailed_state::State, S::Cid: labeler_view_detailed_state::IsSet, S::Policies: labeler_view_detailed_state::IsSet, S::Uri: labeler_view_detailed_state::IsSet, S::Creator: labeler_view_detailed_state::IsSet, S::IndexedAt: labeler_view_detailed_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelerViewDetailed<'a> { LabelerViewDetailed { cid: self.__unsafe_private_named.0.unwrap(), creator: self.__unsafe_private_named.1.unwrap(), indexed_at: self.__unsafe_private_named.2.unwrap(), labels: self.__unsafe_private_named.3, like_count: self.__unsafe_private_named.4, policies: self.__unsafe_private_named.5.unwrap(), reason_types: self.__unsafe_private_named.6, subject_collections: self.__unsafe_private_named.7, subject_types: self.__unsafe_private_named.8, uri: self.__unsafe_private_named.9.unwrap(), viewer: self.__unsafe_private_named.10, 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>, >, ) -> LabelerViewDetailed<'a> { LabelerViewDetailed { cid: self.__unsafe_private_named.0.unwrap(), creator: self.__unsafe_private_named.1.unwrap(), indexed_at: self.__unsafe_private_named.2.unwrap(), labels: self.__unsafe_private_named.3, like_count: self.__unsafe_private_named.4, policies: self.__unsafe_private_named.5.unwrap(), reason_types: self.__unsafe_private_named.6, subject_collections: self.__unsafe_private_named.7, subject_types: self.__unsafe_private_named.8, uri: self.__unsafe_private_named.9.unwrap(), viewer: self.__unsafe_private_named.10, extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LabelerViewDetailed<'a> { fn nsid() -> &'static str { "app.bsky.labeler.defs" } fn def_name() -> &'static str { "labelerViewDetailed" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_app_bsky_labeler_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { if let Some(ref value) = self.like_count { if *value < 0i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "like_count", ), min: 0i64, actual: *value, }); } } Ok(()) } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, Default )] #[serde(rename_all = "camelCase")] pub struct LabelerViewerState<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub like: std::option::Option>, } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LabelerViewerState<'a> { fn nsid() -> &'static str { "app.bsky.labeler.defs" } fn def_name() -> &'static str { "labelerViewerState" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_app_bsky_labeler_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } }