#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{BosStr, CowStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid, Datetime, Nsid};
use jacquard_common::types::uri::{RecordUri, UriError};
use jacquard_common::types::value::Data;
use jacquard_common::xrpc::XrpcResp;
use jacquard_derive::{IntoStatic, lexicon, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
use crate::community_lexicon::preference::ai;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct CollectionScope<S: BosStr = DefaultStr> {
pub collection: Nsid<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct EntityScope<S: BosStr = DefaultStr> {
pub entity: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct GlobalScope<S: BosStr = DefaultStr> {
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
rename = "community.lexicon.preference.ai",
tag = "$type",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Ai<S: BosStr = DefaultStr> {
pub preferences: ai::PreferenceSet<S>,
pub scope: AiScope<S>,
pub updated_at: Datetime,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum AiScope<S: BosStr = DefaultStr> {
#[serde(rename = "community.lexicon.preference.ai#globalScope")]
GlobalScope(Box<ai::GlobalScope<S>>),
#[serde(rename = "community.lexicon.preference.ai#entityScope")]
EntityScope(Box<ai::EntityScope<S>>),
#[serde(rename = "community.lexicon.preference.ai#collectionScope")]
CollectionScope(Box<ai::CollectionScope<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct AiGetRecordOutput<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
pub uri: AtUri<S>,
pub value: Ai<S>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Preference<S: BosStr = DefaultStr> {
pub allow: bool,
pub updated_at: Datetime,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct PreferenceSet<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub embedding: Option<ai::Preference<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub inference: Option<ai::Preference<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub synthetic_content: Option<ai::Preference<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub training: Option<ai::Preference<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> Ai<S> {
pub fn uri(uri: S) -> Result<RecordUri<S, AiRecord>, UriError> {
RecordUri::try_from_uri(AtUri::new(uri)?)
}
}
impl<S: BosStr> LexiconSchema for CollectionScope<S> {
fn nsid() -> &'static str {
"community.lexicon.preference.ai"
}
fn def_name() -> &'static str {
"collectionScope"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_community_lexicon_preference_ai()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for EntityScope<S> {
fn nsid() -> &'static str {
"community.lexicon.preference.ai"
}
fn def_name() -> &'static str {
"entityScope"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_community_lexicon_preference_ai()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for GlobalScope<S> {
fn nsid() -> &'static str {
"community.lexicon.preference.ai"
}
fn def_name() -> &'static str {
"globalScope"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_community_lexicon_preference_ai()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AiRecord;
impl XrpcResp for AiRecord {
const NSID: &'static str = "community.lexicon.preference.ai";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = AiGetRecordOutput<S>;
type Err = RecordError;
}
impl<S: BosStr> From<AiGetRecordOutput<S>> for Ai<S> {
fn from(output: AiGetRecordOutput<S>) -> Self {
output.value
}
}
impl<S: BosStr> Collection for Ai<S> {
const NSID: &'static str = "community.lexicon.preference.ai";
type Record = AiRecord;
}
impl Collection for AiRecord {
const NSID: &'static str = "community.lexicon.preference.ai";
type Record = AiRecord;
}
impl<S: BosStr> LexiconSchema for Ai<S> {
fn nsid() -> &'static str {
"community.lexicon.preference.ai"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_community_lexicon_preference_ai()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Preference<S> {
fn nsid() -> &'static str {
"community.lexicon.preference.ai"
}
fn def_name() -> &'static str {
"preference"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_community_lexicon_preference_ai()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for PreferenceSet<S> {
fn nsid() -> &'static str {
"community.lexicon.preference.ai"
}
fn def_name() -> &'static str {
"preferenceSet"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_community_lexicon_preference_ai()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub mod collection_scope_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Collection;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Collection = Unset;
}
pub struct SetCollection<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCollection<St> {}
impl<St: State> State for SetCollection<St> {
type Collection = Set<members::collection>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct collection(());
}
}
pub struct CollectionScopeBuilder<St: collection_scope_state::State, S: BosStr = DefaultStr> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Nsid<S>>,),
_type: PhantomData<fn() -> S>,
}
impl CollectionScope<DefaultStr> {
pub fn new() -> CollectionScopeBuilder<collection_scope_state::Empty, DefaultStr> {
CollectionScopeBuilder::new()
}
}
impl<S: BosStr> CollectionScope<S> {
pub fn builder() -> CollectionScopeBuilder<collection_scope_state::Empty, S> {
CollectionScopeBuilder::builder()
}
}
impl CollectionScopeBuilder<collection_scope_state::Empty, DefaultStr> {
pub fn new() -> Self {
CollectionScopeBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr> CollectionScopeBuilder<collection_scope_state::Empty, S> {
pub fn builder() -> Self {
CollectionScopeBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<St, S: BosStr> CollectionScopeBuilder<St, S>
where
St: collection_scope_state::State,
St::Collection: collection_scope_state::IsUnset,
{
pub fn collection(
mut self,
value: impl Into<Nsid<S>>,
) -> CollectionScopeBuilder<collection_scope_state::SetCollection<St>, S> {
self._fields.0 = Option::Some(value.into());
CollectionScopeBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> CollectionScopeBuilder<St, S>
where
St: collection_scope_state::State,
St::Collection: collection_scope_state::IsSet,
{
pub fn build(self) -> CollectionScope<S> {
CollectionScope {
collection: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> CollectionScope<S> {
CollectionScope {
collection: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_community_lexicon_preference_ai() -> LexiconDoc<'static> {
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("community.lexicon.preference.ai"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("collectionScope"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Scopes preferences to a specific record collection in the user's repository.",
),
),
required: Some(vec![SmolStr::new_static("collection")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("collection"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"NSID of the collection this override applies to.",
),
),
format: Some(LexStringFormat::Nsid),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("entityScope"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"Scopes preferences to a specific AI consumer.",
)),
required: Some(vec![SmolStr::new_static("entity")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("entity"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"DID or domain of the entity this override applies to.",
)),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("globalScope"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"Account-wide default. The record at key 'self' should carry this scope.",
)),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("main"),
LexUserType::Record(LexRecord {
key: Some(CowStr::new_static("any")),
record: LexRecordRecord::Object(LexObject {
required: Some(vec![
SmolStr::new_static("updatedAt"),
SmolStr::new_static("scope"),
SmolStr::new_static("preferences"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("preferences"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#preferenceSet"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("scope"),
LexObjectProperty::Union(LexRefUnion {
description: Some(CowStr::new_static(
"What this record's preferences apply to.",
)),
refs: vec![
CowStr::new_static("#globalScope"),
CowStr::new_static("#entityScope"),
CowStr::new_static("#collectionScope"),
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("updatedAt"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"Timestamp of the most recent change to this record.",
)),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("preference"),
LexUserType::Object(LexObject {
required: Some(vec![
SmolStr::new_static("allow"),
SmolStr::new_static("updatedAt"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("allow"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("updatedAt"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"When this specific preference was last changed.",
)),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("preferenceSet"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"A set of AI usage preferences. Omitted fields mean undefined (no declared preference).",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("embedding"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#preference"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("inference"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#preference"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("syntheticContent"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#preference"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("training"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#preference"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod ai_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Preferences;
type Scope;
type UpdatedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Preferences = Unset;
type Scope = Unset;
type UpdatedAt = Unset;
}
pub struct SetPreferences<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPreferences<St> {}
impl<St: State> State for SetPreferences<St> {
type Preferences = Set<members::preferences>;
type Scope = St::Scope;
type UpdatedAt = St::UpdatedAt;
}
pub struct SetScope<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetScope<St> {}
impl<St: State> State for SetScope<St> {
type Preferences = St::Preferences;
type Scope = Set<members::scope>;
type UpdatedAt = St::UpdatedAt;
}
pub struct SetUpdatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUpdatedAt<St> {}
impl<St: State> State for SetUpdatedAt<St> {
type Preferences = St::Preferences;
type Scope = St::Scope;
type UpdatedAt = Set<members::updated_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct preferences(());
pub struct scope(());
pub struct updated_at(());
}
}
pub struct AiBuilder<St: ai_state::State, S: BosStr = DefaultStr> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<ai::PreferenceSet<S>>,
Option<AiScope<S>>,
Option<Datetime>,
),
_type: PhantomData<fn() -> S>,
}
impl Ai<DefaultStr> {
pub fn new() -> AiBuilder<ai_state::Empty, DefaultStr> {
AiBuilder::new()
}
}
impl<S: BosStr> Ai<S> {
pub fn builder() -> AiBuilder<ai_state::Empty, S> {
AiBuilder::builder()
}
}
impl AiBuilder<ai_state::Empty, DefaultStr> {
pub fn new() -> Self {
AiBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr> AiBuilder<ai_state::Empty, S> {
pub fn builder() -> Self {
AiBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<St, S: BosStr> AiBuilder<St, S>
where
St: ai_state::State,
St::Preferences: ai_state::IsUnset,
{
pub fn preferences(
mut self,
value: impl Into<ai::PreferenceSet<S>>,
) -> AiBuilder<ai_state::SetPreferences<St>, S> {
self._fields.0 = Option::Some(value.into());
AiBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> AiBuilder<St, S>
where
St: ai_state::State,
St::Scope: ai_state::IsUnset,
{
pub fn scope(mut self, value: impl Into<AiScope<S>>) -> AiBuilder<ai_state::SetScope<St>, S> {
self._fields.1 = Option::Some(value.into());
AiBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> AiBuilder<St, S>
where
St: ai_state::State,
St::UpdatedAt: ai_state::IsUnset,
{
pub fn updated_at(
mut self,
value: impl Into<Datetime>,
) -> AiBuilder<ai_state::SetUpdatedAt<St>, S> {
self._fields.2 = Option::Some(value.into());
AiBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> AiBuilder<St, S>
where
St: ai_state::State,
St::Preferences: ai_state::IsSet,
St::Scope: ai_state::IsSet,
St::UpdatedAt: ai_state::IsSet,
{
pub fn build(self) -> Ai<S> {
Ai {
preferences: self._fields.0.unwrap(),
scope: self._fields.1.unwrap(),
updated_at: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Ai<S> {
Ai {
preferences: self._fields.0.unwrap(),
scope: self._fields.1.unwrap(),
updated_at: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod preference_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Allow;
type UpdatedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Allow = Unset;
type UpdatedAt = Unset;
}
pub struct SetAllow<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetAllow<St> {}
impl<St: State> State for SetAllow<St> {
type Allow = Set<members::allow>;
type UpdatedAt = St::UpdatedAt;
}
pub struct SetUpdatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUpdatedAt<St> {}
impl<St: State> State for SetUpdatedAt<St> {
type Allow = St::Allow;
type UpdatedAt = Set<members::updated_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct allow(());
pub struct updated_at(());
}
}
pub struct PreferenceBuilder<St: preference_state::State, S: BosStr = DefaultStr> {
_state: PhantomData<fn() -> St>,
_fields: (Option<bool>, Option<Datetime>),
_type: PhantomData<fn() -> S>,
}
impl Preference<DefaultStr> {
pub fn new() -> PreferenceBuilder<preference_state::Empty, DefaultStr> {
PreferenceBuilder::new()
}
}
impl<S: BosStr> Preference<S> {
pub fn builder() -> PreferenceBuilder<preference_state::Empty, S> {
PreferenceBuilder::builder()
}
}
impl PreferenceBuilder<preference_state::Empty, DefaultStr> {
pub fn new() -> Self {
PreferenceBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr> PreferenceBuilder<preference_state::Empty, S> {
pub fn builder() -> Self {
PreferenceBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<St, S: BosStr> PreferenceBuilder<St, S>
where
St: preference_state::State,
St::Allow: preference_state::IsUnset,
{
pub fn allow(
mut self,
value: impl Into<bool>,
) -> PreferenceBuilder<preference_state::SetAllow<St>, S> {
self._fields.0 = Option::Some(value.into());
PreferenceBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> PreferenceBuilder<St, S>
where
St: preference_state::State,
St::UpdatedAt: preference_state::IsUnset,
{
pub fn updated_at(
mut self,
value: impl Into<Datetime>,
) -> PreferenceBuilder<preference_state::SetUpdatedAt<St>, S> {
self._fields.1 = Option::Some(value.into());
PreferenceBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> PreferenceBuilder<St, S>
where
St: preference_state::State,
St::Allow: preference_state::IsSet,
St::UpdatedAt: preference_state::IsSet,
{
pub fn build(self) -> Preference<S> {
Preference {
allow: self._fields.0.unwrap(),
updated_at: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Preference<S> {
Preference {
allow: self._fields.0.unwrap(),
updated_at: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}