#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid, Datetime};
use jacquard_common::types::uri::{RecordUri, UriError};
use jacquard_common::types::value::Data;
use jacquard_common::xrpc::XrpcResp;
use jacquard_derive::{IntoStatic, lexicon};
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::science_alt::dataset::programming_language::ProgrammingLanguage;
use crate::science_alt::dataset::lens;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct CodeReference<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub branch: Option<S>,
pub commit: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub language: Option<ProgrammingLanguage<S>>,
pub path: S,
pub repository: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct LensMetadata<S: BosStr = DefaultStr> {
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
rename = "science.alt.dataset.lens",
tag = "$type",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Lens<S: BosStr = DefaultStr> {
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<S>,
pub getter_code: lens::CodeReference<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub language: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<lens::LensMetadata<S>>,
pub name: S,
pub putter_code: lens::CodeReference<S>,
pub source_schema: AtUri<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub source_schema_version: Option<S>,
pub target_schema: AtUri<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub target_schema_version: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct LensGetRecordOutput<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
pub uri: AtUri<S>,
pub value: Lens<S>,
}
impl<S: BosStr> Lens<S> {
pub fn uri(uri: S) -> Result<RecordUri<S, LensRecord>, UriError> {
RecordUri::try_from_uri(AtUri::new(uri)?)
}
}
impl<S: BosStr> LexiconSchema for CodeReference<S> {
fn nsid() -> &'static str {
"science.alt.dataset.lens"
}
fn def_name() -> &'static str {
"codeReference"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_science_alt_dataset_lens()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.branch {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("branch"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.commit;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 40usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("commit"),
max: 40usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.path;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("path"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.repository;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("repository"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for LensMetadata<S> {
fn nsid() -> &'static str {
"science.alt.dataset.lens"
}
fn def_name() -> &'static str {
"lensMetadata"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_science_alt_dataset_lens()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct LensRecord;
impl XrpcResp for LensRecord {
const NSID: &'static str = "science.alt.dataset.lens";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = LensGetRecordOutput<S>;
type Err = RecordError;
}
impl<S: BosStr> From<LensGetRecordOutput<S>> for Lens<S> {
fn from(output: LensGetRecordOutput<S>) -> Self {
output.value
}
}
impl<S: BosStr> Collection for Lens<S> {
const NSID: &'static str = "science.alt.dataset.lens";
type Record = LensRecord;
}
impl Collection for LensRecord {
const NSID: &'static str = "science.alt.dataset.lens";
type Record = LensRecord;
}
impl<S: BosStr> LexiconSchema for Lens<S> {
fn nsid() -> &'static str {
"science.alt.dataset.lens"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_science_alt_dataset_lens()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.description {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 1000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("description"),
max: 1000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.language {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 50usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("language"),
max: 50usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("name"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.source_schema;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("source_schema"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.source_schema_version {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("source_schema_version"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.target_schema;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("target_schema"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.target_schema_version {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("target_schema_version"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
fn lexicon_doc_science_alt_dataset_lens() -> 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("science.alt.dataset.lens"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("codeReference"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Reference to code in an external repository (GitHub, tangled.org, etc.)",
),
),
required: Some(
vec![
SmolStr::new_static("repository"),
SmolStr::new_static("commit"), SmolStr::new_static("path")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("branch"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Optional branch name (for reference, commit hash is authoritative)",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("commit"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Git commit hash (ensures immutability)"),
),
max_length: Some(40usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("language"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"science.alt.dataset.programmingLanguage",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("path"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Path to function within repository (e.g., 'lenses/vision.py:rgb_to_grayscale')",
),
),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("repository"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Repository URL (e.g., 'https://github.com/user/repo' or 'at://did/tangled.repo/...')",
),
),
max_length: Some(500usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lensMetadata"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Open metadata object for lens records. Applications may extend with additional fields (author, performance notes, etc.).",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("main"),
LexUserType::Record(LexRecord {
description: Some(
CowStr::new_static(
"Bidirectional transformation (Lens) between two sample types, with code stored in external repositories",
),
),
key: Some(CowStr::new_static("tid")),
record: LexRecordRecord::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("name"),
SmolStr::new_static("sourceSchema"),
SmolStr::new_static("targetSchema"),
SmolStr::new_static("getterCode"),
SmolStr::new_static("putterCode"),
SmolStr::new_static("createdAt")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Timestamp when this lens was created"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("What this transformation does"),
),
max_length: Some(1000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("getterCode"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#codeReference"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("language"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"(Deprecated: use codeReference.language instead.) Programming language of the lens implementation (e.g., 'python', 'typescript')",
),
),
max_length: Some(50usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("metadata"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#lensMetadata"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Human-readable lens name"),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("putterCode"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#codeReference"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sourceSchema"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("AT-URI reference to source schema"),
),
format: Some(LexStringFormat::AtUri),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sourceSchemaVersion"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Semver version or range for source schema compatibility (e.g., '1.0.0', '>=1.0.0 <2.0.0')",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("targetSchema"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("AT-URI reference to target schema"),
),
format: Some(LexStringFormat::AtUri),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("targetSchemaVersion"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Semver version or range for target schema compatibility (e.g., '1.0.0', '>=1.0.0 <2.0.0')",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod lens_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type SourceSchema;
type GetterCode;
type CreatedAt;
type PutterCode;
type Name;
type TargetSchema;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type SourceSchema = Unset;
type GetterCode = Unset;
type CreatedAt = Unset;
type PutterCode = Unset;
type Name = Unset;
type TargetSchema = Unset;
}
pub struct SetSourceSchema<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSourceSchema<St> {}
impl<St: State> State for SetSourceSchema<St> {
type SourceSchema = Set<members::source_schema>;
type GetterCode = St::GetterCode;
type CreatedAt = St::CreatedAt;
type PutterCode = St::PutterCode;
type Name = St::Name;
type TargetSchema = St::TargetSchema;
}
pub struct SetGetterCode<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetGetterCode<St> {}
impl<St: State> State for SetGetterCode<St> {
type SourceSchema = St::SourceSchema;
type GetterCode = Set<members::getter_code>;
type CreatedAt = St::CreatedAt;
type PutterCode = St::PutterCode;
type Name = St::Name;
type TargetSchema = St::TargetSchema;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type SourceSchema = St::SourceSchema;
type GetterCode = St::GetterCode;
type CreatedAt = Set<members::created_at>;
type PutterCode = St::PutterCode;
type Name = St::Name;
type TargetSchema = St::TargetSchema;
}
pub struct SetPutterCode<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPutterCode<St> {}
impl<St: State> State for SetPutterCode<St> {
type SourceSchema = St::SourceSchema;
type GetterCode = St::GetterCode;
type CreatedAt = St::CreatedAt;
type PutterCode = Set<members::putter_code>;
type Name = St::Name;
type TargetSchema = St::TargetSchema;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type SourceSchema = St::SourceSchema;
type GetterCode = St::GetterCode;
type CreatedAt = St::CreatedAt;
type PutterCode = St::PutterCode;
type Name = Set<members::name>;
type TargetSchema = St::TargetSchema;
}
pub struct SetTargetSchema<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTargetSchema<St> {}
impl<St: State> State for SetTargetSchema<St> {
type SourceSchema = St::SourceSchema;
type GetterCode = St::GetterCode;
type CreatedAt = St::CreatedAt;
type PutterCode = St::PutterCode;
type Name = St::Name;
type TargetSchema = Set<members::target_schema>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct source_schema(());
pub struct getter_code(());
pub struct created_at(());
pub struct putter_code(());
pub struct name(());
pub struct target_schema(());
}
}
pub struct LensBuilder<S: BosStr, St: lens_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Datetime>,
Option<S>,
Option<lens::CodeReference<S>>,
Option<S>,
Option<lens::LensMetadata<S>>,
Option<S>,
Option<lens::CodeReference<S>>,
Option<AtUri<S>>,
Option<S>,
Option<AtUri<S>>,
Option<S>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Lens<S> {
pub fn new() -> LensBuilder<S, lens_state::Empty> {
LensBuilder::new()
}
}
impl<S: BosStr> LensBuilder<S, lens_state::Empty> {
pub fn new() -> Self {
LensBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LensBuilder<S, St>
where
St: lens_state::State,
St::CreatedAt: lens_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> LensBuilder<S, lens_state::SetCreatedAt<St>> {
self._fields.0 = Option::Some(value.into());
LensBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: lens_state::State> LensBuilder<S, St> {
pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<S>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> LensBuilder<S, St>
where
St: lens_state::State,
St::GetterCode: lens_state::IsUnset,
{
pub fn getter_code(
mut self,
value: impl Into<lens::CodeReference<S>>,
) -> LensBuilder<S, lens_state::SetGetterCode<St>> {
self._fields.2 = Option::Some(value.into());
LensBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: lens_state::State> LensBuilder<S, St> {
pub fn language(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_language(mut self, value: Option<S>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: lens_state::State> LensBuilder<S, St> {
pub fn metadata(mut self, value: impl Into<Option<lens::LensMetadata<S>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_metadata(mut self, value: Option<lens::LensMetadata<S>>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> LensBuilder<S, St>
where
St: lens_state::State,
St::Name: lens_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<S>,
) -> LensBuilder<S, lens_state::SetName<St>> {
self._fields.5 = Option::Some(value.into());
LensBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LensBuilder<S, St>
where
St: lens_state::State,
St::PutterCode: lens_state::IsUnset,
{
pub fn putter_code(
mut self,
value: impl Into<lens::CodeReference<S>>,
) -> LensBuilder<S, lens_state::SetPutterCode<St>> {
self._fields.6 = Option::Some(value.into());
LensBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LensBuilder<S, St>
where
St: lens_state::State,
St::SourceSchema: lens_state::IsUnset,
{
pub fn source_schema(
mut self,
value: impl Into<AtUri<S>>,
) -> LensBuilder<S, lens_state::SetSourceSchema<St>> {
self._fields.7 = Option::Some(value.into());
LensBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: lens_state::State> LensBuilder<S, St> {
pub fn source_schema_version(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_source_schema_version(mut self, value: Option<S>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St> LensBuilder<S, St>
where
St: lens_state::State,
St::TargetSchema: lens_state::IsUnset,
{
pub fn target_schema(
mut self,
value: impl Into<AtUri<S>>,
) -> LensBuilder<S, lens_state::SetTargetSchema<St>> {
self._fields.9 = Option::Some(value.into());
LensBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: lens_state::State> LensBuilder<S, St> {
pub fn target_schema_version(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_target_schema_version(mut self, value: Option<S>) -> Self {
self._fields.10 = value;
self
}
}
impl<S: BosStr, St> LensBuilder<S, St>
where
St: lens_state::State,
St::SourceSchema: lens_state::IsSet,
St::GetterCode: lens_state::IsSet,
St::CreatedAt: lens_state::IsSet,
St::PutterCode: lens_state::IsSet,
St::Name: lens_state::IsSet,
St::TargetSchema: lens_state::IsSet,
{
pub fn build(self) -> Lens<S> {
Lens {
created_at: self._fields.0.unwrap(),
description: self._fields.1,
getter_code: self._fields.2.unwrap(),
language: self._fields.3,
metadata: self._fields.4,
name: self._fields.5.unwrap(),
putter_code: self._fields.6.unwrap(),
source_schema: self._fields.7.unwrap(),
source_schema_version: self._fields.8,
target_schema: self._fields.9.unwrap(),
target_schema_version: self._fields.10,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Lens<S> {
Lens {
created_at: self._fields.0.unwrap(),
description: self._fields.1,
getter_code: self._fields.2.unwrap(),
language: self._fields.3,
metadata: self._fields.4,
name: self._fields.5.unwrap(),
putter_code: self._fields.6.unwrap(),
source_schema: self._fields.7.unwrap(),
source_schema_version: self._fields.8,
target_schema: self._fields.9.unwrap(),
target_schema_version: self._fields.10,
extra_data: Some(extra_data),
}
}
}