// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: space.polymodel.library.defs // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. //! Generated bindings for the `space.polymodel.library` Lexicon namespace/module. pub mod delete_thing; pub mod get_author_things; pub mod get_feed; pub mod get_model; pub mod get_model_load_bundle; pub mod get_part_file; pub mod get_thing; pub mod model; pub mod part; pub mod publish_thing; pub mod search_things; pub mod stage_file; pub mod thing; pub mod update_thing; #[allow(unused_imports)] use alloc::collections::BTreeMap; #[allow(unused_imports)] use core::marker::PhantomData; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::bytes::Bytes; #[allow(unused_imports)] use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::blob::BlobRef; use jacquard_common::types::string::{Did, Handle, AtUri, Cid, Datetime, UriValue}; use jacquard_common::types::value::Data; use jacquard_derive::IntoStatic; use jacquard_lexicon::lexicon::LexiconDoc; use jacquard_lexicon::schema::LexiconSchema; #[allow(unused_imports)] use jacquard_lexicon::validation::{ConstraintError, ValidationPath}; use serde::{Serialize, Deserialize}; use crate::com_atproto::repo::strong_ref::StrongRef; use crate::space_polymodel::library; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct Actor { ///Avatar image URL resolved by the app view (CDN). #[serde(skip_serializing_if = "Option::is_none")] pub avatar: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, pub did: Did, #[serde(skip_serializing_if = "Option::is_none")] pub display_name: Option, #[serde(skip_serializing_if = "Option::is_none")] pub follower_count: Option, #[serde(skip_serializing_if = "Option::is_none")] pub following_count: Option, pub handle: Handle, ///Hydrated profile pronouns for bylines and cards. #[serde(skip_serializing_if = "Option::is_none")] pub pronouns: Option, ///Count of published Polymodel things by this actor. #[serde(skip_serializing_if = "Option::is_none")] pub thing_count: Option, #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } /// Detailed hydrated actor/profile view for profile surfaces, modeled after app.bsky.actor profile view splits. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ActorViewDetailed { ///Avatar image URL resolved by the app view (CDN). #[serde(skip_serializing_if = "Option::is_none")] pub avatar: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub default_license: Option, #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, pub did: Did, #[serde(skip_serializing_if = "Option::is_none")] pub display_name: Option, #[serde(skip_serializing_if = "Option::is_none")] pub follower_count: Option, #[serde(skip_serializing_if = "Option::is_none")] pub following_count: Option, pub handle: Handle, pub indexed_at: Datetime, #[serde(skip_serializing_if = "Option::is_none")] pub links: Option>>, #[serde(skip_serializing_if = "Option::is_none")] pub printers: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub pronouns: Option, pub record: Data, ///Count of published Polymodel things by this actor. #[serde(skip_serializing_if = "Option::is_none")] pub thing_count: Option, pub viewer: library::ActorViewerState, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } /// Viewer-specific relationship state for an actor/profile. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ActorViewerState { #[serde(skip_serializing_if = "Option::is_none")] pub blocked_by: Option, ///Block record URI if the requester blocks this actor. #[serde(skip_serializing_if = "Option::is_none")] pub blocking: Option>, ///Follow record URI if this actor follows the requester. #[serde(skip_serializing_if = "Option::is_none")] pub followed_by: Option>, ///Follow record URI if the requester follows this actor. #[serde(skip_serializing_if = "Option::is_none")] pub following: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub muted: Option, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } /// Width:height aspect ratio of an image, for layout before the blob loads. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct AspectRatio { pub height: i64, pub width: i64, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } /// Axis-aligned bounding-box dimensions. ATProto has no float type, so x/y/z are decimal strings (e.g. 12.5) parsed to floats internally. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct Bbox { #[serde(skip_serializing_if = "Option::is_none")] pub unit: Option, pub x: S, pub y: S, pub z: S, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct Chunk { pub blob: BlobRef, pub offset: i64, pub size: i64, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } pub type Cover = Vec>; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct FeedItem { pub thing: library::ThingViewBasic, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct FeedView { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub items: Vec>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } /// Chunk-capable geometry manifest. Reassemble by concatenating chunks in offset order. Per-chunk integrity is the blob CID; offset+size make ordering explicit; digest verifies the fully reassembled file. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct File { pub chunks: Vec>, ///sha256 digest of the fully reassembled file #[serde(skip_serializing_if = "Option::is_none")] #[serde(default, with = "jacquard_common::opt_serde_bytes_helper")] pub digest: Option, pub mime_type: S, ///size in bytes of the fully reassembled file pub size: i64, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } /// An authored image: a blob plus alt text and aspect ratio. Stored on records; the app view resolves it to #imageView. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct Image { ///Alt text describing the image, for accessibility. pub alt: S, pub aspect_ratio: library::AspectRatio, pub image: BlobRef, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } /// A resolved image view: CDN URLs for thumbnail and full size plus aspect ratio. Currently resolved via Bluesky's CDN by the app view. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ImageView { #[serde(skip_serializing_if = "Option::is_none")] pub alt: Option, #[serde(skip_serializing_if = "Option::is_none")] pub aspect_ratio: Option>, ///Fully-qualified full-size URL (CDN, resolved by the app view). pub fullsize: UriValue, ///Fully-qualified thumbnail URL (CDN, resolved by the app view). pub thumb: UriValue, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } pub type Instructions = Vec; pub type IntendedToWorkWith = Vec>; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ModelView { pub author: library::Actor, pub cid: Cid, #[serde(skip_serializing_if = "Option::is_none")] pub cover: Option>>, pub indexed_at: Datetime, pub name: S, pub part_count: i64, #[serde(skip_serializing_if = "Option::is_none")] pub previews: Option>>, pub record: Data, #[serde(skip_serializing_if = "Option::is_none")] pub summary: Option, pub uri: AtUri, pub viewer: library::ViewerState, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } pub type Name = S; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct PartView { pub author: library::Actor, pub cid: Cid, pub file: library::File, #[serde(skip_serializing_if = "Option::is_none")] pub format: Option, pub indexed_at: Datetime, pub name: S, #[serde(skip_serializing_if = "Option::is_none")] pub previews: Option>>, pub record: Data, pub uri: AtUri, pub viewer: library::ViewerState, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } pub type Previews = Vec>; pub type PrintSettings = Vec; pub type SearchQuery = S; pub type ShortText = S; pub type Tag = S; pub type Tags = Vec>; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ThingView { pub author: library::Actor, pub cid: Cid, #[serde(skip_serializing_if = "Option::is_none")] pub cover: Option>>, #[serde(skip_serializing_if = "Option::is_none")] pub derived_from: Option>, pub indexed_at: Datetime, #[serde(skip_serializing_if = "Option::is_none")] pub intended_to_work_with: Option>>, pub license: S, pub like_count: i64, pub model_count: i64, pub name: S, ///Thing-level aggregate count of parts across included models, computed by the app view. pub part_count: i64, #[serde(skip_serializing_if = "Option::is_none")] pub previews: Option>>, pub record: Data, pub save_count: i64, #[serde(skip_serializing_if = "Option::is_none")] pub summary: Option, ///Hydrated display tags, including appview-aggregated external tag assertions. #[serde(skip_serializing_if = "Option::is_none")] pub tags: Option>, pub uri: AtUri, pub viewer: library::ViewerState, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ThingViewBasic { pub author: library::Actor, pub cid: Cid, #[serde(skip_serializing_if = "Option::is_none")] pub cover: Option>>, pub indexed_at: Datetime, pub like_count: i64, pub model_count: i64, pub name: S, ///Thing-level aggregate count of parts across included models, computed by the app view. pub part_count: i64, #[serde(skip_serializing_if = "Option::is_none")] pub previews: Option>>, pub save_count: i64, ///Hydrated display tags for browse/search/profile cards, including appview-aggregated external tag assertions. #[serde(skip_serializing_if = "Option::is_none")] pub tags: Option>, pub uri: AtUri, pub viewer: library::ViewerState, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ViewerState { #[serde(skip_serializing_if = "Option::is_none")] pub like: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub save: Option>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } /// Reference-only shared field set; fields are inlined on thing/model. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct WorkMeta { #[serde(skip_serializing_if = "Option::is_none")] pub cover: Option>>, #[serde(skip_serializing_if = "Option::is_none")] pub derived_from: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub instructions: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub intended_to_work_with: Option>>, #[serde(skip_serializing_if = "Option::is_none")] pub license: Option, #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, #[serde(skip_serializing_if = "Option::is_none")] pub previews: Option>>, #[serde(skip_serializing_if = "Option::is_none")] pub summary: Option, #[serde(skip_serializing_if = "Option::is_none")] pub tags: Option>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } impl LexiconSchema for Actor { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "actor" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for ActorViewDetailed { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "actorViewDetailed" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for ActorViewerState { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "actorViewerState" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for AspectRatio { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "aspectRatio" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for Bbox { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "bbox" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for Chunk { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "chunk" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { { let value = &self.blob; { let size = value.blob().size; if size > 104857600usize { return Err(ConstraintError::BlobTooLarge { path: ValidationPath::from_field("blob"), max: 104857600usize, actual: size, }); } } } { let value = &self.blob; { let mime = value.blob().mime_type.as_str(); let accepted: &[&str] = &[ "model/stl", "model/3mf", "model/obj", "model/gltf+json", "model/gltf-binary", "application/x-ldraw", "model/ldraw", "application/octet-stream", "model/step", "application/step", ]; let matched = accepted .iter() .any(|pattern| { if *pattern == "*/*" { true } else if pattern.ends_with("/*") { let prefix = &pattern[..pattern.len() - 2]; mime.starts_with(prefix) && mime.as_bytes().get(prefix.len()) == Some(&b'/') } else { mime == *pattern } }); if !matched { return Err(ConstraintError::BlobMimeTypeNotAccepted { path: ValidationPath::from_field("blob"), accepted: vec![ "model/stl".to_string(), "model/3mf".to_string(), "model/obj" .to_string(), "model/gltf+json".to_string(), "model/gltf-binary".to_string(), "application/x-ldraw" .to_string(), "model/ldraw".to_string(), "application/octet-stream".to_string(), "model/step" .to_string(), "application/step".to_string() ], actual: mime.to_string(), }); } } } { let value = &self.offset; if *value < 0i64 { return Err(ConstraintError::Minimum { path: ValidationPath::from_field("offset"), min: 0i64, actual: *value, }); } } { let value = &self.size; if *value < 0i64 { return Err(ConstraintError::Minimum { path: ValidationPath::from_field("size"), min: 0i64, actual: *value, }); } } Ok(()) } } impl LexiconSchema for FeedItem { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "feedItem" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for FeedView { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "feedView" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for File { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "file" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { { let value = &self.chunks; #[allow(unused_comparisons)] if value.len() > 4096usize { return Err(ConstraintError::MaxLength { path: ValidationPath::from_field("chunks"), max: 4096usize, actual: value.len(), }); } } Ok(()) } } impl LexiconSchema for Image { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "image" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { { let value = &self.alt; #[allow(unused_comparisons)] if ::len(value.as_ref()) > 10000usize { return Err(ConstraintError::MaxLength { path: ValidationPath::from_field("alt"), max: 10000usize, actual: ::len(value.as_ref()), }); } } { let value = &self.alt; { let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count(); if count > 2000usize { return Err(ConstraintError::MaxGraphemes { path: ValidationPath::from_field("alt"), max: 2000usize, actual: count, }); } } } { let value = &self.image; { let size = value.blob().size; if size > 5242880usize { return Err(ConstraintError::BlobTooLarge { path: ValidationPath::from_field("image"), max: 5242880usize, actual: size, }); } } } { let value = &self.image; { let mime = value.blob().mime_type.as_str(); let accepted: &[&str] = &["image/png", "image/jpeg", "image/webp"]; let matched = accepted .iter() .any(|pattern| { if *pattern == "*/*" { true } else if pattern.ends_with("/*") { let prefix = &pattern[..pattern.len() - 2]; mime.starts_with(prefix) && mime.as_bytes().get(prefix.len()) == Some(&b'/') } else { mime == *pattern } }); if !matched { return Err(ConstraintError::BlobMimeTypeNotAccepted { path: ValidationPath::from_field("image"), accepted: vec![ "image/png".to_string(), "image/jpeg".to_string(), "image/webp".to_string() ], actual: mime.to_string(), }); } } } Ok(()) } } impl LexiconSchema for ImageView { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "imageView" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for ModelView { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "modelView" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for PartView { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "partView" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for ThingView { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "thingView" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for ThingViewBasic { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "thingViewBasic" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for ViewerState { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "viewerState" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } impl LexiconSchema for WorkMeta { fn nsid() -> &'static str { "space.polymodel.library.defs" } fn def_name() -> &'static str { "workMeta" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_space_polymodel_library_defs() } fn validate(&self) -> Result<(), ConstraintError> { Ok(()) } } pub mod actor_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 Did; type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; type Handle = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; type Handle = St::Handle; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData St>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { type Did = St::Did; type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `did` field pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); } } /// Builder for constructing an instance of this type. pub struct ActorBuilder { _state: PhantomData St>, _fields: ( Option>, Option, Option>, Option, Option, Option, Option>, Option, Option, Option>, ), _type: PhantomData S>, } impl Actor { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ActorBuilder { ActorBuilder::new() } } impl Actor { /// Create a new builder for this type pub fn builder() -> ActorBuilder { ActorBuilder::builder() } } impl ActorBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { ActorBuilder { _state: PhantomData, _fields: (None, None, None, None, None, None, None, None, None, None), _type: PhantomData, } } } impl ActorBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { ActorBuilder { _state: PhantomData, _fields: (None, None, None, None, None, None, None, None, None, None), _type: PhantomData, } } } impl ActorBuilder { /// Set the `avatar` field (optional) pub fn avatar(mut self, value: impl Into>>) -> Self { self._fields.0 = value.into(); self } /// Set the `avatar` field to an Option value (optional) pub fn maybe_avatar(mut self, value: Option>) -> Self { self._fields.0 = value; self } } impl ActorBuilder { /// Set the `description` field (optional) pub fn description(mut self, value: impl Into>) -> Self { self._fields.1 = value.into(); self } /// Set the `description` field to an Option value (optional) pub fn maybe_description(mut self, value: Option) -> Self { self._fields.1 = value; self } } impl ActorBuilder where St: actor_state::State, St::Did: actor_state::IsUnset, { /// Set the `did` field (required) pub fn did( mut self, value: impl Into>, ) -> ActorBuilder, S> { self._fields.2 = Option::Some(value.into()); ActorBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ActorBuilder { /// Set the `displayName` field (optional) pub fn display_name(mut self, value: impl Into>) -> Self { self._fields.3 = value.into(); self } /// Set the `displayName` field to an Option value (optional) pub fn maybe_display_name(mut self, value: Option) -> Self { self._fields.3 = value; self } } impl ActorBuilder { /// Set the `followerCount` field (optional) pub fn follower_count(mut self, value: impl Into>) -> Self { self._fields.4 = value.into(); self } /// Set the `followerCount` field to an Option value (optional) pub fn maybe_follower_count(mut self, value: Option) -> Self { self._fields.4 = value; self } } impl ActorBuilder { /// Set the `followingCount` field (optional) pub fn following_count(mut self, value: impl Into>) -> Self { self._fields.5 = value.into(); self } /// Set the `followingCount` field to an Option value (optional) pub fn maybe_following_count(mut self, value: Option) -> Self { self._fields.5 = value; self } } impl ActorBuilder where St: actor_state::State, St::Handle: actor_state::IsUnset, { /// Set the `handle` field (required) pub fn handle( mut self, value: impl Into>, ) -> ActorBuilder, S> { self._fields.6 = Option::Some(value.into()); ActorBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ActorBuilder { /// Set the `pronouns` field (optional) pub fn pronouns(mut self, value: impl Into>) -> Self { self._fields.7 = value.into(); self } /// Set the `pronouns` field to an Option value (optional) pub fn maybe_pronouns(mut self, value: Option) -> Self { self._fields.7 = value; self } } impl ActorBuilder { /// Set the `thingCount` field (optional) pub fn thing_count(mut self, value: impl Into>) -> Self { self._fields.8 = value.into(); self } /// Set the `thingCount` field to an Option value (optional) pub fn maybe_thing_count(mut self, value: Option) -> Self { self._fields.8 = value; self } } impl ActorBuilder { /// Set the `viewer` field (optional) pub fn viewer( mut self, value: impl Into>>, ) -> Self { self._fields.9 = value.into(); self } /// Set the `viewer` field to an Option value (optional) pub fn maybe_viewer(mut self, value: Option>) -> Self { self._fields.9 = value; self } } impl ActorBuilder where St: actor_state::State, St::Did: actor_state::IsSet, St::Handle: actor_state::IsSet, { /// Build the final struct. pub fn build(self) -> Actor { Actor { avatar: self._fields.0, description: self._fields.1, did: self._fields.2.unwrap(), display_name: self._fields.3, follower_count: self._fields.4, following_count: self._fields.5, handle: self._fields.6.unwrap(), pronouns: self._fields.7, thing_count: self._fields.8, viewer: self._fields.9, extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data(self, extra_data: BTreeMap>) -> Actor { Actor { avatar: self._fields.0, description: self._fields.1, did: self._fields.2.unwrap(), display_name: self._fields.3, follower_count: self._fields.4, following_count: self._fields.5, handle: self._fields.6.unwrap(), pronouns: self._fields.7, thing_count: self._fields.8, viewer: self._fields.9, extra_data: Some(extra_data), } } } fn lexicon_doc_space_polymodel_library_defs() -> LexiconDoc<'static> { #[allow(unused_imports)] use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType}; use jacquard_lexicon::lexicon::*; use alloc::collections::BTreeMap; LexiconDoc { lexicon: Lexicon::Lexicon1, id: CowStr::new_static("space.polymodel.library.defs"), defs: { let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("actor"), LexUserType::Object(LexObject { required: Some( vec![SmolStr::new_static("did"), SmolStr::new_static("handle")], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("avatar"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "Avatar image URL resolved by the app view (CDN).", ), ), format: Some(LexStringFormat::Uri), ..Default::default() }), ); map.insert( SmolStr::new_static("description"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("did"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Did), ..Default::default() }), ); map.insert( SmolStr::new_static("displayName"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("followerCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("followingCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("handle"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Handle), ..Default::default() }), ); map.insert( SmolStr::new_static("pronouns"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "Hydrated profile pronouns for bylines and cards.", ), ), ..Default::default() }), ); map.insert( SmolStr::new_static("thingCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("viewer"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#actorViewerState"), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("actorViewDetailed"), LexUserType::Object(LexObject { description: Some( CowStr::new_static( "Detailed hydrated actor/profile view for profile surfaces, modeled after app.bsky.actor profile view splits.", ), ), required: Some( vec![ SmolStr::new_static("did"), SmolStr::new_static("handle"), SmolStr::new_static("record"), SmolStr::new_static("indexedAt"), SmolStr::new_static("viewer") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("avatar"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "Avatar image URL resolved by the app view (CDN).", ), ), format: Some(LexStringFormat::Uri), ..Default::default() }), ); map.insert( SmolStr::new_static("defaultLicense"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("description"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("did"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Did), ..Default::default() }), ); map.insert( SmolStr::new_static("displayName"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("followerCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("followingCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("handle"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Handle), ..Default::default() }), ); map.insert( SmolStr::new_static("indexedAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("links"), LexObjectProperty::Array(LexArray { items: LexArrayItem::String(LexString { format: Some(LexStringFormat::Uri), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("printers"), LexObjectProperty::Array(LexArray { items: LexArrayItem::String(LexString { ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("pronouns"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("record"), LexObjectProperty::Unknown(LexUnknown { ..Default::default() }), ); map.insert( SmolStr::new_static("thingCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("viewer"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#actorViewerState"), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("actorViewerState"), LexUserType::Object(LexObject { description: Some( CowStr::new_static( "Viewer-specific relationship state for an actor/profile.", ), ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("blockedBy"), LexObjectProperty::Boolean(LexBoolean { ..Default::default() }), ); map.insert( SmolStr::new_static("blocking"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "Block record URI if the requester blocks this actor.", ), ), format: Some(LexStringFormat::AtUri), ..Default::default() }), ); map.insert( SmolStr::new_static("followedBy"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "Follow record URI if this actor follows the requester.", ), ), format: Some(LexStringFormat::AtUri), ..Default::default() }), ); map.insert( SmolStr::new_static("following"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "Follow record URI if the requester follows this actor.", ), ), format: Some(LexStringFormat::AtUri), ..Default::default() }), ); map.insert( SmolStr::new_static("muted"), LexObjectProperty::Boolean(LexBoolean { ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("aspectRatio"), LexUserType::Object(LexObject { description: Some( CowStr::new_static( "Width:height aspect ratio of an image, for layout before the blob loads.", ), ), required: Some( vec![SmolStr::new_static("width"), SmolStr::new_static("height")], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("height"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("width"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("bbox"), LexUserType::Object(LexObject { description: Some( CowStr::new_static( "Axis-aligned bounding-box dimensions. ATProto has no float type, so x/y/z are decimal strings (e.g. 12.5) parsed to floats internally.", ), ), required: Some( vec![ SmolStr::new_static("x"), SmolStr::new_static("y"), SmolStr::new_static("z") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("unit"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("x"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("y"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("z"), LexObjectProperty::String(LexString { ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("chunk"), LexUserType::Object(LexObject { required: Some( vec![ SmolStr::new_static("blob"), SmolStr::new_static("offset"), SmolStr::new_static("size") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("blob"), LexObjectProperty::Blob(LexBlob { ..Default::default() }), ); map.insert( SmolStr::new_static("offset"), LexObjectProperty::Integer(LexInteger { minimum: Some(0i64), ..Default::default() }), ); map.insert( SmolStr::new_static("size"), LexObjectProperty::Integer(LexInteger { minimum: Some(0i64), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("cover"), LexUserType::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#image"), ..Default::default() }), max_length: Some(8usize), ..Default::default() }), ); map.insert( SmolStr::new_static("feedItem"), LexUserType::Object(LexObject { required: Some(vec![SmolStr::new_static("thing")]), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("thing"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#thingViewBasic"), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("feedView"), LexUserType::Object(LexObject { required: Some(vec![SmolStr::new_static("items")]), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("cursor"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("items"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#feedItem"), ..Default::default() }), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("file"), LexUserType::Object(LexObject { description: Some( CowStr::new_static( "Chunk-capable geometry manifest. Reassemble by concatenating chunks in offset order. Per-chunk integrity is the blob CID; offset+size make ordering explicit; digest verifies the fully reassembled file.", ), ), required: Some( vec![ SmolStr::new_static("mimeType"), SmolStr::new_static("size"), SmolStr::new_static("chunks") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("chunks"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#chunk"), ..Default::default() }), max_length: Some(4096usize), ..Default::default() }), ); map.insert( SmolStr::new_static("digest"), LexObjectProperty::Bytes(LexBytes { ..Default::default() }), ); map.insert( SmolStr::new_static("mimeType"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("size"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("image"), LexUserType::Object(LexObject { description: Some( CowStr::new_static( "An authored image: a blob plus alt text and aspect ratio. Stored on records; the app view resolves it to #imageView.", ), ), required: Some( vec![ SmolStr::new_static("image"), SmolStr::new_static("alt"), SmolStr::new_static("aspectRatio") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("alt"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "Alt text describing the image, for accessibility.", ), ), max_length: Some(10000usize), max_graphemes: Some(2000usize), ..Default::default() }), ); map.insert( SmolStr::new_static("aspectRatio"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#aspectRatio"), ..Default::default() }), ); map.insert( SmolStr::new_static("image"), LexObjectProperty::Blob(LexBlob { ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("imageView"), LexUserType::Object(LexObject { description: Some( CowStr::new_static( "A resolved image view: CDN URLs for thumbnail and full size plus aspect ratio. Currently resolved via Bluesky's CDN by the app view.", ), ), required: Some( vec![ SmolStr::new_static("thumb"), SmolStr::new_static("fullsize") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("alt"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("aspectRatio"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#aspectRatio"), ..Default::default() }), ); map.insert( SmolStr::new_static("fullsize"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "Fully-qualified full-size URL (CDN, resolved by the app view).", ), ), format: Some(LexStringFormat::Uri), ..Default::default() }), ); map.insert( SmolStr::new_static("thumb"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( "Fully-qualified thumbnail URL (CDN, resolved by the app view).", ), ), format: Some(LexStringFormat::Uri), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("instructions"), LexUserType::Array(LexArray { items: LexArrayItem::String(LexString { ..Default::default() }), max_length: Some(100usize), ..Default::default() }), ); map.insert( SmolStr::new_static("intendedToWorkWith"), LexUserType::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("com.atproto.repo.strongRef"), ..Default::default() }), max_length: Some(32usize), ..Default::default() }), ); map.insert( SmolStr::new_static("modelView"), LexUserType::Object(LexObject { required: Some( vec![ SmolStr::new_static("uri"), SmolStr::new_static("cid"), SmolStr::new_static("author"), SmolStr::new_static("record"), SmolStr::new_static("indexedAt"), SmolStr::new_static("name"), SmolStr::new_static("partCount"), SmolStr::new_static("viewer") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("author"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#actor"), ..Default::default() }), ); map.insert( SmolStr::new_static("cid"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Cid), ..Default::default() }), ); map.insert( SmolStr::new_static("cover"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#imageView"), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("indexedAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("name"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("partCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("previews"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#imageView"), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("record"), LexObjectProperty::Unknown(LexUnknown { ..Default::default() }), ); map.insert( SmolStr::new_static("summary"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("uri"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::AtUri), ..Default::default() }), ); map.insert( SmolStr::new_static("viewer"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#viewerState"), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("name"), LexUserType::String(LexString { max_length: Some(1024usize), max_graphemes: Some(256usize), ..Default::default() }), ); map.insert( SmolStr::new_static("partView"), LexUserType::Object(LexObject { required: Some( vec![ SmolStr::new_static("uri"), SmolStr::new_static("cid"), SmolStr::new_static("author"), SmolStr::new_static("record"), SmolStr::new_static("indexedAt"), SmolStr::new_static("name"), SmolStr::new_static("file"), SmolStr::new_static("viewer") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("author"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#actor"), ..Default::default() }), ); map.insert( SmolStr::new_static("cid"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Cid), ..Default::default() }), ); map.insert( SmolStr::new_static("file"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#file"), ..Default::default() }), ); map.insert( SmolStr::new_static("format"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("indexedAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("name"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("previews"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#imageView"), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("record"), LexObjectProperty::Unknown(LexUnknown { ..Default::default() }), ); map.insert( SmolStr::new_static("uri"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::AtUri), ..Default::default() }), ); map.insert( SmolStr::new_static("viewer"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#viewerState"), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("previews"), LexUserType::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#image"), ..Default::default() }), max_length: Some(12usize), ..Default::default() }), ); map.insert( SmolStr::new_static("printSettings"), LexUserType::Array(LexArray { items: LexArrayItem::String(LexString { ..Default::default() }), max_length: Some(50usize), ..Default::default() }), ); map.insert( SmolStr::new_static("searchQuery"), LexUserType::String(LexString { max_length: Some(256usize), ..Default::default() }), ); map.insert( SmolStr::new_static("shortText"), LexUserType::String(LexString { max_length: Some(2000usize), max_graphemes: Some(300usize), ..Default::default() }), ); map.insert( SmolStr::new_static("tag"), LexUserType::String(LexString { max_length: Some(1024usize), max_graphemes: Some(256usize), ..Default::default() }), ); map.insert( SmolStr::new_static("tags"), LexUserType::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#tag"), ..Default::default() }), max_length: Some(16usize), ..Default::default() }), ); map.insert( SmolStr::new_static("thingView"), LexUserType::Object(LexObject { required: Some( vec![ SmolStr::new_static("uri"), SmolStr::new_static("cid"), SmolStr::new_static("author"), SmolStr::new_static("record"), SmolStr::new_static("indexedAt"), SmolStr::new_static("name"), SmolStr::new_static("license"), SmolStr::new_static("likeCount"), SmolStr::new_static("saveCount"), SmolStr::new_static("modelCount"), SmolStr::new_static("partCount"), SmolStr::new_static("viewer") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("author"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#actor"), ..Default::default() }), ); map.insert( SmolStr::new_static("cid"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Cid), ..Default::default() }), ); map.insert( SmolStr::new_static("cover"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#imageView"), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("derivedFrom"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("com.atproto.repo.strongRef"), ..Default::default() }), ); map.insert( SmolStr::new_static("indexedAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("intendedToWorkWith"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("com.atproto.repo.strongRef"), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("license"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("likeCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("modelCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("name"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("partCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("previews"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#imageView"), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("record"), LexObjectProperty::Unknown(LexUnknown { ..Default::default() }), ); map.insert( SmolStr::new_static("saveCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("summary"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("tags"), LexObjectProperty::Array(LexArray { description: Some( CowStr::new_static( "Hydrated display tags, including appview-aggregated external tag assertions.", ), ), items: LexArrayItem::String(LexString { ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("uri"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::AtUri), ..Default::default() }), ); map.insert( SmolStr::new_static("viewer"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#viewerState"), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("thingViewBasic"), LexUserType::Object(LexObject { required: Some( vec![ SmolStr::new_static("uri"), SmolStr::new_static("cid"), SmolStr::new_static("author"), SmolStr::new_static("name"), SmolStr::new_static("likeCount"), SmolStr::new_static("saveCount"), SmolStr::new_static("modelCount"), SmolStr::new_static("partCount"), SmolStr::new_static("indexedAt"), SmolStr::new_static("viewer") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("author"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#actor"), ..Default::default() }), ); map.insert( SmolStr::new_static("cid"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Cid), ..Default::default() }), ); map.insert( SmolStr::new_static("cover"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#imageView"), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("indexedAt"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( SmolStr::new_static("likeCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("modelCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("name"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("partCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("previews"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#imageView"), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("saveCount"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), ); map.insert( SmolStr::new_static("tags"), LexObjectProperty::Array(LexArray { description: Some( CowStr::new_static( "Hydrated display tags for browse/search/profile cards, including appview-aggregated external tag assertions.", ), ), items: LexArrayItem::String(LexString { ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("uri"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::AtUri), ..Default::default() }), ); map.insert( SmolStr::new_static("viewer"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("#viewerState"), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("viewerState"), LexUserType::Object(LexObject { properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("like"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::AtUri), ..Default::default() }), ); map.insert( SmolStr::new_static("save"), LexObjectProperty::String(LexString { format: Some(LexStringFormat::AtUri), ..Default::default() }), ); map }, ..Default::default() }), ); map.insert( SmolStr::new_static("workMeta"), LexUserType::Object(LexObject { description: Some( CowStr::new_static( "Reference-only shared field set; fields are inlined on thing/model.", ), ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( SmolStr::new_static("cover"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#image"), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("derivedFrom"), LexObjectProperty::Ref(LexRef { r#ref: CowStr::new_static("com.atproto.repo.strongRef"), ..Default::default() }), ); map.insert( SmolStr::new_static("instructions"), LexObjectProperty::Array(LexArray { items: LexArrayItem::String(LexString { ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("intendedToWorkWith"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("com.atproto.repo.strongRef"), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("license"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("name"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("previews"), LexObjectProperty::Array(LexArray { items: LexArrayItem::Ref(LexRef { r#ref: CowStr::new_static("#image"), ..Default::default() }), ..Default::default() }), ); map.insert( SmolStr::new_static("summary"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( SmolStr::new_static("tags"), LexObjectProperty::Array(LexArray { items: LexArrayItem::String(LexString { ..Default::default() }), ..Default::default() }), ); map }, ..Default::default() }), ); map }, ..Default::default() } } pub mod actor_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 Did; type Handle; type IndexedAt; type Record; type Viewer; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; type Handle = Unset; type IndexedAt = Unset; type Record = Unset; type Viewer = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; type Handle = St::Handle; type IndexedAt = St::IndexedAt; type Record = St::Record; type Viewer = St::Viewer; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData St>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { type Did = St::Did; type Handle = Set; type IndexedAt = St::IndexedAt; type Record = St::Record; type Viewer = St::Viewer; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Did = St::Did; type Handle = St::Handle; type IndexedAt = Set; type Record = St::Record; type Viewer = St::Viewer; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData St>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Did = St::Did; type Handle = St::Handle; type IndexedAt = St::IndexedAt; type Record = Set; type Viewer = St::Viewer; } ///State transition - sets the `viewer` field to Set pub struct SetViewer(PhantomData St>); impl sealed::Sealed for SetViewer {} impl State for SetViewer { type Did = St::Did; type Handle = St::Handle; type IndexedAt = St::IndexedAt; type Record = St::Record; type Viewer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `did` field pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `record` field pub struct record(()); ///Marker type for the `viewer` field pub struct viewer(()); } } /// Builder for constructing an instance of this type. pub struct ActorViewDetailedBuilder< St: actor_view_detailed_state::State, S: BosStr = DefaultStr, > { _state: PhantomData St>, _fields: ( Option>, Option, Option, Option>, Option, Option, Option, Option>, Option, Option>>, Option>, Option, Option>, Option, Option>, ), _type: PhantomData S>, } impl ActorViewDetailed { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ActorViewDetailedBuilder< actor_view_detailed_state::Empty, DefaultStr, > { ActorViewDetailedBuilder::new() } } impl ActorViewDetailed { /// Create a new builder for this type pub fn builder() -> ActorViewDetailedBuilder { ActorViewDetailedBuilder::builder() } } impl ActorViewDetailedBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { ActorViewDetailedBuilder { _state: PhantomData, _fields: ( None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ), _type: PhantomData, } } } impl ActorViewDetailedBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { ActorViewDetailedBuilder { _state: PhantomData, _fields: ( None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ), _type: PhantomData, } } } impl ActorViewDetailedBuilder { /// Set the `avatar` field (optional) pub fn avatar(mut self, value: impl Into>>) -> Self { self._fields.0 = value.into(); self } /// Set the `avatar` field to an Option value (optional) pub fn maybe_avatar(mut self, value: Option>) -> Self { self._fields.0 = value; self } } impl ActorViewDetailedBuilder { /// Set the `defaultLicense` field (optional) pub fn default_license(mut self, value: impl Into>) -> Self { self._fields.1 = value.into(); self } /// Set the `defaultLicense` field to an Option value (optional) pub fn maybe_default_license(mut self, value: Option) -> Self { self._fields.1 = value; self } } impl ActorViewDetailedBuilder { /// Set the `description` field (optional) pub fn description(mut self, value: impl Into>) -> Self { self._fields.2 = value.into(); self } /// Set the `description` field to an Option value (optional) pub fn maybe_description(mut self, value: Option) -> Self { self._fields.2 = value; self } } impl ActorViewDetailedBuilder where St: actor_view_detailed_state::State, St::Did: actor_view_detailed_state::IsUnset, { /// Set the `did` field (required) pub fn did( mut self, value: impl Into>, ) -> ActorViewDetailedBuilder, S> { self._fields.3 = Option::Some(value.into()); ActorViewDetailedBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ActorViewDetailedBuilder { /// Set the `displayName` field (optional) pub fn display_name(mut self, value: impl Into>) -> Self { self._fields.4 = value.into(); self } /// Set the `displayName` field to an Option value (optional) pub fn maybe_display_name(mut self, value: Option) -> Self { self._fields.4 = value; self } } impl ActorViewDetailedBuilder { /// Set the `followerCount` field (optional) pub fn follower_count(mut self, value: impl Into>) -> Self { self._fields.5 = value.into(); self } /// Set the `followerCount` field to an Option value (optional) pub fn maybe_follower_count(mut self, value: Option) -> Self { self._fields.5 = value; self } } impl ActorViewDetailedBuilder { /// Set the `followingCount` field (optional) pub fn following_count(mut self, value: impl Into>) -> Self { self._fields.6 = value.into(); self } /// Set the `followingCount` field to an Option value (optional) pub fn maybe_following_count(mut self, value: Option) -> Self { self._fields.6 = value; self } } impl ActorViewDetailedBuilder where St: actor_view_detailed_state::State, St::Handle: actor_view_detailed_state::IsUnset, { /// Set the `handle` field (required) pub fn handle( mut self, value: impl Into>, ) -> ActorViewDetailedBuilder, S> { self._fields.7 = Option::Some(value.into()); ActorViewDetailedBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ActorViewDetailedBuilder where St: actor_view_detailed_state::State, St::IndexedAt: actor_view_detailed_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> ActorViewDetailedBuilder, S> { self._fields.8 = Option::Some(value.into()); ActorViewDetailedBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ActorViewDetailedBuilder { /// Set the `links` field (optional) pub fn links(mut self, value: impl Into>>>) -> Self { self._fields.9 = value.into(); self } /// Set the `links` field to an Option value (optional) pub fn maybe_links(mut self, value: Option>>) -> Self { self._fields.9 = value; self } } impl ActorViewDetailedBuilder { /// Set the `printers` field (optional) pub fn printers(mut self, value: impl Into>>) -> Self { self._fields.10 = value.into(); self } /// Set the `printers` field to an Option value (optional) pub fn maybe_printers(mut self, value: Option>) -> Self { self._fields.10 = value; self } } impl ActorViewDetailedBuilder { /// Set the `pronouns` field (optional) pub fn pronouns(mut self, value: impl Into>) -> Self { self._fields.11 = value.into(); self } /// Set the `pronouns` field to an Option value (optional) pub fn maybe_pronouns(mut self, value: Option) -> Self { self._fields.11 = value; self } } impl ActorViewDetailedBuilder where St: actor_view_detailed_state::State, St::Record: actor_view_detailed_state::IsUnset, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, ) -> ActorViewDetailedBuilder, S> { self._fields.12 = Option::Some(value.into()); ActorViewDetailedBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ActorViewDetailedBuilder { /// Set the `thingCount` field (optional) pub fn thing_count(mut self, value: impl Into>) -> Self { self._fields.13 = value.into(); self } /// Set the `thingCount` field to an Option value (optional) pub fn maybe_thing_count(mut self, value: Option) -> Self { self._fields.13 = value; self } } impl ActorViewDetailedBuilder where St: actor_view_detailed_state::State, St::Viewer: actor_view_detailed_state::IsUnset, { /// Set the `viewer` field (required) pub fn viewer( mut self, value: impl Into>, ) -> ActorViewDetailedBuilder, S> { self._fields.14 = Option::Some(value.into()); ActorViewDetailedBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ActorViewDetailedBuilder where St: actor_view_detailed_state::State, St::Did: actor_view_detailed_state::IsSet, St::Handle: actor_view_detailed_state::IsSet, St::IndexedAt: actor_view_detailed_state::IsSet, St::Record: actor_view_detailed_state::IsSet, St::Viewer: actor_view_detailed_state::IsSet, { /// Build the final struct. pub fn build(self) -> ActorViewDetailed { ActorViewDetailed { avatar: self._fields.0, default_license: self._fields.1, description: self._fields.2, did: self._fields.3.unwrap(), display_name: self._fields.4, follower_count: self._fields.5, following_count: self._fields.6, handle: self._fields.7.unwrap(), indexed_at: self._fields.8.unwrap(), links: self._fields.9, printers: self._fields.10, pronouns: self._fields.11, record: self._fields.12.unwrap(), thing_count: self._fields.13, viewer: self._fields.14.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap>, ) -> ActorViewDetailed { ActorViewDetailed { avatar: self._fields.0, default_license: self._fields.1, description: self._fields.2, did: self._fields.3.unwrap(), display_name: self._fields.4, follower_count: self._fields.5, following_count: self._fields.6, handle: self._fields.7.unwrap(), indexed_at: self._fields.8.unwrap(), links: self._fields.9, printers: self._fields.10, pronouns: self._fields.11, record: self._fields.12.unwrap(), thing_count: self._fields.13, viewer: self._fields.14.unwrap(), extra_data: Some(extra_data), } } } pub mod aspect_ratio_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 Height; type Width; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Height = Unset; type Width = Unset; } ///State transition - sets the `height` field to Set pub struct SetHeight(PhantomData St>); impl sealed::Sealed for SetHeight {} impl State for SetHeight { type Height = Set; type Width = St::Width; } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData St>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { type Height = St::Height; type Width = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `height` field pub struct height(()); ///Marker type for the `width` field pub struct width(()); } } /// Builder for constructing an instance of this type. pub struct AspectRatioBuilder { _state: PhantomData St>, _fields: (Option, Option), _type: PhantomData S>, } impl AspectRatio { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> AspectRatioBuilder { AspectRatioBuilder::new() } } impl AspectRatio { /// Create a new builder for this type pub fn builder() -> AspectRatioBuilder { AspectRatioBuilder::builder() } } impl AspectRatioBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { AspectRatioBuilder { _state: PhantomData, _fields: (None, None), _type: PhantomData, } } } impl AspectRatioBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { AspectRatioBuilder { _state: PhantomData, _fields: (None, None), _type: PhantomData, } } } impl AspectRatioBuilder where St: aspect_ratio_state::State, St::Height: aspect_ratio_state::IsUnset, { /// Set the `height` field (required) pub fn height( mut self, value: impl Into, ) -> AspectRatioBuilder, S> { self._fields.0 = Option::Some(value.into()); AspectRatioBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl AspectRatioBuilder where St: aspect_ratio_state::State, St::Width: aspect_ratio_state::IsUnset, { /// Set the `width` field (required) pub fn width( mut self, value: impl Into, ) -> AspectRatioBuilder, S> { self._fields.1 = Option::Some(value.into()); AspectRatioBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl AspectRatioBuilder where St: aspect_ratio_state::State, St::Height: aspect_ratio_state::IsSet, St::Width: aspect_ratio_state::IsSet, { /// Build the final struct. pub fn build(self) -> AspectRatio { AspectRatio { height: self._fields.0.unwrap(), width: self._fields.1.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap>, ) -> AspectRatio { AspectRatio { height: self._fields.0.unwrap(), width: self._fields.1.unwrap(), extra_data: Some(extra_data), } } } pub mod chunk_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 Blob; type Offset; type Size; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Blob = Unset; type Offset = Unset; type Size = Unset; } ///State transition - sets the `blob` field to Set pub struct SetBlob(PhantomData St>); impl sealed::Sealed for SetBlob {} impl State for SetBlob { type Blob = Set; type Offset = St::Offset; type Size = St::Size; } ///State transition - sets the `offset` field to Set pub struct SetOffset(PhantomData St>); impl sealed::Sealed for SetOffset {} impl State for SetOffset { type Blob = St::Blob; type Offset = Set; type Size = St::Size; } ///State transition - sets the `size` field to Set pub struct SetSize(PhantomData St>); impl sealed::Sealed for SetSize {} impl State for SetSize { type Blob = St::Blob; type Offset = St::Offset; type Size = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `blob` field pub struct blob(()); ///Marker type for the `offset` field pub struct offset(()); ///Marker type for the `size` field pub struct size(()); } } /// Builder for constructing an instance of this type. pub struct ChunkBuilder { _state: PhantomData St>, _fields: (Option>, Option, Option), _type: PhantomData S>, } impl Chunk { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ChunkBuilder { ChunkBuilder::new() } } impl Chunk { /// Create a new builder for this type pub fn builder() -> ChunkBuilder { ChunkBuilder::builder() } } impl ChunkBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { ChunkBuilder { _state: PhantomData, _fields: (None, None, None), _type: PhantomData, } } } impl ChunkBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { ChunkBuilder { _state: PhantomData, _fields: (None, None, None), _type: PhantomData, } } } impl ChunkBuilder where St: chunk_state::State, St::Blob: chunk_state::IsUnset, { /// Set the `blob` field (required) pub fn blob( mut self, value: impl Into>, ) -> ChunkBuilder, S> { self._fields.0 = Option::Some(value.into()); ChunkBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ChunkBuilder where St: chunk_state::State, St::Offset: chunk_state::IsUnset, { /// Set the `offset` field (required) pub fn offset( mut self, value: impl Into, ) -> ChunkBuilder, S> { self._fields.1 = Option::Some(value.into()); ChunkBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ChunkBuilder where St: chunk_state::State, St::Size: chunk_state::IsUnset, { /// Set the `size` field (required) pub fn size( mut self, value: impl Into, ) -> ChunkBuilder, S> { self._fields.2 = Option::Some(value.into()); ChunkBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ChunkBuilder where St: chunk_state::State, St::Blob: chunk_state::IsSet, St::Offset: chunk_state::IsSet, St::Size: chunk_state::IsSet, { /// Build the final struct. pub fn build(self) -> Chunk { Chunk { blob: self._fields.0.unwrap(), offset: self._fields.1.unwrap(), size: self._fields.2.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data(self, extra_data: BTreeMap>) -> Chunk { Chunk { blob: self._fields.0.unwrap(), offset: self._fields.1.unwrap(), size: self._fields.2.unwrap(), extra_data: Some(extra_data), } } } pub mod feed_item_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 Thing; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Thing = Unset; } ///State transition - sets the `thing` field to Set pub struct SetThing(PhantomData St>); impl sealed::Sealed for SetThing {} impl State for SetThing { type Thing = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `thing` field pub struct thing(()); } } /// Builder for constructing an instance of this type. pub struct FeedItemBuilder { _state: PhantomData St>, _fields: (Option>,), _type: PhantomData S>, } impl FeedItem { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> FeedItemBuilder { FeedItemBuilder::new() } } impl FeedItem { /// Create a new builder for this type pub fn builder() -> FeedItemBuilder { FeedItemBuilder::builder() } } impl FeedItemBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { FeedItemBuilder { _state: PhantomData, _fields: (None,), _type: PhantomData, } } } impl FeedItemBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { FeedItemBuilder { _state: PhantomData, _fields: (None,), _type: PhantomData, } } } impl FeedItemBuilder where St: feed_item_state::State, St::Thing: feed_item_state::IsUnset, { /// Set the `thing` field (required) pub fn thing( mut self, value: impl Into>, ) -> FeedItemBuilder, S> { self._fields.0 = Option::Some(value.into()); FeedItemBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl FeedItemBuilder where St: feed_item_state::State, St::Thing: feed_item_state::IsSet, { /// Build the final struct. pub fn build(self) -> FeedItem { FeedItem { thing: self._fields.0.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data(self, extra_data: BTreeMap>) -> FeedItem { FeedItem { thing: self._fields.0.unwrap(), extra_data: Some(extra_data), } } } pub mod feed_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 Items; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Items = Unset; } ///State transition - sets the `items` field to Set pub struct SetItems(PhantomData St>); impl sealed::Sealed for SetItems {} impl State for SetItems { type Items = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `items` field pub struct items(()); } } /// Builder for constructing an instance of this type. pub struct FeedViewBuilder { _state: PhantomData St>, _fields: (Option, Option>>), _type: PhantomData S>, } impl FeedView { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> FeedViewBuilder { FeedViewBuilder::new() } } impl FeedView { /// Create a new builder for this type pub fn builder() -> FeedViewBuilder { FeedViewBuilder::builder() } } impl FeedViewBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { FeedViewBuilder { _state: PhantomData, _fields: (None, None), _type: PhantomData, } } } impl FeedViewBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { FeedViewBuilder { _state: PhantomData, _fields: (None, None), _type: PhantomData, } } } impl FeedViewBuilder { /// Set the `cursor` field (optional) pub fn cursor(mut self, value: impl Into>) -> Self { self._fields.0 = value.into(); self } /// Set the `cursor` field to an Option value (optional) pub fn maybe_cursor(mut self, value: Option) -> Self { self._fields.0 = value; self } } impl FeedViewBuilder where St: feed_view_state::State, St::Items: feed_view_state::IsUnset, { /// Set the `items` field (required) pub fn items( mut self, value: impl Into>>, ) -> FeedViewBuilder, S> { self._fields.1 = Option::Some(value.into()); FeedViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl FeedViewBuilder where St: feed_view_state::State, St::Items: feed_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> FeedView { FeedView { cursor: self._fields.0, items: self._fields.1.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data(self, extra_data: BTreeMap>) -> FeedView { FeedView { cursor: self._fields.0, items: self._fields.1.unwrap(), extra_data: Some(extra_data), } } } pub mod file_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 Chunks; type MimeType; type Size; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Chunks = Unset; type MimeType = Unset; type Size = Unset; } ///State transition - sets the `chunks` field to Set pub struct SetChunks(PhantomData St>); impl sealed::Sealed for SetChunks {} impl State for SetChunks { type Chunks = Set; type MimeType = St::MimeType; type Size = St::Size; } ///State transition - sets the `mime_type` field to Set pub struct SetMimeType(PhantomData St>); impl sealed::Sealed for SetMimeType {} impl State for SetMimeType { type Chunks = St::Chunks; type MimeType = Set; type Size = St::Size; } ///State transition - sets the `size` field to Set pub struct SetSize(PhantomData St>); impl sealed::Sealed for SetSize {} impl State for SetSize { type Chunks = St::Chunks; type MimeType = St::MimeType; type Size = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `chunks` field pub struct chunks(()); ///Marker type for the `mime_type` field pub struct mime_type(()); ///Marker type for the `size` field pub struct size(()); } } /// Builder for constructing an instance of this type. pub struct FileBuilder { _state: PhantomData St>, _fields: (Option>>, Option, Option, Option), _type: PhantomData S>, } impl File { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> FileBuilder { FileBuilder::new() } } impl File { /// Create a new builder for this type pub fn builder() -> FileBuilder { FileBuilder::builder() } } impl FileBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { FileBuilder { _state: PhantomData, _fields: (None, None, None, None), _type: PhantomData, } } } impl FileBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { FileBuilder { _state: PhantomData, _fields: (None, None, None, None), _type: PhantomData, } } } impl FileBuilder where St: file_state::State, St::Chunks: file_state::IsUnset, { /// Set the `chunks` field (required) pub fn chunks( mut self, value: impl Into>>, ) -> FileBuilder, S> { self._fields.0 = Option::Some(value.into()); FileBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl FileBuilder { /// Set the `digest` field (optional) pub fn digest(mut self, value: impl Into>) -> Self { self._fields.1 = value.into(); self } /// Set the `digest` field to an Option value (optional) pub fn maybe_digest(mut self, value: Option) -> Self { self._fields.1 = value; self } } impl FileBuilder where St: file_state::State, St::MimeType: file_state::IsUnset, { /// Set the `mimeType` field (required) pub fn mime_type( mut self, value: impl Into, ) -> FileBuilder, S> { self._fields.2 = Option::Some(value.into()); FileBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl FileBuilder where St: file_state::State, St::Size: file_state::IsUnset, { /// Set the `size` field (required) pub fn size( mut self, value: impl Into, ) -> FileBuilder, S> { self._fields.3 = Option::Some(value.into()); FileBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl FileBuilder where St: file_state::State, St::Chunks: file_state::IsSet, St::MimeType: file_state::IsSet, St::Size: file_state::IsSet, { /// Build the final struct. pub fn build(self) -> File { File { chunks: self._fields.0.unwrap(), digest: self._fields.1, mime_type: self._fields.2.unwrap(), size: self._fields.3.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data(self, extra_data: BTreeMap>) -> File { File { chunks: self._fields.0.unwrap(), digest: self._fields.1, mime_type: self._fields.2.unwrap(), size: self._fields.3.unwrap(), extra_data: Some(extra_data), } } } pub mod image_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 Alt; type AspectRatio; type Image; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Alt = Unset; type AspectRatio = Unset; type Image = Unset; } ///State transition - sets the `alt` field to Set pub struct SetAlt(PhantomData St>); impl sealed::Sealed for SetAlt {} impl State for SetAlt { type Alt = Set; type AspectRatio = St::AspectRatio; type Image = St::Image; } ///State transition - sets the `aspect_ratio` field to Set pub struct SetAspectRatio(PhantomData St>); impl sealed::Sealed for SetAspectRatio {} impl State for SetAspectRatio { type Alt = St::Alt; type AspectRatio = Set; type Image = St::Image; } ///State transition - sets the `image` field to Set pub struct SetImage(PhantomData St>); impl sealed::Sealed for SetImage {} impl State for SetImage { type Alt = St::Alt; type AspectRatio = St::AspectRatio; type Image = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `alt` field pub struct alt(()); ///Marker type for the `aspect_ratio` field pub struct aspect_ratio(()); ///Marker type for the `image` field pub struct image(()); } } /// Builder for constructing an instance of this type. pub struct ImageBuilder { _state: PhantomData St>, _fields: (Option, Option>, Option>), _type: PhantomData S>, } impl Image { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ImageBuilder { ImageBuilder::new() } } impl Image { /// Create a new builder for this type pub fn builder() -> ImageBuilder { ImageBuilder::builder() } } impl ImageBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { ImageBuilder { _state: PhantomData, _fields: (None, None, None), _type: PhantomData, } } } impl ImageBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { ImageBuilder { _state: PhantomData, _fields: (None, None, None), _type: PhantomData, } } } impl ImageBuilder where St: image_state::State, St::Alt: image_state::IsUnset, { /// Set the `alt` field (required) pub fn alt( mut self, value: impl Into, ) -> ImageBuilder, S> { self._fields.0 = Option::Some(value.into()); ImageBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ImageBuilder where St: image_state::State, St::AspectRatio: image_state::IsUnset, { /// Set the `aspectRatio` field (required) pub fn aspect_ratio( mut self, value: impl Into>, ) -> ImageBuilder, S> { self._fields.1 = Option::Some(value.into()); ImageBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ImageBuilder where St: image_state::State, St::Image: image_state::IsUnset, { /// Set the `image` field (required) pub fn image( mut self, value: impl Into>, ) -> ImageBuilder, S> { self._fields.2 = Option::Some(value.into()); ImageBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ImageBuilder where St: image_state::State, St::Alt: image_state::IsSet, St::AspectRatio: image_state::IsSet, St::Image: image_state::IsSet, { /// Build the final struct. pub fn build(self) -> Image { Image { alt: self._fields.0.unwrap(), aspect_ratio: self._fields.1.unwrap(), image: self._fields.2.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data(self, extra_data: BTreeMap>) -> Image { Image { alt: self._fields.0.unwrap(), aspect_ratio: self._fields.1.unwrap(), image: self._fields.2.unwrap(), extra_data: Some(extra_data), } } } pub mod image_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 Fullsize; type Thumb; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Fullsize = Unset; type Thumb = Unset; } ///State transition - sets the `fullsize` field to Set pub struct SetFullsize(PhantomData St>); impl sealed::Sealed for SetFullsize {} impl State for SetFullsize { type Fullsize = Set; type Thumb = St::Thumb; } ///State transition - sets the `thumb` field to Set pub struct SetThumb(PhantomData St>); impl sealed::Sealed for SetThumb {} impl State for SetThumb { type Fullsize = St::Fullsize; type Thumb = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `fullsize` field pub struct fullsize(()); ///Marker type for the `thumb` field pub struct thumb(()); } } /// Builder for constructing an instance of this type. pub struct ImageViewBuilder { _state: PhantomData St>, _fields: ( Option, Option>, Option>, Option>, ), _type: PhantomData S>, } impl ImageView { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ImageViewBuilder { ImageViewBuilder::new() } } impl ImageView { /// Create a new builder for this type pub fn builder() -> ImageViewBuilder { ImageViewBuilder::builder() } } impl ImageViewBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { ImageViewBuilder { _state: PhantomData, _fields: (None, None, None, None), _type: PhantomData, } } } impl ImageViewBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { ImageViewBuilder { _state: PhantomData, _fields: (None, None, None, None), _type: PhantomData, } } } impl ImageViewBuilder { /// Set the `alt` field (optional) pub fn alt(mut self, value: impl Into>) -> Self { self._fields.0 = value.into(); self } /// Set the `alt` field to an Option value (optional) pub fn maybe_alt(mut self, value: Option) -> Self { self._fields.0 = value; self } } impl ImageViewBuilder { /// Set the `aspectRatio` field (optional) pub fn aspect_ratio( mut self, value: impl Into>>, ) -> Self { self._fields.1 = value.into(); self } /// Set the `aspectRatio` field to an Option value (optional) pub fn maybe_aspect_ratio(mut self, value: Option>) -> Self { self._fields.1 = value; self } } impl ImageViewBuilder where St: image_view_state::State, St::Fullsize: image_view_state::IsUnset, { /// Set the `fullsize` field (required) pub fn fullsize( mut self, value: impl Into>, ) -> ImageViewBuilder, S> { self._fields.2 = Option::Some(value.into()); ImageViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ImageViewBuilder where St: image_view_state::State, St::Thumb: image_view_state::IsUnset, { /// Set the `thumb` field (required) pub fn thumb( mut self, value: impl Into>, ) -> ImageViewBuilder, S> { self._fields.3 = Option::Some(value.into()); ImageViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ImageViewBuilder where St: image_view_state::State, St::Fullsize: image_view_state::IsSet, St::Thumb: image_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> ImageView { ImageView { alt: self._fields.0, aspect_ratio: self._fields.1, fullsize: self._fields.2.unwrap(), thumb: self._fields.3.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap>, ) -> ImageView { ImageView { alt: self._fields.0, aspect_ratio: self._fields.1, fullsize: self._fields.2.unwrap(), thumb: self._fields.3.unwrap(), extra_data: Some(extra_data), } } } pub mod model_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 Author; type Cid; type IndexedAt; type Name; type PartCount; type Record; type Uri; type Viewer; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Author = Unset; type Cid = Unset; type IndexedAt = Unset; type Name = Unset; type PartCount = Unset; type Record = Unset; type Uri = Unset; type Viewer = Unset; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData St>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Author = Set; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData St>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Author = St::Author; type Cid = Set; type IndexedAt = St::IndexedAt; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Author = St::Author; type Cid = St::Cid; type IndexedAt = Set; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type Name = Set; type PartCount = St::PartCount; type Record = St::Record; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `part_count` field to Set pub struct SetPartCount(PhantomData St>); impl sealed::Sealed for SetPartCount {} impl State for SetPartCount { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type Name = St::Name; type PartCount = Set; type Record = St::Record; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData St>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type Name = St::Name; type PartCount = St::PartCount; type Record = Set; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type Uri = Set; type Viewer = St::Viewer; } ///State transition - sets the `viewer` field to Set pub struct SetViewer(PhantomData St>); impl sealed::Sealed for SetViewer {} impl State for SetViewer { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type Uri = St::Uri; type Viewer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `author` field pub struct author(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `part_count` field pub struct part_count(()); ///Marker type for the `record` field pub struct record(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `viewer` field pub struct viewer(()); } } /// Builder for constructing an instance of this type. pub struct ModelViewBuilder { _state: PhantomData St>, _fields: ( Option>, Option>, Option>>, Option, Option, Option, Option>>, Option>, Option, Option>, Option>, ), _type: PhantomData S>, } impl ModelView { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ModelViewBuilder { ModelViewBuilder::new() } } impl ModelView { /// Create a new builder for this type pub fn builder() -> ModelViewBuilder { ModelViewBuilder::builder() } } impl ModelViewBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { ModelViewBuilder { _state: PhantomData, _fields: (None, None, None, None, None, None, None, None, None, None, None), _type: PhantomData, } } } impl ModelViewBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { ModelViewBuilder { _state: PhantomData, _fields: (None, None, None, None, None, None, None, None, None, None, None), _type: PhantomData, } } } impl ModelViewBuilder where St: model_view_state::State, St::Author: model_view_state::IsUnset, { /// Set the `author` field (required) pub fn author( mut self, value: impl Into>, ) -> ModelViewBuilder, S> { self._fields.0 = Option::Some(value.into()); ModelViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ModelViewBuilder where St: model_view_state::State, St::Cid: model_view_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> ModelViewBuilder, S> { self._fields.1 = Option::Some(value.into()); ModelViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ModelViewBuilder { /// Set the `cover` field (optional) pub fn cover( mut self, value: impl Into>>>, ) -> Self { self._fields.2 = value.into(); self } /// Set the `cover` field to an Option value (optional) pub fn maybe_cover(mut self, value: Option>>) -> Self { self._fields.2 = value; self } } impl ModelViewBuilder where St: model_view_state::State, St::IndexedAt: model_view_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> ModelViewBuilder, S> { self._fields.3 = Option::Some(value.into()); ModelViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ModelViewBuilder where St: model_view_state::State, St::Name: model_view_state::IsUnset, { /// Set the `name` field (required) pub fn name( mut self, value: impl Into, ) -> ModelViewBuilder, S> { self._fields.4 = Option::Some(value.into()); ModelViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ModelViewBuilder where St: model_view_state::State, St::PartCount: model_view_state::IsUnset, { /// Set the `partCount` field (required) pub fn part_count( mut self, value: impl Into, ) -> ModelViewBuilder, S> { self._fields.5 = Option::Some(value.into()); ModelViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ModelViewBuilder { /// Set the `previews` field (optional) pub fn previews( mut self, value: impl Into>>>, ) -> Self { self._fields.6 = value.into(); self } /// Set the `previews` field to an Option value (optional) pub fn maybe_previews(mut self, value: Option>>) -> Self { self._fields.6 = value; self } } impl ModelViewBuilder where St: model_view_state::State, St::Record: model_view_state::IsUnset, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, ) -> ModelViewBuilder, S> { self._fields.7 = Option::Some(value.into()); ModelViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ModelViewBuilder { /// Set the `summary` field (optional) pub fn summary(mut self, value: impl Into>) -> Self { self._fields.8 = value.into(); self } /// Set the `summary` field to an Option value (optional) pub fn maybe_summary(mut self, value: Option) -> Self { self._fields.8 = value; self } } impl ModelViewBuilder where St: model_view_state::State, St::Uri: model_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> ModelViewBuilder, S> { self._fields.9 = Option::Some(value.into()); ModelViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ModelViewBuilder where St: model_view_state::State, St::Viewer: model_view_state::IsUnset, { /// Set the `viewer` field (required) pub fn viewer( mut self, value: impl Into>, ) -> ModelViewBuilder, S> { self._fields.10 = Option::Some(value.into()); ModelViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ModelViewBuilder where St: model_view_state::State, St::Author: model_view_state::IsSet, St::Cid: model_view_state::IsSet, St::IndexedAt: model_view_state::IsSet, St::Name: model_view_state::IsSet, St::PartCount: model_view_state::IsSet, St::Record: model_view_state::IsSet, St::Uri: model_view_state::IsSet, St::Viewer: model_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> ModelView { ModelView { author: self._fields.0.unwrap(), cid: self._fields.1.unwrap(), cover: self._fields.2, indexed_at: self._fields.3.unwrap(), name: self._fields.4.unwrap(), part_count: self._fields.5.unwrap(), previews: self._fields.6, record: self._fields.7.unwrap(), summary: self._fields.8, uri: self._fields.9.unwrap(), viewer: self._fields.10.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap>, ) -> ModelView { ModelView { author: self._fields.0.unwrap(), cid: self._fields.1.unwrap(), cover: self._fields.2, indexed_at: self._fields.3.unwrap(), name: self._fields.4.unwrap(), part_count: self._fields.5.unwrap(), previews: self._fields.6, record: self._fields.7.unwrap(), summary: self._fields.8, uri: self._fields.9.unwrap(), viewer: self._fields.10.unwrap(), extra_data: Some(extra_data), } } } pub mod part_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 Author; type Cid; type File; type IndexedAt; type Name; type Record; type Uri; type Viewer; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Author = Unset; type Cid = Unset; type File = Unset; type IndexedAt = Unset; type Name = Unset; type Record = Unset; type Uri = Unset; type Viewer = Unset; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData St>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Author = Set; type Cid = St::Cid; type File = St::File; type IndexedAt = St::IndexedAt; type Name = St::Name; type Record = St::Record; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData St>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Author = St::Author; type Cid = Set; type File = St::File; type IndexedAt = St::IndexedAt; type Name = St::Name; type Record = St::Record; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `file` field to Set pub struct SetFile(PhantomData St>); impl sealed::Sealed for SetFile {} impl State for SetFile { type Author = St::Author; type Cid = St::Cid; type File = Set; type IndexedAt = St::IndexedAt; type Name = St::Name; type Record = St::Record; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Author = St::Author; type Cid = St::Cid; type File = St::File; type IndexedAt = Set; type Name = St::Name; type Record = St::Record; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { type Author = St::Author; type Cid = St::Cid; type File = St::File; type IndexedAt = St::IndexedAt; type Name = Set; type Record = St::Record; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData St>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Author = St::Author; type Cid = St::Cid; type File = St::File; type IndexedAt = St::IndexedAt; type Name = St::Name; type Record = Set; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Author = St::Author; type Cid = St::Cid; type File = St::File; type IndexedAt = St::IndexedAt; type Name = St::Name; type Record = St::Record; type Uri = Set; type Viewer = St::Viewer; } ///State transition - sets the `viewer` field to Set pub struct SetViewer(PhantomData St>); impl sealed::Sealed for SetViewer {} impl State for SetViewer { type Author = St::Author; type Cid = St::Cid; type File = St::File; type IndexedAt = St::IndexedAt; type Name = St::Name; type Record = St::Record; type Uri = St::Uri; type Viewer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `author` field pub struct author(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `file` field pub struct file(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `record` field pub struct record(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `viewer` field pub struct viewer(()); } } /// Builder for constructing an instance of this type. pub struct PartViewBuilder { _state: PhantomData St>, _fields: ( Option>, Option>, Option>, Option, Option, Option, Option>>, Option>, Option>, Option>, ), _type: PhantomData S>, } impl PartView { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> PartViewBuilder { PartViewBuilder::new() } } impl PartView { /// Create a new builder for this type pub fn builder() -> PartViewBuilder { PartViewBuilder::builder() } } impl PartViewBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { PartViewBuilder { _state: PhantomData, _fields: (None, None, None, None, None, None, None, None, None, None), _type: PhantomData, } } } impl PartViewBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { PartViewBuilder { _state: PhantomData, _fields: (None, None, None, None, None, None, None, None, None, None), _type: PhantomData, } } } impl PartViewBuilder where St: part_view_state::State, St::Author: part_view_state::IsUnset, { /// Set the `author` field (required) pub fn author( mut self, value: impl Into>, ) -> PartViewBuilder, S> { self._fields.0 = Option::Some(value.into()); PartViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl PartViewBuilder where St: part_view_state::State, St::Cid: part_view_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> PartViewBuilder, S> { self._fields.1 = Option::Some(value.into()); PartViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl PartViewBuilder where St: part_view_state::State, St::File: part_view_state::IsUnset, { /// Set the `file` field (required) pub fn file( mut self, value: impl Into>, ) -> PartViewBuilder, S> { self._fields.2 = Option::Some(value.into()); PartViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl PartViewBuilder { /// Set the `format` field (optional) pub fn format(mut self, value: impl Into>) -> Self { self._fields.3 = value.into(); self } /// Set the `format` field to an Option value (optional) pub fn maybe_format(mut self, value: Option) -> Self { self._fields.3 = value; self } } impl PartViewBuilder where St: part_view_state::State, St::IndexedAt: part_view_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> PartViewBuilder, S> { self._fields.4 = Option::Some(value.into()); PartViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl PartViewBuilder where St: part_view_state::State, St::Name: part_view_state::IsUnset, { /// Set the `name` field (required) pub fn name( mut self, value: impl Into, ) -> PartViewBuilder, S> { self._fields.5 = Option::Some(value.into()); PartViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl PartViewBuilder { /// Set the `previews` field (optional) pub fn previews( mut self, value: impl Into>>>, ) -> Self { self._fields.6 = value.into(); self } /// Set the `previews` field to an Option value (optional) pub fn maybe_previews(mut self, value: Option>>) -> Self { self._fields.6 = value; self } } impl PartViewBuilder where St: part_view_state::State, St::Record: part_view_state::IsUnset, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, ) -> PartViewBuilder, S> { self._fields.7 = Option::Some(value.into()); PartViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl PartViewBuilder where St: part_view_state::State, St::Uri: part_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> PartViewBuilder, S> { self._fields.8 = Option::Some(value.into()); PartViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl PartViewBuilder where St: part_view_state::State, St::Viewer: part_view_state::IsUnset, { /// Set the `viewer` field (required) pub fn viewer( mut self, value: impl Into>, ) -> PartViewBuilder, S> { self._fields.9 = Option::Some(value.into()); PartViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl PartViewBuilder where St: part_view_state::State, St::Author: part_view_state::IsSet, St::Cid: part_view_state::IsSet, St::File: part_view_state::IsSet, St::IndexedAt: part_view_state::IsSet, St::Name: part_view_state::IsSet, St::Record: part_view_state::IsSet, St::Uri: part_view_state::IsSet, St::Viewer: part_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> PartView { PartView { author: self._fields.0.unwrap(), cid: self._fields.1.unwrap(), file: self._fields.2.unwrap(), format: self._fields.3, indexed_at: self._fields.4.unwrap(), name: self._fields.5.unwrap(), previews: self._fields.6, record: self._fields.7.unwrap(), uri: self._fields.8.unwrap(), viewer: self._fields.9.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data(self, extra_data: BTreeMap>) -> PartView { PartView { author: self._fields.0.unwrap(), cid: self._fields.1.unwrap(), file: self._fields.2.unwrap(), format: self._fields.3, indexed_at: self._fields.4.unwrap(), name: self._fields.5.unwrap(), previews: self._fields.6, record: self._fields.7.unwrap(), uri: self._fields.8.unwrap(), viewer: self._fields.9.unwrap(), extra_data: Some(extra_data), } } } pub mod thing_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 Author; type Cid; type IndexedAt; type License; type LikeCount; type ModelCount; type Name; type PartCount; type Record; type SaveCount; type Uri; type Viewer; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Author = Unset; type Cid = Unset; type IndexedAt = Unset; type License = Unset; type LikeCount = Unset; type ModelCount = Unset; type Name = Unset; type PartCount = Unset; type Record = Unset; type SaveCount = Unset; type Uri = Unset; type Viewer = Unset; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData St>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Author = Set; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type License = St::License; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData St>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Author = St::Author; type Cid = Set; type IndexedAt = St::IndexedAt; type License = St::License; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Author = St::Author; type Cid = St::Cid; type IndexedAt = Set; type License = St::License; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `license` field to Set pub struct SetLicense(PhantomData St>); impl sealed::Sealed for SetLicense {} impl State for SetLicense { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type License = Set; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `like_count` field to Set pub struct SetLikeCount(PhantomData St>); impl sealed::Sealed for SetLikeCount {} impl State for SetLikeCount { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type License = St::License; type LikeCount = Set; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `model_count` field to Set pub struct SetModelCount(PhantomData St>); impl sealed::Sealed for SetModelCount {} impl State for SetModelCount { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type License = St::License; type LikeCount = St::LikeCount; type ModelCount = Set; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type License = St::License; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = Set; type PartCount = St::PartCount; type Record = St::Record; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `part_count` field to Set pub struct SetPartCount(PhantomData St>); impl sealed::Sealed for SetPartCount {} impl State for SetPartCount { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type License = St::License; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = Set; type Record = St::Record; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData St>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type License = St::License; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type Record = Set; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `save_count` field to Set pub struct SetSaveCount(PhantomData St>); impl sealed::Sealed for SetSaveCount {} impl State for SetSaveCount { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type License = St::License; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type SaveCount = Set; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type License = St::License; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type SaveCount = St::SaveCount; type Uri = Set; type Viewer = St::Viewer; } ///State transition - sets the `viewer` field to Set pub struct SetViewer(PhantomData St>); impl sealed::Sealed for SetViewer {} impl State for SetViewer { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type License = St::License; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type Record = St::Record; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `author` field pub struct author(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `license` field pub struct license(()); ///Marker type for the `like_count` field pub struct like_count(()); ///Marker type for the `model_count` field pub struct model_count(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `part_count` field pub struct part_count(()); ///Marker type for the `record` field pub struct record(()); ///Marker type for the `save_count` field pub struct save_count(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `viewer` field pub struct viewer(()); } } /// Builder for constructing an instance of this type. pub struct ThingViewBuilder { _state: PhantomData St>, _fields: ( Option>, Option>, Option>>, Option>, Option, Option>>, Option, Option, Option, Option, Option, Option>>, Option>, Option, Option, Option>, Option>, Option>, ), _type: PhantomData S>, } impl ThingView { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ThingViewBuilder { ThingViewBuilder::new() } } impl ThingView { /// Create a new builder for this type pub fn builder() -> ThingViewBuilder { ThingViewBuilder::builder() } } impl ThingViewBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { ThingViewBuilder { _state: PhantomData, _fields: ( None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ), _type: PhantomData, } } } impl ThingViewBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { ThingViewBuilder { _state: PhantomData, _fields: ( None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ), _type: PhantomData, } } } impl ThingViewBuilder where St: thing_view_state::State, St::Author: thing_view_state::IsUnset, { /// Set the `author` field (required) pub fn author( mut self, value: impl Into>, ) -> ThingViewBuilder, S> { self._fields.0 = Option::Some(value.into()); ThingViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBuilder where St: thing_view_state::State, St::Cid: thing_view_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> ThingViewBuilder, S> { self._fields.1 = Option::Some(value.into()); ThingViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBuilder { /// Set the `cover` field (optional) pub fn cover( mut self, value: impl Into>>>, ) -> Self { self._fields.2 = value.into(); self } /// Set the `cover` field to an Option value (optional) pub fn maybe_cover(mut self, value: Option>>) -> Self { self._fields.2 = value; self } } impl ThingViewBuilder { /// Set the `derivedFrom` field (optional) pub fn derived_from(mut self, value: impl Into>>) -> Self { self._fields.3 = value.into(); self } /// Set the `derivedFrom` field to an Option value (optional) pub fn maybe_derived_from(mut self, value: Option>) -> Self { self._fields.3 = value; self } } impl ThingViewBuilder where St: thing_view_state::State, St::IndexedAt: thing_view_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> ThingViewBuilder, S> { self._fields.4 = Option::Some(value.into()); ThingViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBuilder { /// Set the `intendedToWorkWith` field (optional) pub fn intended_to_work_with( mut self, value: impl Into>>>, ) -> Self { self._fields.5 = value.into(); self } /// Set the `intendedToWorkWith` field to an Option value (optional) pub fn maybe_intended_to_work_with( mut self, value: Option>>, ) -> Self { self._fields.5 = value; self } } impl ThingViewBuilder where St: thing_view_state::State, St::License: thing_view_state::IsUnset, { /// Set the `license` field (required) pub fn license( mut self, value: impl Into, ) -> ThingViewBuilder, S> { self._fields.6 = Option::Some(value.into()); ThingViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBuilder where St: thing_view_state::State, St::LikeCount: thing_view_state::IsUnset, { /// Set the `likeCount` field (required) pub fn like_count( mut self, value: impl Into, ) -> ThingViewBuilder, S> { self._fields.7 = Option::Some(value.into()); ThingViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBuilder where St: thing_view_state::State, St::ModelCount: thing_view_state::IsUnset, { /// Set the `modelCount` field (required) pub fn model_count( mut self, value: impl Into, ) -> ThingViewBuilder, S> { self._fields.8 = Option::Some(value.into()); ThingViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBuilder where St: thing_view_state::State, St::Name: thing_view_state::IsUnset, { /// Set the `name` field (required) pub fn name( mut self, value: impl Into, ) -> ThingViewBuilder, S> { self._fields.9 = Option::Some(value.into()); ThingViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBuilder where St: thing_view_state::State, St::PartCount: thing_view_state::IsUnset, { /// Set the `partCount` field (required) pub fn part_count( mut self, value: impl Into, ) -> ThingViewBuilder, S> { self._fields.10 = Option::Some(value.into()); ThingViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBuilder { /// Set the `previews` field (optional) pub fn previews( mut self, value: impl Into>>>, ) -> Self { self._fields.11 = value.into(); self } /// Set the `previews` field to an Option value (optional) pub fn maybe_previews(mut self, value: Option>>) -> Self { self._fields.11 = value; self } } impl ThingViewBuilder where St: thing_view_state::State, St::Record: thing_view_state::IsUnset, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, ) -> ThingViewBuilder, S> { self._fields.12 = Option::Some(value.into()); ThingViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBuilder where St: thing_view_state::State, St::SaveCount: thing_view_state::IsUnset, { /// Set the `saveCount` field (required) pub fn save_count( mut self, value: impl Into, ) -> ThingViewBuilder, S> { self._fields.13 = Option::Some(value.into()); ThingViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBuilder { /// Set the `summary` field (optional) pub fn summary(mut self, value: impl Into>) -> Self { self._fields.14 = value.into(); self } /// Set the `summary` field to an Option value (optional) pub fn maybe_summary(mut self, value: Option) -> Self { self._fields.14 = value; self } } impl ThingViewBuilder { /// Set the `tags` field (optional) pub fn tags(mut self, value: impl Into>>) -> Self { self._fields.15 = value.into(); self } /// Set the `tags` field to an Option value (optional) pub fn maybe_tags(mut self, value: Option>) -> Self { self._fields.15 = value; self } } impl ThingViewBuilder where St: thing_view_state::State, St::Uri: thing_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> ThingViewBuilder, S> { self._fields.16 = Option::Some(value.into()); ThingViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBuilder where St: thing_view_state::State, St::Viewer: thing_view_state::IsUnset, { /// Set the `viewer` field (required) pub fn viewer( mut self, value: impl Into>, ) -> ThingViewBuilder, S> { self._fields.17 = Option::Some(value.into()); ThingViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBuilder where St: thing_view_state::State, St::Author: thing_view_state::IsSet, St::Cid: thing_view_state::IsSet, St::IndexedAt: thing_view_state::IsSet, St::License: thing_view_state::IsSet, St::LikeCount: thing_view_state::IsSet, St::ModelCount: thing_view_state::IsSet, St::Name: thing_view_state::IsSet, St::PartCount: thing_view_state::IsSet, St::Record: thing_view_state::IsSet, St::SaveCount: thing_view_state::IsSet, St::Uri: thing_view_state::IsSet, St::Viewer: thing_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> ThingView { ThingView { author: self._fields.0.unwrap(), cid: self._fields.1.unwrap(), cover: self._fields.2, derived_from: self._fields.3, indexed_at: self._fields.4.unwrap(), intended_to_work_with: self._fields.5, license: self._fields.6.unwrap(), like_count: self._fields.7.unwrap(), model_count: self._fields.8.unwrap(), name: self._fields.9.unwrap(), part_count: self._fields.10.unwrap(), previews: self._fields.11, record: self._fields.12.unwrap(), save_count: self._fields.13.unwrap(), summary: self._fields.14, tags: self._fields.15, uri: self._fields.16.unwrap(), viewer: self._fields.17.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap>, ) -> ThingView { ThingView { author: self._fields.0.unwrap(), cid: self._fields.1.unwrap(), cover: self._fields.2, derived_from: self._fields.3, indexed_at: self._fields.4.unwrap(), intended_to_work_with: self._fields.5, license: self._fields.6.unwrap(), like_count: self._fields.7.unwrap(), model_count: self._fields.8.unwrap(), name: self._fields.9.unwrap(), part_count: self._fields.10.unwrap(), previews: self._fields.11, record: self._fields.12.unwrap(), save_count: self._fields.13.unwrap(), summary: self._fields.14, tags: self._fields.15, uri: self._fields.16.unwrap(), viewer: self._fields.17.unwrap(), extra_data: Some(extra_data), } } } pub mod thing_view_basic_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 Author; type Cid; type IndexedAt; type LikeCount; type ModelCount; type Name; type PartCount; type SaveCount; type Uri; type Viewer; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Author = Unset; type Cid = Unset; type IndexedAt = Unset; type LikeCount = Unset; type ModelCount = Unset; type Name = Unset; type PartCount = Unset; type SaveCount = Unset; type Uri = Unset; type Viewer = Unset; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData St>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Author = Set; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData St>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Author = St::Author; type Cid = Set; type IndexedAt = St::IndexedAt; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Author = St::Author; type Cid = St::Cid; type IndexedAt = Set; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `like_count` field to Set pub struct SetLikeCount(PhantomData St>); impl sealed::Sealed for SetLikeCount {} impl State for SetLikeCount { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type LikeCount = Set; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `model_count` field to Set pub struct SetModelCount(PhantomData St>); impl sealed::Sealed for SetModelCount {} impl State for SetModelCount { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type LikeCount = St::LikeCount; type ModelCount = Set; type Name = St::Name; type PartCount = St::PartCount; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = Set; type PartCount = St::PartCount; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `part_count` field to Set pub struct SetPartCount(PhantomData St>); impl sealed::Sealed for SetPartCount {} impl State for SetPartCount { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = Set; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `save_count` field to Set pub struct SetSaveCount(PhantomData St>); impl sealed::Sealed for SetSaveCount {} impl State for SetSaveCount { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type SaveCount = Set; type Uri = St::Uri; type Viewer = St::Viewer; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type SaveCount = St::SaveCount; type Uri = Set; type Viewer = St::Viewer; } ///State transition - sets the `viewer` field to Set pub struct SetViewer(PhantomData St>); impl sealed::Sealed for SetViewer {} impl State for SetViewer { type Author = St::Author; type Cid = St::Cid; type IndexedAt = St::IndexedAt; type LikeCount = St::LikeCount; type ModelCount = St::ModelCount; type Name = St::Name; type PartCount = St::PartCount; type SaveCount = St::SaveCount; type Uri = St::Uri; type Viewer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `author` field pub struct author(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `like_count` field pub struct like_count(()); ///Marker type for the `model_count` field pub struct model_count(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `part_count` field pub struct part_count(()); ///Marker type for the `save_count` field pub struct save_count(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `viewer` field pub struct viewer(()); } } /// Builder for constructing an instance of this type. pub struct ThingViewBasicBuilder< St: thing_view_basic_state::State, S: BosStr = DefaultStr, > { _state: PhantomData St>, _fields: ( Option>, Option>, Option>>, Option, Option, Option, Option, Option, Option>>, Option, Option>, Option>, Option>, ), _type: PhantomData S>, } impl ThingViewBasic { /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed pub fn new() -> ThingViewBasicBuilder { ThingViewBasicBuilder::new() } } impl ThingViewBasic { /// Create a new builder for this type pub fn builder() -> ThingViewBasicBuilder { ThingViewBasicBuilder::builder() } } impl ThingViewBasicBuilder { /// Create a new builder with all fields unset, using the default string type, if needed pub fn new() -> Self { ThingViewBasicBuilder { _state: PhantomData, _fields: ( None, None, None, None, None, None, None, None, None, None, None, None, None, ), _type: PhantomData, } } } impl ThingViewBasicBuilder { /// Create a new builder with all fields unset pub fn builder() -> Self { ThingViewBasicBuilder { _state: PhantomData, _fields: ( None, None, None, None, None, None, None, None, None, None, None, None, None, ), _type: PhantomData, } } } impl ThingViewBasicBuilder where St: thing_view_basic_state::State, St::Author: thing_view_basic_state::IsUnset, { /// Set the `author` field (required) pub fn author( mut self, value: impl Into>, ) -> ThingViewBasicBuilder, S> { self._fields.0 = Option::Some(value.into()); ThingViewBasicBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBasicBuilder where St: thing_view_basic_state::State, St::Cid: thing_view_basic_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> ThingViewBasicBuilder, S> { self._fields.1 = Option::Some(value.into()); ThingViewBasicBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBasicBuilder { /// Set the `cover` field (optional) pub fn cover( mut self, value: impl Into>>>, ) -> Self { self._fields.2 = value.into(); self } /// Set the `cover` field to an Option value (optional) pub fn maybe_cover(mut self, value: Option>>) -> Self { self._fields.2 = value; self } } impl ThingViewBasicBuilder where St: thing_view_basic_state::State, St::IndexedAt: thing_view_basic_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> ThingViewBasicBuilder, S> { self._fields.3 = Option::Some(value.into()); ThingViewBasicBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBasicBuilder where St: thing_view_basic_state::State, St::LikeCount: thing_view_basic_state::IsUnset, { /// Set the `likeCount` field (required) pub fn like_count( mut self, value: impl Into, ) -> ThingViewBasicBuilder, S> { self._fields.4 = Option::Some(value.into()); ThingViewBasicBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBasicBuilder where St: thing_view_basic_state::State, St::ModelCount: thing_view_basic_state::IsUnset, { /// Set the `modelCount` field (required) pub fn model_count( mut self, value: impl Into, ) -> ThingViewBasicBuilder, S> { self._fields.5 = Option::Some(value.into()); ThingViewBasicBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBasicBuilder where St: thing_view_basic_state::State, St::Name: thing_view_basic_state::IsUnset, { /// Set the `name` field (required) pub fn name( mut self, value: impl Into, ) -> ThingViewBasicBuilder, S> { self._fields.6 = Option::Some(value.into()); ThingViewBasicBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBasicBuilder where St: thing_view_basic_state::State, St::PartCount: thing_view_basic_state::IsUnset, { /// Set the `partCount` field (required) pub fn part_count( mut self, value: impl Into, ) -> ThingViewBasicBuilder, S> { self._fields.7 = Option::Some(value.into()); ThingViewBasicBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBasicBuilder { /// Set the `previews` field (optional) pub fn previews( mut self, value: impl Into>>>, ) -> Self { self._fields.8 = value.into(); self } /// Set the `previews` field to an Option value (optional) pub fn maybe_previews(mut self, value: Option>>) -> Self { self._fields.8 = value; self } } impl ThingViewBasicBuilder where St: thing_view_basic_state::State, St::SaveCount: thing_view_basic_state::IsUnset, { /// Set the `saveCount` field (required) pub fn save_count( mut self, value: impl Into, ) -> ThingViewBasicBuilder, S> { self._fields.9 = Option::Some(value.into()); ThingViewBasicBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBasicBuilder { /// Set the `tags` field (optional) pub fn tags(mut self, value: impl Into>>) -> Self { self._fields.10 = value.into(); self } /// Set the `tags` field to an Option value (optional) pub fn maybe_tags(mut self, value: Option>) -> Self { self._fields.10 = value; self } } impl ThingViewBasicBuilder where St: thing_view_basic_state::State, St::Uri: thing_view_basic_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> ThingViewBasicBuilder, S> { self._fields.11 = Option::Some(value.into()); ThingViewBasicBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBasicBuilder where St: thing_view_basic_state::State, St::Viewer: thing_view_basic_state::IsUnset, { /// Set the `viewer` field (required) pub fn viewer( mut self, value: impl Into>, ) -> ThingViewBasicBuilder, S> { self._fields.12 = Option::Some(value.into()); ThingViewBasicBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, } } } impl ThingViewBasicBuilder where St: thing_view_basic_state::State, St::Author: thing_view_basic_state::IsSet, St::Cid: thing_view_basic_state::IsSet, St::IndexedAt: thing_view_basic_state::IsSet, St::LikeCount: thing_view_basic_state::IsSet, St::ModelCount: thing_view_basic_state::IsSet, St::Name: thing_view_basic_state::IsSet, St::PartCount: thing_view_basic_state::IsSet, St::SaveCount: thing_view_basic_state::IsSet, St::Uri: thing_view_basic_state::IsSet, St::Viewer: thing_view_basic_state::IsSet, { /// Build the final struct. pub fn build(self) -> ThingViewBasic { ThingViewBasic { author: self._fields.0.unwrap(), cid: self._fields.1.unwrap(), cover: self._fields.2, indexed_at: self._fields.3.unwrap(), like_count: self._fields.4.unwrap(), model_count: self._fields.5.unwrap(), name: self._fields.6.unwrap(), part_count: self._fields.7.unwrap(), previews: self._fields.8, save_count: self._fields.9.unwrap(), tags: self._fields.10, uri: self._fields.11.unwrap(), viewer: self._fields.12.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. pub fn build_with_data( self, extra_data: BTreeMap>, ) -> ThingViewBasic { ThingViewBasic { author: self._fields.0.unwrap(), cid: self._fields.1.unwrap(), cover: self._fields.2, indexed_at: self._fields.3.unwrap(), like_count: self._fields.4.unwrap(), model_count: self._fields.5.unwrap(), name: self._fields.6.unwrap(), part_count: self._fields.7.unwrap(), previews: self._fields.8, save_count: self._fields.9.unwrap(), tags: self._fields.10, uri: self._fields.11.unwrap(), viewer: self._fields.12.unwrap(), extra_data: Some(extra_data), } } }