#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic,
Default
)]
#[serde(rename_all = "camelCase")]
pub struct CommitCountBreakdown<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub by_email: std::option::Option<
Vec<crate::sh_tangled::git::ref_update::IndividualEmailCommitCount<'a>>,
>,
}
fn lexicon_doc_sh_tangled_git_refUpdate() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("sh.tangled.git.refUpdate"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"commitCountBreakdown",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(vec![]),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"byEmail",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#individualEmailCommitCount",
),
}),
min_length: None,
max_length: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"individualEmailCommitCount",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("email"),
::jacquard_common::deps::smol_str::SmolStr::new_static("count")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"count",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"email",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"individualLanguageSize",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("lang"),
::jacquard_common::deps::smol_str::SmolStr::new_static("size")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"lang",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"size",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("langBreakdown"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: None,
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"inputs",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray {
description: None,
items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#individualLanguageSize",
),
}),
min_length: None,
max_length: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("main"),
::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
description: Some(
::jacquard_common::CowStr::new_static(
"An update to a git repository, emitted by knots.",
),
),
key: Some(::jacquard_common::CowStr::new_static("tid")),
record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("ref"),
::jacquard_common::deps::smol_str::SmolStr::new_static("committerDid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("repoDid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("repoName"),
::jacquard_common::deps::smol_str::SmolStr::new_static("oldSha"),
::jacquard_common::deps::smol_str::SmolStr::new_static("newSha"),
::jacquard_common::deps::smol_str::SmolStr::new_static("meta")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"committerDid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"did of the user that pushed this ref",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Did,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"meta",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#meta"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"newSha",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static("new SHA of this ref"),
),
format: None,
default: None,
min_length: Some(40usize),
max_length: Some(40usize),
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"oldSha",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static("old SHA of this ref"),
),
format: None,
default: None,
min_length: Some(40usize),
max_length: Some(40usize),
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"ref",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static("Ref being updated"),
),
format: None,
default: None,
min_length: None,
max_length: Some(2560usize),
min_graphemes: None,
max_graphemes: Some(256usize),
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"repoDid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"did of the owner of the repo",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Did,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"repoName",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static("name of the repo"),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("meta"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("isDefaultRef"),
::jacquard_common::deps::smol_str::SmolStr::new_static("commitCount")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"commitCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#commitCountBreakdown",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"isDefaultRef",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
description: None,
default: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"langBreakdown",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#langBreakdown",
),
}),
);
map
},
}),
);
map
},
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CommitCountBreakdown<'a> {
fn nsid() -> &'static str {
"sh.tangled.git.refUpdate"
}
fn def_name() -> &'static str {
"commitCountBreakdown"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_git_refUpdate()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct IndividualEmailCommitCount<'a> {
pub count: i64,
#[serde(borrow)]
pub email: jacquard_common::CowStr<'a>,
}
pub mod individual_email_commit_count_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 Email;
type Count;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Email = Unset;
type Count = Unset;
}
pub struct SetEmail<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetEmail<S> {}
impl<S: State> State for SetEmail<S> {
type Email = Set<members::email>;
type Count = S::Count;
}
pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCount<S> {}
impl<S: State> State for SetCount<S> {
type Email = S::Email;
type Count = Set<members::count>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct email(());
pub struct count(());
}
}
pub struct IndividualEmailCommitCountBuilder<
'a,
S: individual_email_commit_count_state::State,
> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<i64>,
::core::option::Option<jacquard_common::CowStr<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> IndividualEmailCommitCount<'a> {
pub fn new() -> IndividualEmailCommitCountBuilder<
'a,
individual_email_commit_count_state::Empty,
> {
IndividualEmailCommitCountBuilder::new()
}
}
impl<
'a,
> IndividualEmailCommitCountBuilder<'a, individual_email_commit_count_state::Empty> {
pub fn new() -> Self {
IndividualEmailCommitCountBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> IndividualEmailCommitCountBuilder<'a, S>
where
S: individual_email_commit_count_state::State,
S::Count: individual_email_commit_count_state::IsUnset,
{
pub fn count(
mut self,
value: impl Into<i64>,
) -> IndividualEmailCommitCountBuilder<
'a,
individual_email_commit_count_state::SetCount<S>,
> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
IndividualEmailCommitCountBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> IndividualEmailCommitCountBuilder<'a, S>
where
S: individual_email_commit_count_state::State,
S::Email: individual_email_commit_count_state::IsUnset,
{
pub fn email(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> IndividualEmailCommitCountBuilder<
'a,
individual_email_commit_count_state::SetEmail<S>,
> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
IndividualEmailCommitCountBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> IndividualEmailCommitCountBuilder<'a, S>
where
S: individual_email_commit_count_state::State,
S::Email: individual_email_commit_count_state::IsSet,
S::Count: individual_email_commit_count_state::IsSet,
{
pub fn build(self) -> IndividualEmailCommitCount<'a> {
IndividualEmailCommitCount {
count: self.__unsafe_private_named.0.unwrap(),
email: self.__unsafe_private_named.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> IndividualEmailCommitCount<'a> {
IndividualEmailCommitCount {
count: self.__unsafe_private_named.0.unwrap(),
email: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for IndividualEmailCommitCount<'a> {
fn nsid() -> &'static str {
"sh.tangled.git.refUpdate"
}
fn def_name() -> &'static str {
"individualEmailCommitCount"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_git_refUpdate()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct IndividualLanguageSize<'a> {
#[serde(borrow)]
pub lang: jacquard_common::CowStr<'a>,
pub size: i64,
}
pub mod individual_language_size_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 Size;
type Lang;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Size = Unset;
type Lang = Unset;
}
pub struct SetSize<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSize<S> {}
impl<S: State> State for SetSize<S> {
type Size = Set<members::size>;
type Lang = S::Lang;
}
pub struct SetLang<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLang<S> {}
impl<S: State> State for SetLang<S> {
type Size = S::Size;
type Lang = Set<members::lang>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct size(());
pub struct lang(());
}
}
pub struct IndividualLanguageSizeBuilder<'a, S: individual_language_size_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<i64>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> IndividualLanguageSize<'a> {
pub fn new() -> IndividualLanguageSizeBuilder<
'a,
individual_language_size_state::Empty,
> {
IndividualLanguageSizeBuilder::new()
}
}
impl<'a> IndividualLanguageSizeBuilder<'a, individual_language_size_state::Empty> {
pub fn new() -> Self {
IndividualLanguageSizeBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> IndividualLanguageSizeBuilder<'a, S>
where
S: individual_language_size_state::State,
S::Lang: individual_language_size_state::IsUnset,
{
pub fn lang(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> IndividualLanguageSizeBuilder<'a, individual_language_size_state::SetLang<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
IndividualLanguageSizeBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> IndividualLanguageSizeBuilder<'a, S>
where
S: individual_language_size_state::State,
S::Size: individual_language_size_state::IsUnset,
{
pub fn size(
mut self,
value: impl Into<i64>,
) -> IndividualLanguageSizeBuilder<'a, individual_language_size_state::SetSize<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
IndividualLanguageSizeBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> IndividualLanguageSizeBuilder<'a, S>
where
S: individual_language_size_state::State,
S::Size: individual_language_size_state::IsSet,
S::Lang: individual_language_size_state::IsSet,
{
pub fn build(self) -> IndividualLanguageSize<'a> {
IndividualLanguageSize {
lang: self.__unsafe_private_named.0.unwrap(),
size: self.__unsafe_private_named.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> IndividualLanguageSize<'a> {
IndividualLanguageSize {
lang: self.__unsafe_private_named.0.unwrap(),
size: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for IndividualLanguageSize<'a> {
fn nsid() -> &'static str {
"sh.tangled.git.refUpdate"
}
fn def_name() -> &'static str {
"individualLanguageSize"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_git_refUpdate()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic,
Default
)]
#[serde(rename_all = "camelCase")]
pub struct LangBreakdown<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub inputs: std::option::Option<
Vec<crate::sh_tangled::git::ref_update::IndividualLanguageSize<'a>>,
>,
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LangBreakdown<'a> {
fn nsid() -> &'static str {
"sh.tangled.git.refUpdate"
}
fn def_name() -> &'static str {
"langBreakdown"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_git_refUpdate()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct RefUpdate<'a> {
#[serde(borrow)]
pub committer_did: jacquard_common::types::string::Did<'a>,
#[serde(borrow)]
pub meta: crate::sh_tangled::git::ref_update::Meta<'a>,
#[serde(borrow)]
pub new_sha: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub old_sha: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub r#ref: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub repo_did: jacquard_common::types::string::Did<'a>,
#[serde(borrow)]
pub repo_name: jacquard_common::CowStr<'a>,
}
pub mod ref_update_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 RepoName;
type OldSha;
type RepoDid;
type CommitterDid;
type NewSha;
type Ref;
type Meta;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type RepoName = Unset;
type OldSha = Unset;
type RepoDid = Unset;
type CommitterDid = Unset;
type NewSha = Unset;
type Ref = Unset;
type Meta = Unset;
}
pub struct SetRepoName<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRepoName<S> {}
impl<S: State> State for SetRepoName<S> {
type RepoName = Set<members::repo_name>;
type OldSha = S::OldSha;
type RepoDid = S::RepoDid;
type CommitterDid = S::CommitterDid;
type NewSha = S::NewSha;
type Ref = S::Ref;
type Meta = S::Meta;
}
pub struct SetOldSha<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetOldSha<S> {}
impl<S: State> State for SetOldSha<S> {
type RepoName = S::RepoName;
type OldSha = Set<members::old_sha>;
type RepoDid = S::RepoDid;
type CommitterDid = S::CommitterDid;
type NewSha = S::NewSha;
type Ref = S::Ref;
type Meta = S::Meta;
}
pub struct SetRepoDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRepoDid<S> {}
impl<S: State> State for SetRepoDid<S> {
type RepoName = S::RepoName;
type OldSha = S::OldSha;
type RepoDid = Set<members::repo_did>;
type CommitterDid = S::CommitterDid;
type NewSha = S::NewSha;
type Ref = S::Ref;
type Meta = S::Meta;
}
pub struct SetCommitterDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCommitterDid<S> {}
impl<S: State> State for SetCommitterDid<S> {
type RepoName = S::RepoName;
type OldSha = S::OldSha;
type RepoDid = S::RepoDid;
type CommitterDid = Set<members::committer_did>;
type NewSha = S::NewSha;
type Ref = S::Ref;
type Meta = S::Meta;
}
pub struct SetNewSha<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetNewSha<S> {}
impl<S: State> State for SetNewSha<S> {
type RepoName = S::RepoName;
type OldSha = S::OldSha;
type RepoDid = S::RepoDid;
type CommitterDid = S::CommitterDid;
type NewSha = Set<members::new_sha>;
type Ref = S::Ref;
type Meta = S::Meta;
}
pub struct SetRef<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRef<S> {}
impl<S: State> State for SetRef<S> {
type RepoName = S::RepoName;
type OldSha = S::OldSha;
type RepoDid = S::RepoDid;
type CommitterDid = S::CommitterDid;
type NewSha = S::NewSha;
type Ref = Set<members::r#ref>;
type Meta = S::Meta;
}
pub struct SetMeta<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetMeta<S> {}
impl<S: State> State for SetMeta<S> {
type RepoName = S::RepoName;
type OldSha = S::OldSha;
type RepoDid = S::RepoDid;
type CommitterDid = S::CommitterDid;
type NewSha = S::NewSha;
type Ref = S::Ref;
type Meta = Set<members::meta>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct repo_name(());
pub struct old_sha(());
pub struct repo_did(());
pub struct committer_did(());
pub struct new_sha(());
pub struct r#ref(());
pub struct meta(());
}
}
pub struct RefUpdateBuilder<'a, S: ref_update_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Did<'a>>,
::core::option::Option<crate::sh_tangled::git::ref_update::Meta<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::Did<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> RefUpdate<'a> {
pub fn new() -> RefUpdateBuilder<'a, ref_update_state::Empty> {
RefUpdateBuilder::new()
}
}
impl<'a> RefUpdateBuilder<'a, ref_update_state::Empty> {
pub fn new() -> Self {
RefUpdateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RefUpdateBuilder<'a, S>
where
S: ref_update_state::State,
S::CommitterDid: ref_update_state::IsUnset,
{
pub fn committer_did(
mut self,
value: impl Into<jacquard_common::types::string::Did<'a>>,
) -> RefUpdateBuilder<'a, ref_update_state::SetCommitterDid<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
RefUpdateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RefUpdateBuilder<'a, S>
where
S: ref_update_state::State,
S::Meta: ref_update_state::IsUnset,
{
pub fn meta(
mut self,
value: impl Into<crate::sh_tangled::git::ref_update::Meta<'a>>,
) -> RefUpdateBuilder<'a, ref_update_state::SetMeta<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
RefUpdateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RefUpdateBuilder<'a, S>
where
S: ref_update_state::State,
S::NewSha: ref_update_state::IsUnset,
{
pub fn new_sha(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> RefUpdateBuilder<'a, ref_update_state::SetNewSha<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
RefUpdateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RefUpdateBuilder<'a, S>
where
S: ref_update_state::State,
S::OldSha: ref_update_state::IsUnset,
{
pub fn old_sha(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> RefUpdateBuilder<'a, ref_update_state::SetOldSha<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
RefUpdateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RefUpdateBuilder<'a, S>
where
S: ref_update_state::State,
S::Ref: ref_update_state::IsUnset,
{
pub fn r#ref(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> RefUpdateBuilder<'a, ref_update_state::SetRef<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
RefUpdateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RefUpdateBuilder<'a, S>
where
S: ref_update_state::State,
S::RepoDid: ref_update_state::IsUnset,
{
pub fn repo_did(
mut self,
value: impl Into<jacquard_common::types::string::Did<'a>>,
) -> RefUpdateBuilder<'a, ref_update_state::SetRepoDid<S>> {
self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into());
RefUpdateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RefUpdateBuilder<'a, S>
where
S: ref_update_state::State,
S::RepoName: ref_update_state::IsUnset,
{
pub fn repo_name(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> RefUpdateBuilder<'a, ref_update_state::SetRepoName<S>> {
self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into());
RefUpdateBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> RefUpdateBuilder<'a, S>
where
S: ref_update_state::State,
S::RepoName: ref_update_state::IsSet,
S::OldSha: ref_update_state::IsSet,
S::RepoDid: ref_update_state::IsSet,
S::CommitterDid: ref_update_state::IsSet,
S::NewSha: ref_update_state::IsSet,
S::Ref: ref_update_state::IsSet,
S::Meta: ref_update_state::IsSet,
{
pub fn build(self) -> RefUpdate<'a> {
RefUpdate {
committer_did: self.__unsafe_private_named.0.unwrap(),
meta: self.__unsafe_private_named.1.unwrap(),
new_sha: self.__unsafe_private_named.2.unwrap(),
old_sha: self.__unsafe_private_named.3.unwrap(),
r#ref: self.__unsafe_private_named.4.unwrap(),
repo_did: self.__unsafe_private_named.5.unwrap(),
repo_name: self.__unsafe_private_named.6.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> RefUpdate<'a> {
RefUpdate {
committer_did: self.__unsafe_private_named.0.unwrap(),
meta: self.__unsafe_private_named.1.unwrap(),
new_sha: self.__unsafe_private_named.2.unwrap(),
old_sha: self.__unsafe_private_named.3.unwrap(),
r#ref: self.__unsafe_private_named.4.unwrap(),
repo_did: self.__unsafe_private_named.5.unwrap(),
repo_name: self.__unsafe_private_named.6.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> RefUpdate<'a> {
pub fn uri(
uri: impl Into<jacquard_common::CowStr<'a>>,
) -> Result<
jacquard_common::types::uri::RecordUri<'a, RefUpdateRecord>,
jacquard_common::types::uri::UriError,
> {
jacquard_common::types::uri::RecordUri::try_from_uri(
jacquard_common::types::string::AtUri::new_cow(uri.into())?,
)
}
}
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct RefUpdateGetRecordOutput<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
#[serde(borrow)]
pub value: RefUpdate<'a>,
}
impl From<RefUpdateGetRecordOutput<'_>> for RefUpdate<'_> {
fn from(output: RefUpdateGetRecordOutput<'_>) -> Self {
use jacquard_common::IntoStatic;
output.value.into_static()
}
}
impl jacquard_common::types::collection::Collection for RefUpdate<'_> {
const NSID: &'static str = "sh.tangled.git.refUpdate";
type Record = RefUpdateRecord;
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct RefUpdateRecord;
impl jacquard_common::xrpc::XrpcResp for RefUpdateRecord {
const NSID: &'static str = "sh.tangled.git.refUpdate";
const ENCODING: &'static str = "application/json";
type Output<'de> = RefUpdateGetRecordOutput<'de>;
type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
}
impl jacquard_common::types::collection::Collection for RefUpdateRecord {
const NSID: &'static str = "sh.tangled.git.refUpdate";
type Record = RefUpdateRecord;
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RefUpdate<'a> {
fn nsid() -> &'static str {
"sh.tangled.git.refUpdate"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_git_refUpdate()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
{
let value = &self.new_sha;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 40usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"new_sha",
),
max: 40usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.new_sha;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) < 40usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MinLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"new_sha",
),
min: 40usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.old_sha;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 40usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"old_sha",
),
max: 40usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.old_sha;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) < 40usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MinLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"old_sha",
),
min: 40usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.r#ref;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2560usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"ref",
),
max: 2560usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.r#ref;
{
let count = jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation::graphemes(
value.as_ref(),
true,
)
.count();
if count > 256usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"ref",
),
max: 256usize,
actual: count,
});
}
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct Meta<'a> {
#[serde(borrow)]
pub commit_count: crate::sh_tangled::git::ref_update::CommitCountBreakdown<'a>,
#[serde(default = "_default_meta_is_default_ref")]
pub is_default_ref: bool,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub lang_breakdown: std::option::Option<
crate::sh_tangled::git::ref_update::LangBreakdown<'a>,
>,
}
fn _default_meta_is_default_ref() -> bool {
false
}
pub mod meta_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 IsDefaultRef;
type CommitCount;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type IsDefaultRef = Unset;
type CommitCount = Unset;
}
pub struct SetIsDefaultRef<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIsDefaultRef<S> {}
impl<S: State> State for SetIsDefaultRef<S> {
type IsDefaultRef = Set<members::is_default_ref>;
type CommitCount = S::CommitCount;
}
pub struct SetCommitCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCommitCount<S> {}
impl<S: State> State for SetCommitCount<S> {
type IsDefaultRef = S::IsDefaultRef;
type CommitCount = Set<members::commit_count>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct is_default_ref(());
pub struct commit_count(());
}
}
pub struct MetaBuilder<'a, S: meta_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<
crate::sh_tangled::git::ref_update::CommitCountBreakdown<'a>,
>,
::core::option::Option<bool>,
::core::option::Option<crate::sh_tangled::git::ref_update::LangBreakdown<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Meta<'a> {
pub fn new() -> MetaBuilder<'a, meta_state::Empty> {
MetaBuilder::new()
}
}
impl<'a> MetaBuilder<'a, meta_state::Empty> {
pub fn new() -> Self {
MetaBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> MetaBuilder<'a, S>
where
S: meta_state::State,
S::CommitCount: meta_state::IsUnset,
{
pub fn commit_count(
mut self,
value: impl Into<crate::sh_tangled::git::ref_update::CommitCountBreakdown<'a>>,
) -> MetaBuilder<'a, meta_state::SetCommitCount<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
MetaBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> MetaBuilder<'a, S>
where
S: meta_state::State,
S::IsDefaultRef: meta_state::IsUnset,
{
pub fn is_default_ref(
mut self,
value: impl Into<bool>,
) -> MetaBuilder<'a, meta_state::SetIsDefaultRef<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
MetaBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: meta_state::State> MetaBuilder<'a, S> {
pub fn lang_breakdown(
mut self,
value: impl Into<Option<crate::sh_tangled::git::ref_update::LangBreakdown<'a>>>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_lang_breakdown(
mut self,
value: Option<crate::sh_tangled::git::ref_update::LangBreakdown<'a>>,
) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S> MetaBuilder<'a, S>
where
S: meta_state::State,
S::IsDefaultRef: meta_state::IsSet,
S::CommitCount: meta_state::IsSet,
{
pub fn build(self) -> Meta<'a> {
Meta {
commit_count: self.__unsafe_private_named.0.unwrap(),
is_default_ref: self.__unsafe_private_named.1.unwrap(),
lang_breakdown: self.__unsafe_private_named.2,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Meta<'a> {
Meta {
commit_count: self.__unsafe_private_named.0.unwrap(),
is_default_ref: self.__unsafe_private_named.1.unwrap(),
lang_breakdown: self.__unsafe_private_named.2,
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Meta<'a> {
fn nsid() -> &'static str {
"sh.tangled.git.refUpdate"
}
fn def_name() -> &'static str {
"meta"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_git_refUpdate()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}