// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: com.atproto.label.defs // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. /// Metadata tag on an atproto resource (eg, repo or record). #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde( rename_all = "camelCase", bound(deserialize = "S: serde::Deserialize<'de> + jacquard_common::BosStr") )] pub struct Label { ///Optionally, CID specifying the specific version of 'uri' resource this label applies to. #[serde(skip_serializing_if = "core::option::Option::is_none")] pub cid: core::option::Option>, ///Timestamp when this label was created. pub cts: jacquard_common::types::string::Datetime, ///Timestamp at which this label expires (no longer applies). #[serde(skip_serializing_if = "core::option::Option::is_none")] pub exp: core::option::Option, ///If true, this is a negation label, overwriting a previous label. #[serde(skip_serializing_if = "core::option::Option::is_none")] pub neg: core::option::Option, ///Signature of dag-cbor encoded label. #[serde(skip_serializing_if = "core::option::Option::is_none")] #[serde(default, with = "jacquard_common::opt_serde_bytes_helper")] pub sig: core::option::Option, ///DID of the actor who created this label. pub src: jacquard_common::types::string::Did, ///AT URI of the record, repository (account), or other resource that this label applies to. pub uri: jacquard_common::types::string::UriValue, ///The short string name of the value or type of this label. pub val: S, ///The AT Protocol version of the label object. #[serde(skip_serializing_if = "core::option::Option::is_none")] pub ver: core::option::Option, #[serde(flatten, default, skip_serializing_if = "core::option::Option::is_none")] pub extra_data: core::option::Option< alloc::collections::BTreeMap< jacquard_common::deps::smol_str::SmolStr, jacquard_common::types::value::Data, >, >, } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum LabelValue { Hide, NoPromote, Warn, NoUnauthenticated, DmcaViolation, Doxxing, Porn, Sexual, Nudity, Nsfl, Gore, Other(S), } impl LabelValue { pub fn as_str(&self) -> &str { match self { Self::Hide => "!hide", Self::NoPromote => "!no-promote", Self::Warn => "!warn", Self::NoUnauthenticated => "!no-unauthenticated", Self::DmcaViolation => "dmca-violation", Self::Doxxing => "doxxing", Self::Porn => "porn", Self::Sexual => "sexual", Self::Nudity => "nudity", Self::Nsfl => "nsfl", Self::Gore => "gore", Self::Other(s) => s.as_ref(), } } /// Construct from a string-like value, matching known values. pub fn from_value(s: S) -> Self { match s.as_ref() { "!hide" => Self::Hide, "!no-promote" => Self::NoPromote, "!warn" => Self::Warn, "!no-unauthenticated" => Self::NoUnauthenticated, "dmca-violation" => Self::DmcaViolation, "doxxing" => Self::Doxxing, "porn" => Self::Porn, "sexual" => Self::Sexual, "nudity" => Self::Nudity, "nsfl" => Self::Nsfl, "gore" => Self::Gore, _ => Self::Other(s), } } } impl AsRef for LabelValue { fn as_ref(&self) -> &str { self.as_str() } } impl core::fmt::Display for LabelValue { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.as_str()) } } impl serde::Serialize for LabelValue { fn serialize(&self, serializer: Ser) -> Result where Ser: serde::Serializer, { serializer.serialize_str(self.as_str()) } } impl<'de, S: serde::Deserialize<'de> + jacquard_common::BosStr> serde::Deserialize<'de> for LabelValue { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { let s = S::deserialize(deserializer)?; Ok(Self::from_value(s)) } } impl jacquard_common::IntoStatic for LabelValue where S: jacquard_common::BosStr + jacquard_common::IntoStatic, S::Output: jacquard_common::BosStr, { type Output = LabelValue; fn into_static(self) -> Self::Output { match self { LabelValue::Hide => LabelValue::Hide, LabelValue::NoPromote => LabelValue::NoPromote, LabelValue::Warn => LabelValue::Warn, LabelValue::NoUnauthenticated => LabelValue::NoUnauthenticated, LabelValue::DmcaViolation => LabelValue::DmcaViolation, LabelValue::Doxxing => LabelValue::Doxxing, LabelValue::Porn => LabelValue::Porn, LabelValue::Sexual => LabelValue::Sexual, LabelValue::Nudity => LabelValue::Nudity, LabelValue::Nsfl => LabelValue::Nsfl, LabelValue::Gore => LabelValue::Gore, LabelValue::Other(v) => LabelValue::Other(v.into_static()), } } } /// Declares a label value and its expected interpretations and behaviors. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde( rename_all = "camelCase", bound(deserialize = "S: serde::Deserialize<'de> + jacquard_common::BosStr") )] pub struct LabelValueDefinition< S: jacquard_common::BosStr = jacquard_common::DefaultStr, > { ///Does the user need to have adult content enabled in order to configure this label? #[serde(skip_serializing_if = "core::option::Option::is_none")] pub adult_only: core::option::Option, ///What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing. pub blurs: LabelValueDefinitionBlurs, ///The default setting for this label. #[serde(skip_serializing_if = "core::option::Option::is_none")] pub default_setting: core::option::Option>, ///The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+). pub identifier: S, pub locales: Vec< crate::macro_mode::com_atproto::label::LabelValueDefinitionStrings, >, ///How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. pub severity: LabelValueDefinitionSeverity, #[serde(flatten, default, skip_serializing_if = "core::option::Option::is_none")] pub extra_data: core::option::Option< alloc::collections::BTreeMap< jacquard_common::deps::smol_str::SmolStr, jacquard_common::types::value::Data, >, >, } /// What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum LabelValueDefinitionBlurs< S: jacquard_common::BosStr = jacquard_common::DefaultStr, > { Content, Media, None, Other(S), } impl LabelValueDefinitionBlurs { pub fn as_str(&self) -> &str { match self { Self::Content => "content", Self::Media => "media", Self::None => "none", Self::Other(s) => s.as_ref(), } } /// Construct from a string-like value, matching known values. pub fn from_value(s: S) -> Self { match s.as_ref() { "content" => Self::Content, "media" => Self::Media, "none" => Self::None, _ => Self::Other(s), } } } impl core::fmt::Display for LabelValueDefinitionBlurs { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.as_str()) } } impl AsRef for LabelValueDefinitionBlurs { fn as_ref(&self) -> &str { self.as_str() } } impl serde::Serialize for LabelValueDefinitionBlurs { fn serialize(&self, serializer: Ser) -> Result where Ser: serde::Serializer, { serializer.serialize_str(self.as_str()) } } impl<'de, S: serde::Deserialize<'de> + jacquard_common::BosStr> serde::Deserialize<'de> for LabelValueDefinitionBlurs { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { let s = S::deserialize(deserializer)?; Ok(Self::from_value(s)) } } impl Default for LabelValueDefinitionBlurs { fn default() -> Self { Self::Other(Default::default()) } } impl jacquard_common::IntoStatic for LabelValueDefinitionBlurs where S: jacquard_common::BosStr + jacquard_common::IntoStatic, S::Output: jacquard_common::BosStr, { type Output = LabelValueDefinitionBlurs; fn into_static(self) -> Self::Output { match self { LabelValueDefinitionBlurs::Content => LabelValueDefinitionBlurs::Content, LabelValueDefinitionBlurs::Media => LabelValueDefinitionBlurs::Media, LabelValueDefinitionBlurs::None => LabelValueDefinitionBlurs::None, LabelValueDefinitionBlurs::Other(v) => { LabelValueDefinitionBlurs::Other(v.into_static()) } } } } /// The default setting for this label. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum LabelValueDefinitionDefaultSetting< S: jacquard_common::BosStr = jacquard_common::DefaultStr, > { Ignore, Warn, Hide, Other(S), } impl LabelValueDefinitionDefaultSetting { pub fn as_str(&self) -> &str { match self { Self::Ignore => "ignore", Self::Warn => "warn", Self::Hide => "hide", Self::Other(s) => s.as_ref(), } } /// Construct from a string-like value, matching known values. pub fn from_value(s: S) -> Self { match s.as_ref() { "ignore" => Self::Ignore, "warn" => Self::Warn, "hide" => Self::Hide, _ => Self::Other(s), } } } impl core::fmt::Display for LabelValueDefinitionDefaultSetting { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.as_str()) } } impl AsRef for LabelValueDefinitionDefaultSetting { fn as_ref(&self) -> &str { self.as_str() } } impl serde::Serialize for LabelValueDefinitionDefaultSetting { fn serialize(&self, serializer: Ser) -> Result where Ser: serde::Serializer, { serializer.serialize_str(self.as_str()) } } impl<'de, S: serde::Deserialize<'de> + jacquard_common::BosStr> serde::Deserialize<'de> for LabelValueDefinitionDefaultSetting { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { let s = S::deserialize(deserializer)?; Ok(Self::from_value(s)) } } impl Default for LabelValueDefinitionDefaultSetting { fn default() -> Self { Self::Other(Default::default()) } } impl jacquard_common::IntoStatic for LabelValueDefinitionDefaultSetting where S: jacquard_common::BosStr + jacquard_common::IntoStatic, S::Output: jacquard_common::BosStr, { type Output = LabelValueDefinitionDefaultSetting; fn into_static(self) -> Self::Output { match self { LabelValueDefinitionDefaultSetting::Ignore => { LabelValueDefinitionDefaultSetting::Ignore } LabelValueDefinitionDefaultSetting::Warn => { LabelValueDefinitionDefaultSetting::Warn } LabelValueDefinitionDefaultSetting::Hide => { LabelValueDefinitionDefaultSetting::Hide } LabelValueDefinitionDefaultSetting::Other(v) => { LabelValueDefinitionDefaultSetting::Other(v.into_static()) } } } } /// How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum LabelValueDefinitionSeverity< S: jacquard_common::BosStr = jacquard_common::DefaultStr, > { Inform, Alert, None, Other(S), } impl LabelValueDefinitionSeverity { pub fn as_str(&self) -> &str { match self { Self::Inform => "inform", Self::Alert => "alert", Self::None => "none", Self::Other(s) => s.as_ref(), } } /// Construct from a string-like value, matching known values. pub fn from_value(s: S) -> Self { match s.as_ref() { "inform" => Self::Inform, "alert" => Self::Alert, "none" => Self::None, _ => Self::Other(s), } } } impl core::fmt::Display for LabelValueDefinitionSeverity { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.as_str()) } } impl AsRef for LabelValueDefinitionSeverity { fn as_ref(&self) -> &str { self.as_str() } } impl serde::Serialize for LabelValueDefinitionSeverity { fn serialize(&self, serializer: Ser) -> Result where Ser: serde::Serializer, { serializer.serialize_str(self.as_str()) } } impl<'de, S: serde::Deserialize<'de> + jacquard_common::BosStr> serde::Deserialize<'de> for LabelValueDefinitionSeverity { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { let s = S::deserialize(deserializer)?; Ok(Self::from_value(s)) } } impl Default for LabelValueDefinitionSeverity { fn default() -> Self { Self::Other(Default::default()) } } impl jacquard_common::IntoStatic for LabelValueDefinitionSeverity where S: jacquard_common::BosStr + jacquard_common::IntoStatic, S::Output: jacquard_common::BosStr, { type Output = LabelValueDefinitionSeverity; fn into_static(self) -> Self::Output { match self { LabelValueDefinitionSeverity::Inform => LabelValueDefinitionSeverity::Inform, LabelValueDefinitionSeverity::Alert => LabelValueDefinitionSeverity::Alert, LabelValueDefinitionSeverity::None => LabelValueDefinitionSeverity::None, LabelValueDefinitionSeverity::Other(v) => { LabelValueDefinitionSeverity::Other(v.into_static()) } } } } /// Strings which describe the label in the UI, localized into a specific language. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde( rename_all = "camelCase", bound(deserialize = "S: serde::Deserialize<'de> + jacquard_common::BosStr") )] pub struct LabelValueDefinitionStrings< S: jacquard_common::BosStr = jacquard_common::DefaultStr, > { ///A longer description of what the label means and why it might be applied. pub description: S, ///The code of the language these strings are written in. pub lang: jacquard_common::types::string::Language, ///A short human-readable name for the label. pub name: S, #[serde(flatten, default, skip_serializing_if = "core::option::Option::is_none")] pub extra_data: core::option::Option< alloc::collections::BTreeMap< jacquard_common::deps::smol_str::SmolStr, jacquard_common::types::value::Data, >, >, } /// Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, Default )] #[serde( rename_all = "camelCase", bound(deserialize = "S: serde::Deserialize<'de> + jacquard_common::BosStr") )] pub struct SelfLabel { ///The short string name of the value or type of this label. pub val: S, #[serde(flatten, default, skip_serializing_if = "core::option::Option::is_none")] pub extra_data: core::option::Option< alloc::collections::BTreeMap< jacquard_common::deps::smol_str::SmolStr, jacquard_common::types::value::Data, >, >, } /// Metadata tags on an atproto record, published by the author within the record. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde( rename_all = "camelCase", bound(deserialize = "S: serde::Deserialize<'de> + jacquard_common::BosStr") )] pub struct SelfLabels { pub values: Vec>, #[serde(flatten, default, skip_serializing_if = "core::option::Option::is_none")] pub extra_data: core::option::Option< alloc::collections::BTreeMap< jacquard_common::deps::smol_str::SmolStr, jacquard_common::types::value::Data, >, >, } impl jacquard_lexicon::schema::LexiconSchema for Label { fn nsid() -> &'static str { "com.atproto.label.defs" } fn def_name() -> &'static str { "label" } fn lexicon_doc() -> jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_atproto_label_defs() } fn validate(&self) -> Result<(), jacquard_lexicon::validation::ConstraintError> { { let value = &self.val; #[allow(unused_comparisons)] if ::len(value.as_ref()) > 128usize { return Err(jacquard_lexicon::validation::ConstraintError::MaxLength { path: jacquard_lexicon::validation::ValidationPath::from_field( "val", ), max: 128usize, actual: ::len(value.as_ref()), }); } } Ok(()) } } impl jacquard_lexicon::schema::LexiconSchema for LabelValueDefinition { fn nsid() -> &'static str { "com.atproto.label.defs" } fn def_name() -> &'static str { "labelValueDefinition" } fn lexicon_doc() -> jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_atproto_label_defs() } fn validate(&self) -> Result<(), jacquard_lexicon::validation::ConstraintError> { { let value = &self.identifier; #[allow(unused_comparisons)] if ::len(value.as_ref()) > 100usize { return Err(jacquard_lexicon::validation::ConstraintError::MaxLength { path: jacquard_lexicon::validation::ValidationPath::from_field( "identifier", ), max: 100usize, actual: ::len(value.as_ref()), }); } } { let value = &self.identifier; { let count = jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation::graphemes( value.as_ref(), true, ) .count(); if count > 100usize { return Err(jacquard_lexicon::validation::ConstraintError::MaxGraphemes { path: jacquard_lexicon::validation::ValidationPath::from_field( "identifier", ), max: 100usize, actual: count, }); } } } Ok(()) } } impl jacquard_lexicon::schema::LexiconSchema for LabelValueDefinitionStrings { fn nsid() -> &'static str { "com.atproto.label.defs" } fn def_name() -> &'static str { "labelValueDefinitionStrings" } fn lexicon_doc() -> jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_atproto_label_defs() } fn validate(&self) -> Result<(), jacquard_lexicon::validation::ConstraintError> { { let value = &self.description; #[allow(unused_comparisons)] if ::len(value.as_ref()) > 100000usize { return Err(jacquard_lexicon::validation::ConstraintError::MaxLength { path: jacquard_lexicon::validation::ValidationPath::from_field( "description", ), max: 100000usize, actual: ::len(value.as_ref()), }); } } { let value = &self.description; { let count = jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation::graphemes( value.as_ref(), true, ) .count(); if count > 10000usize { return Err(jacquard_lexicon::validation::ConstraintError::MaxGraphemes { path: jacquard_lexicon::validation::ValidationPath::from_field( "description", ), max: 10000usize, actual: count, }); } } } { let value = &self.name; #[allow(unused_comparisons)] if ::len(value.as_ref()) > 640usize { return Err(jacquard_lexicon::validation::ConstraintError::MaxLength { path: jacquard_lexicon::validation::ValidationPath::from_field( "name", ), max: 640usize, actual: ::len(value.as_ref()), }); } } { let value = &self.name; { let count = jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation::graphemes( value.as_ref(), true, ) .count(); if count > 64usize { return Err(jacquard_lexicon::validation::ConstraintError::MaxGraphemes { path: jacquard_lexicon::validation::ValidationPath::from_field( "name", ), max: 64usize, actual: count, }); } } } Ok(()) } } impl jacquard_lexicon::schema::LexiconSchema for SelfLabel { fn nsid() -> &'static str { "com.atproto.label.defs" } fn def_name() -> &'static str { "selfLabel" } fn lexicon_doc() -> jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_atproto_label_defs() } fn validate(&self) -> Result<(), jacquard_lexicon::validation::ConstraintError> { { let value = &self.val; #[allow(unused_comparisons)] if ::len(value.as_ref()) > 128usize { return Err(jacquard_lexicon::validation::ConstraintError::MaxLength { path: jacquard_lexicon::validation::ValidationPath::from_field( "val", ), max: 128usize, actual: ::len(value.as_ref()), }); } } Ok(()) } } impl jacquard_lexicon::schema::LexiconSchema for SelfLabels { fn nsid() -> &'static str { "com.atproto.label.defs" } fn def_name() -> &'static str { "selfLabels" } fn lexicon_doc() -> jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_com_atproto_label_defs() } fn validate(&self) -> Result<(), jacquard_lexicon::validation::ConstraintError> { { let value = &self.values; #[allow(unused_comparisons)] if value.len() > 10usize { return Err(jacquard_lexicon::validation::ConstraintError::MaxLength { path: jacquard_lexicon::validation::ValidationPath::from_field( "values", ), max: 10usize, actual: value.len(), }); } } Ok(()) } } pub mod label_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 Val; type Cts; type Uri; type Src; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Val = Unset; type Cts = Unset; type Uri = Unset; type Src = Unset; } ///State transition - sets the `val` field to Set pub struct SetVal(PhantomData St>); impl sealed::Sealed for SetVal {} impl State for SetVal { type Val = Set; type Cts = St::Cts; type Uri = St::Uri; type Src = St::Src; } ///State transition - sets the `cts` field to Set pub struct SetCts(PhantomData St>); impl sealed::Sealed for SetCts {} impl State for SetCts { type Val = St::Val; type Cts = Set; type Uri = St::Uri; type Src = St::Src; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Val = St::Val; type Cts = St::Cts; type Uri = Set; type Src = St::Src; } ///State transition - sets the `src` field to Set pub struct SetSrc(PhantomData St>); impl sealed::Sealed for SetSrc {} impl State for SetSrc { type Val = St::Val; type Cts = St::Cts; type Uri = St::Uri; type Src = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `val` field pub struct val(()); ///Marker type for the `cts` field pub struct cts(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `src` field pub struct src(()); } } /// Builder for constructing an instance of this type. pub struct LabelBuilder { _state: ::core::marker::PhantomData St>, _fields: ( 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, ), _type: ::core::marker::PhantomData S>, } impl Label { /// Create a new builder for this type. pub fn new() -> LabelBuilder { LabelBuilder::new() } } impl LabelBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { LabelBuilder { _state: ::core::marker::PhantomData, _fields: (None, None, None, None, None, None, None, None, None), _type: ::core::marker::PhantomData, } } } impl LabelBuilder { /// Set the `cid` field (optional) pub fn cid( mut self, value: impl Into>>, ) -> Self { self._fields.0 = value.into(); self } /// Set the `cid` field to an Option value (optional) pub fn maybe_cid( mut self, value: Option>, ) -> Self { self._fields.0 = value; self } } impl LabelBuilder where St: label_state::State, St::Cts: label_state::IsUnset, { /// Set the `cts` field (required) pub fn cts( mut self, value: impl Into, ) -> LabelBuilder> { self._fields.1 = ::core::option::Option::Some(value.into()); LabelBuilder { _state: ::core::marker::PhantomData, _fields: self._fields, _type: ::core::marker::PhantomData, } } } impl LabelBuilder { /// Set the `exp` field (optional) pub fn exp( mut self, value: impl Into>, ) -> Self { self._fields.2 = value.into(); self } /// Set the `exp` field to an Option value (optional) pub fn maybe_exp( mut self, value: Option, ) -> Self { self._fields.2 = value; self } } impl LabelBuilder { /// Set the `neg` field (optional) pub fn neg(mut self, value: impl Into>) -> Self { self._fields.3 = value.into(); self } /// Set the `neg` field to an Option value (optional) pub fn maybe_neg(mut self, value: Option) -> Self { self._fields.3 = value; self } } impl LabelBuilder { /// Set the `sig` field (optional) pub fn sig( mut self, value: impl Into>, ) -> Self { self._fields.4 = value.into(); self } /// Set the `sig` field to an Option value (optional) pub fn maybe_sig( mut self, value: Option, ) -> Self { self._fields.4 = value; self } } impl LabelBuilder where St: label_state::State, St::Src: label_state::IsUnset, { /// Set the `src` field (required) pub fn src( mut self, value: impl Into>, ) -> LabelBuilder> { self._fields.5 = ::core::option::Option::Some(value.into()); LabelBuilder { _state: ::core::marker::PhantomData, _fields: self._fields, _type: ::core::marker::PhantomData, } } } impl LabelBuilder where St: label_state::State, St::Uri: label_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> LabelBuilder> { self._fields.6 = ::core::option::Option::Some(value.into()); LabelBuilder { _state: ::core::marker::PhantomData, _fields: self._fields, _type: ::core::marker::PhantomData, } } } impl LabelBuilder where St: label_state::State, St::Val: label_state::IsUnset, { /// Set the `val` field (required) pub fn val( mut self, value: impl Into, ) -> LabelBuilder> { self._fields.7 = ::core::option::Option::Some(value.into()); LabelBuilder { _state: ::core::marker::PhantomData, _fields: self._fields, _type: ::core::marker::PhantomData, } } } impl LabelBuilder { /// Set the `ver` field (optional) pub fn ver(mut self, value: impl Into>) -> Self { self._fields.8 = value.into(); self } /// Set the `ver` field to an Option value (optional) pub fn maybe_ver(mut self, value: Option) -> Self { self._fields.8 = value; self } } impl LabelBuilder where St: label_state::State, St::Val: label_state::IsSet, St::Cts: label_state::IsSet, St::Uri: label_state::IsSet, St::Src: label_state::IsSet, { /// Build the final struct. pub fn build(self) -> Label { Label { cid: self._fields.0, cts: self._fields.1.unwrap(), exp: self._fields.2, neg: self._fields.3, sig: self._fields.4, src: self._fields.5.unwrap(), uri: self._fields.6.unwrap(), val: self._fields.7.unwrap(), ver: self._fields.8, extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: alloc::collections::BTreeMap< jacquard_common::deps::smol_str::SmolStr, jacquard_common::types::value::Data, >, ) -> Label { Label { cid: self._fields.0, cts: self._fields.1.unwrap(), exp: self._fields.2, neg: self._fields.3, sig: self._fields.4, src: self._fields.5.unwrap(), uri: self._fields.6.unwrap(), val: self._fields.7.unwrap(), ver: self._fields.8, extra_data: Some(extra_data), } } } fn lexicon_doc_com_atproto_label_defs() -> jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("com.atproto.label.defs"), defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static("label"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Metadata tag on an atproto resource (eg, repo or record).", ), ), required: Some( vec![ ::jacquard_common::deps::smol_str::SmolStr::new_static("src"), ::jacquard_common::deps::smol_str::SmolStr::new_static("uri"), ::jacquard_common::deps::smol_str::SmolStr::new_static("val"), ::jacquard_common::deps::smol_str::SmolStr::new_static("cts") ], ), properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "cid", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "Optionally, CID specifying the specific version of 'uri' resource this label applies to.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Cid, ), ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "cts", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "Timestamp when this label was created.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "exp", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "Timestamp at which this label expires (no longer applies).", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "neg", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "sig", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Bytes(::jacquard_lexicon::lexicon::LexBytes { ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "src", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "DID of the actor who created this label.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Did, ), ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "uri", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "AT URI of the record, repository (account), or other resource that this label applies to.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Uri, ), ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "val", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The short string name of the value or type of this label.", ), ), max_length: Some(128usize), ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "ver", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static("labelValue"), ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "labelValueDefinition", ), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Declares a label value and its expected interpretations and behaviors.", ), ), required: Some( vec![ ::jacquard_common::deps::smol_str::SmolStr::new_static("identifier"), ::jacquard_common::deps::smol_str::SmolStr::new_static("severity"), ::jacquard_common::deps::smol_str::SmolStr::new_static("blurs"), ::jacquard_common::deps::smol_str::SmolStr::new_static("locales") ], ), properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "adultOnly", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "blurs", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.", ), ), ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "defaultSetting", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The default setting for this label.", ), ), ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "identifier", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).", ), ), max_length: Some(100usize), max_graphemes: Some(100usize), ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "locales", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { r#ref: ::jacquard_common::CowStr::new_static( "#labelValueDefinitionStrings", ), ..Default::default() }), ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "severity", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.", ), ), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "labelValueDefinitionStrings", ), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Strings which describe the label in the UI, localized into a specific language.", ), ), required: Some( vec![ ::jacquard_common::deps::smol_str::SmolStr::new_static("lang"), ::jacquard_common::deps::smol_str::SmolStr::new_static("name"), ::jacquard_common::deps::smol_str::SmolStr::new_static("description") ], ), properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "description", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "A longer description of what the label means and why it might be applied.", ), ), max_length: Some(100000usize), max_graphemes: Some(10000usize), ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "lang", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The code of the language these strings are written in.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Language, ), ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "name", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "A short human-readable name for the label.", ), ), max_length: Some(640usize), max_graphemes: Some(64usize), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static("selfLabel"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.", ), ), required: Some( vec![ ::jacquard_common::deps::smol_str::SmolStr::new_static("val") ], ), properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "val", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The short string name of the value or type of this label.", ), ), max_length: Some(128usize), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static("selfLabels"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Metadata tags on an atproto record, published by the author within the record.", ), ), required: Some( vec![ ::jacquard_common::deps::smol_str::SmolStr::new_static("values") ], ), properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::deps::smol_str::SmolStr::new_static( "values", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { r#ref: ::jacquard_common::CowStr::new_static("#selfLabel"), ..Default::default() }), max_length: Some(10usize), ..Default::default() }), ); map }, ..Default::default() }), ); map }, ..Default::default() } } pub mod label_value_definition_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 Identifier; type Blurs; type Locales; type Severity; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Identifier = Unset; type Blurs = Unset; type Locales = Unset; type Severity = Unset; } ///State transition - sets the `identifier` field to Set pub struct SetIdentifier(PhantomData St>); impl sealed::Sealed for SetIdentifier {} impl State for SetIdentifier { type Identifier = Set; type Blurs = St::Blurs; type Locales = St::Locales; type Severity = St::Severity; } ///State transition - sets the `blurs` field to Set pub struct SetBlurs(PhantomData St>); impl sealed::Sealed for SetBlurs {} impl State for SetBlurs { type Identifier = St::Identifier; type Blurs = Set; type Locales = St::Locales; type Severity = St::Severity; } ///State transition - sets the `locales` field to Set pub struct SetLocales(PhantomData St>); impl sealed::Sealed for SetLocales {} impl State for SetLocales { type Identifier = St::Identifier; type Blurs = St::Blurs; type Locales = Set; type Severity = St::Severity; } ///State transition - sets the `severity` field to Set pub struct SetSeverity(PhantomData St>); impl sealed::Sealed for SetSeverity {} impl State for SetSeverity { type Identifier = St::Identifier; type Blurs = St::Blurs; type Locales = St::Locales; type Severity = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `identifier` field pub struct identifier(()); ///Marker type for the `blurs` field pub struct blurs(()); ///Marker type for the `locales` field pub struct locales(()); ///Marker type for the `severity` field pub struct severity(()); } } /// Builder for constructing an instance of this type. pub struct LabelValueDefinitionBuilder< S: jacquard_common::BosStr, St: label_value_definition_state::State, > { _state: ::core::marker::PhantomData St>, _fields: ( core::option::Option, core::option::Option>, core::option::Option>, core::option::Option, core::option::Option< Vec>, >, core::option::Option>, ), _type: ::core::marker::PhantomData S>, } impl LabelValueDefinition { /// Create a new builder for this type. pub fn new() -> LabelValueDefinitionBuilder { LabelValueDefinitionBuilder::new() } } impl< S: jacquard_common::BosStr, > LabelValueDefinitionBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { LabelValueDefinitionBuilder { _state: ::core::marker::PhantomData, _fields: (None, None, None, None, None, None), _type: ::core::marker::PhantomData, } } } impl< S: jacquard_common::BosStr, St: label_value_definition_state::State, > LabelValueDefinitionBuilder { /// Set the `adultOnly` field (optional) pub fn adult_only(mut self, value: impl Into>) -> Self { self._fields.0 = value.into(); self } /// Set the `adultOnly` field to an Option value (optional) pub fn maybe_adult_only(mut self, value: Option) -> Self { self._fields.0 = value; self } } impl LabelValueDefinitionBuilder where St: label_value_definition_state::State, St::Blurs: label_value_definition_state::IsUnset, { /// Set the `blurs` field (required) pub fn blurs( mut self, value: impl Into>, ) -> LabelValueDefinitionBuilder> { self._fields.1 = ::core::option::Option::Some(value.into()); LabelValueDefinitionBuilder { _state: ::core::marker::PhantomData, _fields: self._fields, _type: ::core::marker::PhantomData, } } } impl< S: jacquard_common::BosStr, St: label_value_definition_state::State, > LabelValueDefinitionBuilder { /// Set the `defaultSetting` field (optional) pub fn default_setting( mut self, value: impl Into>>, ) -> Self { self._fields.2 = value.into(); self } /// Set the `defaultSetting` field to an Option value (optional) pub fn maybe_default_setting( mut self, value: Option>, ) -> Self { self._fields.2 = value; self } } impl LabelValueDefinitionBuilder where St: label_value_definition_state::State, St::Identifier: label_value_definition_state::IsUnset, { /// Set the `identifier` field (required) pub fn identifier( mut self, value: impl Into, ) -> LabelValueDefinitionBuilder< S, label_value_definition_state::SetIdentifier, > { self._fields.3 = ::core::option::Option::Some(value.into()); LabelValueDefinitionBuilder { _state: ::core::marker::PhantomData, _fields: self._fields, _type: ::core::marker::PhantomData, } } } impl LabelValueDefinitionBuilder where St: label_value_definition_state::State, St::Locales: label_value_definition_state::IsUnset, { /// Set the `locales` field (required) pub fn locales( mut self, value: impl Into< Vec>, >, ) -> LabelValueDefinitionBuilder> { self._fields.4 = ::core::option::Option::Some(value.into()); LabelValueDefinitionBuilder { _state: ::core::marker::PhantomData, _fields: self._fields, _type: ::core::marker::PhantomData, } } } impl LabelValueDefinitionBuilder where St: label_value_definition_state::State, St::Severity: label_value_definition_state::IsUnset, { /// Set the `severity` field (required) pub fn severity( mut self, value: impl Into>, ) -> LabelValueDefinitionBuilder> { self._fields.5 = ::core::option::Option::Some(value.into()); LabelValueDefinitionBuilder { _state: ::core::marker::PhantomData, _fields: self._fields, _type: ::core::marker::PhantomData, } } } impl LabelValueDefinitionBuilder where St: label_value_definition_state::State, St::Identifier: label_value_definition_state::IsSet, St::Blurs: label_value_definition_state::IsSet, St::Locales: label_value_definition_state::IsSet, St::Severity: label_value_definition_state::IsSet, { /// Build the final struct. pub fn build(self) -> LabelValueDefinition { LabelValueDefinition { adult_only: self._fields.0, blurs: self._fields.1.unwrap(), default_setting: self._fields.2, identifier: self._fields.3.unwrap(), locales: self._fields.4.unwrap(), severity: self._fields.5.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: alloc::collections::BTreeMap< jacquard_common::deps::smol_str::SmolStr, jacquard_common::types::value::Data, >, ) -> LabelValueDefinition { LabelValueDefinition { adult_only: self._fields.0, blurs: self._fields.1.unwrap(), default_setting: self._fields.2, identifier: self._fields.3.unwrap(), locales: self._fields.4.unwrap(), severity: self._fields.5.unwrap(), extra_data: Some(extra_data), } } } pub mod label_value_definition_strings_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 Name; type Lang; type Description; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Name = Unset; type Lang = Unset; type Description = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { type Name = Set; type Lang = St::Lang; type Description = St::Description; } ///State transition - sets the `lang` field to Set pub struct SetLang(PhantomData St>); impl sealed::Sealed for SetLang {} impl State for SetLang { type Name = St::Name; type Lang = Set; type Description = St::Description; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData St>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { type Name = St::Name; type Lang = St::Lang; type Description = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `name` field pub struct name(()); ///Marker type for the `lang` field pub struct lang(()); ///Marker type for the `description` field pub struct description(()); } } /// Builder for constructing an instance of this type. pub struct LabelValueDefinitionStringsBuilder< S: jacquard_common::BosStr, St: label_value_definition_strings_state::State, > { _state: ::core::marker::PhantomData St>, _fields: ( core::option::Option, core::option::Option, core::option::Option, ), _type: ::core::marker::PhantomData S>, } impl LabelValueDefinitionStrings { /// Create a new builder for this type. pub fn new() -> LabelValueDefinitionStringsBuilder< S, label_value_definition_strings_state::Empty, > { LabelValueDefinitionStringsBuilder::new() } } impl< S: jacquard_common::BosStr, > LabelValueDefinitionStringsBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { LabelValueDefinitionStringsBuilder { _state: ::core::marker::PhantomData, _fields: (None, None, None), _type: ::core::marker::PhantomData, } } } impl LabelValueDefinitionStringsBuilder where St: label_value_definition_strings_state::State, St::Description: label_value_definition_strings_state::IsUnset, { /// Set the `description` field (required) pub fn description( mut self, value: impl Into, ) -> LabelValueDefinitionStringsBuilder< S, label_value_definition_strings_state::SetDescription, > { self._fields.0 = ::core::option::Option::Some(value.into()); LabelValueDefinitionStringsBuilder { _state: ::core::marker::PhantomData, _fields: self._fields, _type: ::core::marker::PhantomData, } } } impl LabelValueDefinitionStringsBuilder where St: label_value_definition_strings_state::State, St::Lang: label_value_definition_strings_state::IsUnset, { /// Set the `lang` field (required) pub fn lang( mut self, value: impl Into, ) -> LabelValueDefinitionStringsBuilder< S, label_value_definition_strings_state::SetLang, > { self._fields.1 = ::core::option::Option::Some(value.into()); LabelValueDefinitionStringsBuilder { _state: ::core::marker::PhantomData, _fields: self._fields, _type: ::core::marker::PhantomData, } } } impl LabelValueDefinitionStringsBuilder where St: label_value_definition_strings_state::State, St::Name: label_value_definition_strings_state::IsUnset, { /// Set the `name` field (required) pub fn name( mut self, value: impl Into, ) -> LabelValueDefinitionStringsBuilder< S, label_value_definition_strings_state::SetName, > { self._fields.2 = ::core::option::Option::Some(value.into()); LabelValueDefinitionStringsBuilder { _state: ::core::marker::PhantomData, _fields: self._fields, _type: ::core::marker::PhantomData, } } } impl LabelValueDefinitionStringsBuilder where St: label_value_definition_strings_state::State, St::Name: label_value_definition_strings_state::IsSet, St::Lang: label_value_definition_strings_state::IsSet, St::Description: label_value_definition_strings_state::IsSet, { /// Build the final struct. pub fn build(self) -> LabelValueDefinitionStrings { LabelValueDefinitionStrings { description: self._fields.0.unwrap(), lang: self._fields.1.unwrap(), name: self._fields.2.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: alloc::collections::BTreeMap< jacquard_common::deps::smol_str::SmolStr, jacquard_common::types::value::Data, >, ) -> LabelValueDefinitionStrings { LabelValueDefinitionStrings { description: self._fields.0.unwrap(), lang: self._fields.1.unwrap(), name: self._fields.2.unwrap(), extra_data: Some(extra_data), } } } pub mod self_labels_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 Values; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Values = Unset; } ///State transition - sets the `values` field to Set pub struct SetValues(PhantomData St>); impl sealed::Sealed for SetValues {} impl State for SetValues { type Values = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `values` field pub struct values(()); } } /// Builder for constructing an instance of this type. pub struct SelfLabelsBuilder { _state: ::core::marker::PhantomData St>, _fields: ( core::option::Option>>, ), _type: ::core::marker::PhantomData S>, } impl SelfLabels { /// Create a new builder for this type. pub fn new() -> SelfLabelsBuilder { SelfLabelsBuilder::new() } } impl SelfLabelsBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { SelfLabelsBuilder { _state: ::core::marker::PhantomData, _fields: (None,), _type: ::core::marker::PhantomData, } } } impl SelfLabelsBuilder where St: self_labels_state::State, St::Values: self_labels_state::IsUnset, { /// Set the `values` field (required) pub fn values( mut self, value: impl Into>>, ) -> SelfLabelsBuilder> { self._fields.0 = ::core::option::Option::Some(value.into()); SelfLabelsBuilder { _state: ::core::marker::PhantomData, _fields: self._fields, _type: ::core::marker::PhantomData, } } } impl SelfLabelsBuilder where St: self_labels_state::State, St::Values: self_labels_state::IsSet, { /// Build the final struct. pub fn build(self) -> SelfLabels { SelfLabels { values: self._fields.0.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: alloc::collections::BTreeMap< jacquard_common::deps::smol_str::SmolStr, jacquard_common::types::value::Data, >, ) -> SelfLabels { SelfLabels { values: self._fields.0.unwrap(), extra_data: Some(extra_data), } } }