pub mod cancel_pipeline;
pub mod status;
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct CloneOpts<'a> {
pub depth: i64,
pub skip: bool,
pub submodules: bool,
}
pub mod clone_opts_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 Submodules;
type Skip;
type Depth;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Submodules = Unset;
type Skip = Unset;
type Depth = Unset;
}
pub struct SetSubmodules<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSubmodules<S> {}
impl<S: State> State for SetSubmodules<S> {
type Submodules = Set<members::submodules>;
type Skip = S::Skip;
type Depth = S::Depth;
}
pub struct SetSkip<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSkip<S> {}
impl<S: State> State for SetSkip<S> {
type Submodules = S::Submodules;
type Skip = Set<members::skip>;
type Depth = S::Depth;
}
pub struct SetDepth<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDepth<S> {}
impl<S: State> State for SetDepth<S> {
type Submodules = S::Submodules;
type Skip = S::Skip;
type Depth = Set<members::depth>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct submodules(());
pub struct skip(());
pub struct depth(());
}
}
pub struct CloneOptsBuilder<'a, S: clone_opts_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<i64>,
::core::option::Option<bool>,
::core::option::Option<bool>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> CloneOpts<'a> {
pub fn new() -> CloneOptsBuilder<'a, clone_opts_state::Empty> {
CloneOptsBuilder::new()
}
}
impl<'a> CloneOptsBuilder<'a, clone_opts_state::Empty> {
pub fn new() -> Self {
CloneOptsBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> CloneOptsBuilder<'a, S>
where
S: clone_opts_state::State,
S::Depth: clone_opts_state::IsUnset,
{
pub fn depth(
mut self,
value: impl Into<i64>,
) -> CloneOptsBuilder<'a, clone_opts_state::SetDepth<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
CloneOptsBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> CloneOptsBuilder<'a, S>
where
S: clone_opts_state::State,
S::Skip: clone_opts_state::IsUnset,
{
pub fn skip(
mut self,
value: impl Into<bool>,
) -> CloneOptsBuilder<'a, clone_opts_state::SetSkip<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
CloneOptsBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> CloneOptsBuilder<'a, S>
where
S: clone_opts_state::State,
S::Submodules: clone_opts_state::IsUnset,
{
pub fn submodules(
mut self,
value: impl Into<bool>,
) -> CloneOptsBuilder<'a, clone_opts_state::SetSubmodules<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
CloneOptsBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> CloneOptsBuilder<'a, S>
where
S: clone_opts_state::State,
S::Submodules: clone_opts_state::IsSet,
S::Skip: clone_opts_state::IsSet,
S::Depth: clone_opts_state::IsSet,
{
pub fn build(self) -> CloneOpts<'a> {
CloneOpts {
depth: self.__unsafe_private_named.0.unwrap(),
skip: self.__unsafe_private_named.1.unwrap(),
submodules: self.__unsafe_private_named.2.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>,
>,
) -> CloneOpts<'a> {
CloneOpts {
depth: self.__unsafe_private_named.0.unwrap(),
skip: self.__unsafe_private_named.1.unwrap(),
submodules: self.__unsafe_private_named.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_sh_tangled_pipeline() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("sh.tangled.pipeline"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("cloneOpts"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("skip"),
::jacquard_common::deps::smol_str::SmolStr::new_static("depth"),
::jacquard_common::deps::smol_str::SmolStr::new_static("submodules")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"depth",
),
::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(
"skip",
),
::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(
"submodules",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
description: None,
default: None,
r#const: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("main"),
::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
description: None,
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("triggerMetadata"),
::jacquard_common::deps::smol_str::SmolStr::new_static("workflows")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"triggerMetadata",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#triggerMetadata",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"workflows",
),
::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("#workflow"),
}),
min_length: None,
max_length: None,
}),
);
map
},
}),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"manualTriggerData",
),
::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("#pair"),
}),
min_length: None,
max_length: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("pair"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("key"),
::jacquard_common::deps::smol_str::SmolStr::new_static("value")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"key",
),
::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(
"value",
),
::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(
"pullRequestTriggerData",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("sourceBranch"),
::jacquard_common::deps::smol_str::SmolStr::new_static("targetBranch"),
::jacquard_common::deps::smol_str::SmolStr::new_static("sourceSha"),
::jacquard_common::deps::smol_str::SmolStr::new_static("action")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"action",
),
::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(
"sourceBranch",
),
::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(
"sourceSha",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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(
"targetBranch",
),
::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(
"pushTriggerData",
),
::jacquard_lexicon::lexicon::LexUserType::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("newSha"),
::jacquard_common::deps::smol_str::SmolStr::new_static("oldSha")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"newSha",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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: None,
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: 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(
"triggerMetadata",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("kind"),
::jacquard_common::deps::smol_str::SmolStr::new_static("repo")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"kind",
),
::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(
"manual",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#manualTriggerData",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"pullRequest",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#pullRequestTriggerData",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"push",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#pushTriggerData",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"repo",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#triggerRepo"),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("triggerRepo"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("knot"),
::jacquard_common::deps::smol_str::SmolStr::new_static("did"),
::jacquard_common::deps::smol_str::SmolStr::new_static("repo"),
::jacquard_common::deps::smol_str::SmolStr::new_static("defaultBranch")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"defaultBranch",
),
::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(
"did",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
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(
"knot",
),
::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(
"repo",
),
::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("workflow"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("name"),
::jacquard_common::deps::smol_str::SmolStr::new_static("engine"),
::jacquard_common::deps::smol_str::SmolStr::new_static("clone"),
::jacquard_common::deps::smol_str::SmolStr::new_static("raw")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"clone",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#cloneOpts"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"engine",
),
::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(
"name",
),
::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(
"raw",
),
::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
},
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CloneOpts<'a> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"cloneOpts"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
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 Pipeline<'a> {
#[serde(borrow)]
pub trigger_metadata: crate::sh_tangled::pipeline::TriggerMetadata<'a>,
#[serde(borrow)]
pub workflows: Vec<crate::sh_tangled::pipeline::Workflow<'a>>,
}
pub mod pipeline_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 TriggerMetadata;
type Workflows;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type TriggerMetadata = Unset;
type Workflows = Unset;
}
pub struct SetTriggerMetadata<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTriggerMetadata<S> {}
impl<S: State> State for SetTriggerMetadata<S> {
type TriggerMetadata = Set<members::trigger_metadata>;
type Workflows = S::Workflows;
}
pub struct SetWorkflows<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetWorkflows<S> {}
impl<S: State> State for SetWorkflows<S> {
type TriggerMetadata = S::TriggerMetadata;
type Workflows = Set<members::workflows>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct trigger_metadata(());
pub struct workflows(());
}
}
pub struct PipelineBuilder<'a, S: pipeline_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::sh_tangled::pipeline::TriggerMetadata<'a>>,
::core::option::Option<Vec<crate::sh_tangled::pipeline::Workflow<'a>>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Pipeline<'a> {
pub fn new() -> PipelineBuilder<'a, pipeline_state::Empty> {
PipelineBuilder::new()
}
}
impl<'a> PipelineBuilder<'a, pipeline_state::Empty> {
pub fn new() -> Self {
PipelineBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PipelineBuilder<'a, S>
where
S: pipeline_state::State,
S::TriggerMetadata: pipeline_state::IsUnset,
{
pub fn trigger_metadata(
mut self,
value: impl Into<crate::sh_tangled::pipeline::TriggerMetadata<'a>>,
) -> PipelineBuilder<'a, pipeline_state::SetTriggerMetadata<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
PipelineBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PipelineBuilder<'a, S>
where
S: pipeline_state::State,
S::Workflows: pipeline_state::IsUnset,
{
pub fn workflows(
mut self,
value: impl Into<Vec<crate::sh_tangled::pipeline::Workflow<'a>>>,
) -> PipelineBuilder<'a, pipeline_state::SetWorkflows<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
PipelineBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PipelineBuilder<'a, S>
where
S: pipeline_state::State,
S::TriggerMetadata: pipeline_state::IsSet,
S::Workflows: pipeline_state::IsSet,
{
pub fn build(self) -> Pipeline<'a> {
Pipeline {
trigger_metadata: self.__unsafe_private_named.0.unwrap(),
workflows: 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>,
>,
) -> Pipeline<'a> {
Pipeline {
trigger_metadata: self.__unsafe_private_named.0.unwrap(),
workflows: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> Pipeline<'a> {
pub fn uri(
uri: impl Into<jacquard_common::CowStr<'a>>,
) -> Result<
jacquard_common::types::uri::RecordUri<'a, PipelineRecord>,
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 PipelineGetRecordOutput<'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: Pipeline<'a>,
}
impl From<PipelineGetRecordOutput<'_>> for Pipeline<'_> {
fn from(output: PipelineGetRecordOutput<'_>) -> Self {
use jacquard_common::IntoStatic;
output.value.into_static()
}
}
impl jacquard_common::types::collection::Collection for Pipeline<'_> {
const NSID: &'static str = "sh.tangled.pipeline";
type Record = PipelineRecord;
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct PipelineRecord;
impl jacquard_common::xrpc::XrpcResp for PipelineRecord {
const NSID: &'static str = "sh.tangled.pipeline";
const ENCODING: &'static str = "application/json";
type Output<'de> = PipelineGetRecordOutput<'de>;
type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
}
impl jacquard_common::types::collection::Collection for PipelineRecord {
const NSID: &'static str = "sh.tangled.pipeline";
type Record = PipelineRecord;
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Pipeline<'a> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
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 ManualTriggerData<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub inputs: std::option::Option<Vec<crate::sh_tangled::pipeline::Pair<'a>>>,
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ManualTriggerData<'a> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"manualTriggerData"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
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 Pair<'a> {
#[serde(borrow)]
pub key: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub value: jacquard_common::CowStr<'a>,
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Pair<'a> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"pair"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
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 PullRequestTriggerData<'a> {
#[serde(borrow)]
pub action: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub source_branch: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub source_sha: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub target_branch: jacquard_common::CowStr<'a>,
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PullRequestTriggerData<'a> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"pullRequestTriggerData"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
{
let value = &self.source_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(
"source_sha",
),
max: 40usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.source_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(
"source_sha",
),
min: 40usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic,
Default
)]
#[serde(rename_all = "camelCase")]
pub struct PushTriggerData<'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>,
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PushTriggerData<'a> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"pushTriggerData"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
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()),
});
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct TriggerMetadata<'a> {
#[serde(borrow)]
pub kind: jacquard_common::CowStr<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub manual: std::option::Option<crate::sh_tangled::pipeline::ManualTriggerData<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub pull_request: std::option::Option<
crate::sh_tangled::pipeline::PullRequestTriggerData<'a>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub push: std::option::Option<crate::sh_tangled::pipeline::PushTriggerData<'a>>,
#[serde(borrow)]
pub repo: crate::sh_tangled::pipeline::TriggerRepo<'a>,
}
pub mod trigger_metadata_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 Repo;
type Kind;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Repo = Unset;
type Kind = Unset;
}
pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRepo<S> {}
impl<S: State> State for SetRepo<S> {
type Repo = Set<members::repo>;
type Kind = S::Kind;
}
pub struct SetKind<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetKind<S> {}
impl<S: State> State for SetKind<S> {
type Repo = S::Repo;
type Kind = Set<members::kind>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct repo(());
pub struct kind(());
}
}
pub struct TriggerMetadataBuilder<'a, S: trigger_metadata_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<crate::sh_tangled::pipeline::ManualTriggerData<'a>>,
::core::option::Option<crate::sh_tangled::pipeline::PullRequestTriggerData<'a>>,
::core::option::Option<crate::sh_tangled::pipeline::PushTriggerData<'a>>,
::core::option::Option<crate::sh_tangled::pipeline::TriggerRepo<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> TriggerMetadata<'a> {
pub fn new() -> TriggerMetadataBuilder<'a, trigger_metadata_state::Empty> {
TriggerMetadataBuilder::new()
}
}
impl<'a> TriggerMetadataBuilder<'a, trigger_metadata_state::Empty> {
pub fn new() -> Self {
TriggerMetadataBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TriggerMetadataBuilder<'a, S>
where
S: trigger_metadata_state::State,
S::Kind: trigger_metadata_state::IsUnset,
{
pub fn kind(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> TriggerMetadataBuilder<'a, trigger_metadata_state::SetKind<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
TriggerMetadataBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: trigger_metadata_state::State> TriggerMetadataBuilder<'a, S> {
pub fn manual(
mut self,
value: impl Into<Option<crate::sh_tangled::pipeline::ManualTriggerData<'a>>>,
) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_manual(
mut self,
value: Option<crate::sh_tangled::pipeline::ManualTriggerData<'a>>,
) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S: trigger_metadata_state::State> TriggerMetadataBuilder<'a, S> {
pub fn pull_request(
mut self,
value: impl Into<Option<crate::sh_tangled::pipeline::PullRequestTriggerData<'a>>>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_pull_request(
mut self,
value: Option<crate::sh_tangled::pipeline::PullRequestTriggerData<'a>>,
) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S: trigger_metadata_state::State> TriggerMetadataBuilder<'a, S> {
pub fn push(
mut self,
value: impl Into<Option<crate::sh_tangled::pipeline::PushTriggerData<'a>>>,
) -> Self {
self.__unsafe_private_named.3 = value.into();
self
}
pub fn maybe_push(
mut self,
value: Option<crate::sh_tangled::pipeline::PushTriggerData<'a>>,
) -> Self {
self.__unsafe_private_named.3 = value;
self
}
}
impl<'a, S> TriggerMetadataBuilder<'a, S>
where
S: trigger_metadata_state::State,
S::Repo: trigger_metadata_state::IsUnset,
{
pub fn repo(
mut self,
value: impl Into<crate::sh_tangled::pipeline::TriggerRepo<'a>>,
) -> TriggerMetadataBuilder<'a, trigger_metadata_state::SetRepo<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
TriggerMetadataBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TriggerMetadataBuilder<'a, S>
where
S: trigger_metadata_state::State,
S::Repo: trigger_metadata_state::IsSet,
S::Kind: trigger_metadata_state::IsSet,
{
pub fn build(self) -> TriggerMetadata<'a> {
TriggerMetadata {
kind: self.__unsafe_private_named.0.unwrap(),
manual: self.__unsafe_private_named.1,
pull_request: self.__unsafe_private_named.2,
push: self.__unsafe_private_named.3,
repo: self.__unsafe_private_named.4.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>,
>,
) -> TriggerMetadata<'a> {
TriggerMetadata {
kind: self.__unsafe_private_named.0.unwrap(),
manual: self.__unsafe_private_named.1,
pull_request: self.__unsafe_private_named.2,
push: self.__unsafe_private_named.3,
repo: self.__unsafe_private_named.4.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TriggerMetadata<'a> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"triggerMetadata"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
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 TriggerRepo<'a> {
#[serde(borrow)]
pub default_branch: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub did: jacquard_common::types::string::Did<'a>,
#[serde(borrow)]
pub knot: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub repo: jacquard_common::CowStr<'a>,
}
pub mod trigger_repo_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 Did;
type Repo;
type Knot;
type DefaultBranch;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
type Repo = Unset;
type Knot = Unset;
type DefaultBranch = Unset;
}
pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Did = Set<members::did>;
type Repo = S::Repo;
type Knot = S::Knot;
type DefaultBranch = S::DefaultBranch;
}
pub struct SetRepo<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRepo<S> {}
impl<S: State> State for SetRepo<S> {
type Did = S::Did;
type Repo = Set<members::repo>;
type Knot = S::Knot;
type DefaultBranch = S::DefaultBranch;
}
pub struct SetKnot<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetKnot<S> {}
impl<S: State> State for SetKnot<S> {
type Did = S::Did;
type Repo = S::Repo;
type Knot = Set<members::knot>;
type DefaultBranch = S::DefaultBranch;
}
pub struct SetDefaultBranch<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDefaultBranch<S> {}
impl<S: State> State for SetDefaultBranch<S> {
type Did = S::Did;
type Repo = S::Repo;
type Knot = S::Knot;
type DefaultBranch = Set<members::default_branch>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct repo(());
pub struct knot(());
pub struct default_branch(());
}
}
pub struct TriggerRepoBuilder<'a, S: trigger_repo_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::Did<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> TriggerRepo<'a> {
pub fn new() -> TriggerRepoBuilder<'a, trigger_repo_state::Empty> {
TriggerRepoBuilder::new()
}
}
impl<'a> TriggerRepoBuilder<'a, trigger_repo_state::Empty> {
pub fn new() -> Self {
TriggerRepoBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TriggerRepoBuilder<'a, S>
where
S: trigger_repo_state::State,
S::DefaultBranch: trigger_repo_state::IsUnset,
{
pub fn default_branch(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> TriggerRepoBuilder<'a, trigger_repo_state::SetDefaultBranch<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
TriggerRepoBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TriggerRepoBuilder<'a, S>
where
S: trigger_repo_state::State,
S::Did: trigger_repo_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<jacquard_common::types::string::Did<'a>>,
) -> TriggerRepoBuilder<'a, trigger_repo_state::SetDid<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
TriggerRepoBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TriggerRepoBuilder<'a, S>
where
S: trigger_repo_state::State,
S::Knot: trigger_repo_state::IsUnset,
{
pub fn knot(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> TriggerRepoBuilder<'a, trigger_repo_state::SetKnot<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
TriggerRepoBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TriggerRepoBuilder<'a, S>
where
S: trigger_repo_state::State,
S::Repo: trigger_repo_state::IsUnset,
{
pub fn repo(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> TriggerRepoBuilder<'a, trigger_repo_state::SetRepo<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
TriggerRepoBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TriggerRepoBuilder<'a, S>
where
S: trigger_repo_state::State,
S::Did: trigger_repo_state::IsSet,
S::Repo: trigger_repo_state::IsSet,
S::Knot: trigger_repo_state::IsSet,
S::DefaultBranch: trigger_repo_state::IsSet,
{
pub fn build(self) -> TriggerRepo<'a> {
TriggerRepo {
default_branch: self.__unsafe_private_named.0.unwrap(),
did: self.__unsafe_private_named.1.unwrap(),
knot: self.__unsafe_private_named.2.unwrap(),
repo: self.__unsafe_private_named.3.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>,
>,
) -> TriggerRepo<'a> {
TriggerRepo {
default_branch: self.__unsafe_private_named.0.unwrap(),
did: self.__unsafe_private_named.1.unwrap(),
knot: self.__unsafe_private_named.2.unwrap(),
repo: self.__unsafe_private_named.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TriggerRepo<'a> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"triggerRepo"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
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 Workflow<'a> {
#[serde(borrow)]
pub clone: crate::sh_tangled::pipeline::CloneOpts<'a>,
#[serde(borrow)]
pub engine: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub name: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub raw: jacquard_common::CowStr<'a>,
}
pub mod workflow_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 Raw;
type Engine;
type Name;
type Clone;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Raw = Unset;
type Engine = Unset;
type Name = Unset;
type Clone = Unset;
}
pub struct SetRaw<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRaw<S> {}
impl<S: State> State for SetRaw<S> {
type Raw = Set<members::raw>;
type Engine = S::Engine;
type Name = S::Name;
type Clone = S::Clone;
}
pub struct SetEngine<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetEngine<S> {}
impl<S: State> State for SetEngine<S> {
type Raw = S::Raw;
type Engine = Set<members::engine>;
type Name = S::Name;
type Clone = S::Clone;
}
pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetName<S> {}
impl<S: State> State for SetName<S> {
type Raw = S::Raw;
type Engine = S::Engine;
type Name = Set<members::name>;
type Clone = S::Clone;
}
pub struct SetClone<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetClone<S> {}
impl<S: State> State for SetClone<S> {
type Raw = S::Raw;
type Engine = S::Engine;
type Name = S::Name;
type Clone = Set<members::clone>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct raw(());
pub struct engine(());
pub struct name(());
pub struct clone(());
}
}
pub struct WorkflowBuilder<'a, S: workflow_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::sh_tangled::pipeline::CloneOpts<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Workflow<'a> {
pub fn new() -> WorkflowBuilder<'a, workflow_state::Empty> {
WorkflowBuilder::new()
}
}
impl<'a> WorkflowBuilder<'a, workflow_state::Empty> {
pub fn new() -> Self {
WorkflowBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> WorkflowBuilder<'a, S>
where
S: workflow_state::State,
S::Clone: workflow_state::IsUnset,
{
pub fn clone(
mut self,
value: impl Into<crate::sh_tangled::pipeline::CloneOpts<'a>>,
) -> WorkflowBuilder<'a, workflow_state::SetClone<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
WorkflowBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> WorkflowBuilder<'a, S>
where
S: workflow_state::State,
S::Engine: workflow_state::IsUnset,
{
pub fn engine(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> WorkflowBuilder<'a, workflow_state::SetEngine<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
WorkflowBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> WorkflowBuilder<'a, S>
where
S: workflow_state::State,
S::Name: workflow_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> WorkflowBuilder<'a, workflow_state::SetName<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
WorkflowBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> WorkflowBuilder<'a, S>
where
S: workflow_state::State,
S::Raw: workflow_state::IsUnset,
{
pub fn raw(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> WorkflowBuilder<'a, workflow_state::SetRaw<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
WorkflowBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> WorkflowBuilder<'a, S>
where
S: workflow_state::State,
S::Raw: workflow_state::IsSet,
S::Engine: workflow_state::IsSet,
S::Name: workflow_state::IsSet,
S::Clone: workflow_state::IsSet,
{
pub fn build(self) -> Workflow<'a> {
Workflow {
clone: self.__unsafe_private_named.0.unwrap(),
engine: self.__unsafe_private_named.1.unwrap(),
name: self.__unsafe_private_named.2.unwrap(),
raw: self.__unsafe_private_named.3.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>,
>,
) -> Workflow<'a> {
Workflow {
clone: self.__unsafe_private_named.0.unwrap(),
engine: self.__unsafe_private_named.1.unwrap(),
name: self.__unsafe_private_named.2.unwrap(),
raw: self.__unsafe_private_named.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Workflow<'a> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"workflow"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}