pub mod cancel_pipeline;
pub mod status;
#[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::{Did, AtUri, Cid};
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::sh_tangled::pipeline;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct CloneOpts<S: BosStr = DefaultStr> {
pub depth: i64,
pub skip: bool,
pub submodules: bool,
#[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 = "sh.tangled.pipeline",
tag = "$type",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Pipeline<S: BosStr = DefaultStr> {
pub trigger_metadata: pipeline::TriggerMetadata<S>,
pub workflows: Vec<pipeline::Workflow<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 PipelineGetRecordOutput<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
pub uri: AtUri<S>,
pub value: Pipeline<S>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ManualTriggerData<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub inputs: Option<Vec<pipeline::Pair<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 Pair<S: BosStr = DefaultStr> {
pub key: S,
pub value: 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 PullRequestTriggerData<S: BosStr = DefaultStr> {
pub action: S,
pub source_branch: S,
pub source_sha: S,
pub target_branch: 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 PushTriggerData<S: BosStr = DefaultStr> {
pub new_sha: S,
pub old_sha: S,
pub r#ref: 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", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct TriggerMetadata<S: BosStr = DefaultStr> {
pub kind: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub manual: Option<pipeline::ManualTriggerData<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pull_request: Option<pipeline::PullRequestTriggerData<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub push: Option<pipeline::PushTriggerData<S>>,
pub repo: pipeline::TriggerRepo<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", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct TriggerRepo<S: BosStr = DefaultStr> {
pub default_branch: S,
pub did: Did<S>,
pub knot: S,
pub repo: 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", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Workflow<S: BosStr = DefaultStr> {
pub clone: pipeline::CloneOpts<S>,
pub engine: S,
pub name: S,
pub raw: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> Pipeline<S> {
pub fn uri(uri: S) -> Result<RecordUri<S, PipelineRecord>, UriError> {
RecordUri::try_from_uri(AtUri::new(uri)?)
}
}
impl<S: BosStr> LexiconSchema for CloneOpts<S> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"cloneOpts"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct PipelineRecord;
impl XrpcResp for PipelineRecord {
const NSID: &'static str = "sh.tangled.pipeline";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = PipelineGetRecordOutput<S>;
type Err = RecordError;
}
impl<S: BosStr> From<PipelineGetRecordOutput<S>> for Pipeline<S> {
fn from(output: PipelineGetRecordOutput<S>) -> Self {
output.value
}
}
impl<S: BosStr> Collection for Pipeline<S> {
const NSID: &'static str = "sh.tangled.pipeline";
type Record = PipelineRecord;
}
impl Collection for PipelineRecord {
const NSID: &'static str = "sh.tangled.pipeline";
type Record = PipelineRecord;
}
impl<S: BosStr> LexiconSchema for Pipeline<S> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ManualTriggerData<S> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"manualTriggerData"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Pair<S> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"pair"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for PullRequestTriggerData<S> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"pullRequestTriggerData"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.source_sha;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 40usize {
return Err(ConstraintError::MaxLength {
path: 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(ConstraintError::MinLength {
path: ValidationPath::from_field("source_sha"),
min: 40usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for PushTriggerData<S> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"pushTriggerData"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.new_sha;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 40usize {
return Err(ConstraintError::MaxLength {
path: 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(ConstraintError::MinLength {
path: 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(ConstraintError::MaxLength {
path: 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(ConstraintError::MinLength {
path: ValidationPath::from_field("old_sha"),
min: 40usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for TriggerMetadata<S> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"triggerMetadata"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for TriggerRepo<S> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"triggerRepo"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Workflow<S> {
fn nsid() -> &'static str {
"sh.tangled.pipeline"
}
fn def_name() -> &'static str {
"workflow"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_sh_tangled_pipeline()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
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 Skip;
type Depth;
type Submodules;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Skip = Unset;
type Depth = Unset;
type Submodules = Unset;
}
pub struct SetSkip<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSkip<St> {}
impl<St: State> State for SetSkip<St> {
type Skip = Set<members::skip>;
type Depth = St::Depth;
type Submodules = St::Submodules;
}
pub struct SetDepth<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDepth<St> {}
impl<St: State> State for SetDepth<St> {
type Skip = St::Skip;
type Depth = Set<members::depth>;
type Submodules = St::Submodules;
}
pub struct SetSubmodules<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSubmodules<St> {}
impl<St: State> State for SetSubmodules<St> {
type Skip = St::Skip;
type Depth = St::Depth;
type Submodules = Set<members::submodules>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct skip(());
pub struct depth(());
pub struct submodules(());
}
}
pub struct CloneOptsBuilder<S: BosStr, St: clone_opts_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<bool>, Option<bool>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> CloneOpts<S> {
pub fn new() -> CloneOptsBuilder<S, clone_opts_state::Empty> {
CloneOptsBuilder::new()
}
}
impl<S: BosStr> CloneOptsBuilder<S, clone_opts_state::Empty> {
pub fn new() -> Self {
CloneOptsBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> CloneOptsBuilder<S, St>
where
St: clone_opts_state::State,
St::Depth: clone_opts_state::IsUnset,
{
pub fn depth(
mut self,
value: impl Into<i64>,
) -> CloneOptsBuilder<S, clone_opts_state::SetDepth<St>> {
self._fields.0 = Option::Some(value.into());
CloneOptsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> CloneOptsBuilder<S, St>
where
St: clone_opts_state::State,
St::Skip: clone_opts_state::IsUnset,
{
pub fn skip(
mut self,
value: impl Into<bool>,
) -> CloneOptsBuilder<S, clone_opts_state::SetSkip<St>> {
self._fields.1 = Option::Some(value.into());
CloneOptsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> CloneOptsBuilder<S, St>
where
St: clone_opts_state::State,
St::Submodules: clone_opts_state::IsUnset,
{
pub fn submodules(
mut self,
value: impl Into<bool>,
) -> CloneOptsBuilder<S, clone_opts_state::SetSubmodules<St>> {
self._fields.2 = Option::Some(value.into());
CloneOptsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> CloneOptsBuilder<S, St>
where
St: clone_opts_state::State,
St::Skip: clone_opts_state::IsSet,
St::Depth: clone_opts_state::IsSet,
St::Submodules: clone_opts_state::IsSet,
{
pub fn build(self) -> CloneOpts<S> {
CloneOpts {
depth: self._fields.0.unwrap(),
skip: self._fields.1.unwrap(),
submodules: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> CloneOpts<S> {
CloneOpts {
depth: self._fields.0.unwrap(),
skip: self._fields.1.unwrap(),
submodules: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_sh_tangled_pipeline() -> 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("sh.tangled.pipeline"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cloneOpts"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("skip"), SmolStr::new_static("depth"),
SmolStr::new_static("submodules")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("depth"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("skip"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("submodules"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("main"),
LexUserType::Record(LexRecord {
key: Some(CowStr::new_static("tid")),
record: LexRecordRecord::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("triggerMetadata"),
SmolStr::new_static("workflows")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("triggerMetadata"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#triggerMetadata"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("workflows"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#workflow"),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("manualTriggerData"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("inputs"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#pair"),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pair"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("key"), SmolStr::new_static("value")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("key"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("value"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pullRequestTriggerData"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("sourceBranch"),
SmolStr::new_static("targetBranch"),
SmolStr::new_static("sourceSha"),
SmolStr::new_static("action")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("action"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("sourceBranch"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("sourceSha"),
LexObjectProperty::String(LexString {
min_length: Some(40usize),
max_length: Some(40usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("targetBranch"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pushTriggerData"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("ref"), SmolStr::new_static("newSha"),
SmolStr::new_static("oldSha")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("newSha"),
LexObjectProperty::String(LexString {
min_length: Some(40usize),
max_length: Some(40usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("oldSha"),
LexObjectProperty::String(LexString {
min_length: Some(40usize),
max_length: Some(40usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ref"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("triggerMetadata"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("kind"), SmolStr::new_static("repo")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("kind"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("manual"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#manualTriggerData"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pullRequest"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#pullRequestTriggerData"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("push"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#pushTriggerData"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("repo"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#triggerRepo"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("triggerRepo"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("knot"), SmolStr::new_static("did"),
SmolStr::new_static("repo"),
SmolStr::new_static("defaultBranch")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("defaultBranch"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("knot"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("repo"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("workflow"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("name"), SmolStr::new_static("engine"),
SmolStr::new_static("clone"), SmolStr::new_static("raw")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("clone"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#cloneOpts"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("engine"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("raw"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
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 Workflows;
type TriggerMetadata;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Workflows = Unset;
type TriggerMetadata = Unset;
}
pub struct SetWorkflows<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetWorkflows<St> {}
impl<St: State> State for SetWorkflows<St> {
type Workflows = Set<members::workflows>;
type TriggerMetadata = St::TriggerMetadata;
}
pub struct SetTriggerMetadata<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTriggerMetadata<St> {}
impl<St: State> State for SetTriggerMetadata<St> {
type Workflows = St::Workflows;
type TriggerMetadata = Set<members::trigger_metadata>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct workflows(());
pub struct trigger_metadata(());
}
}
pub struct PipelineBuilder<S: BosStr, St: pipeline_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<pipeline::TriggerMetadata<S>>, Option<Vec<pipeline::Workflow<S>>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Pipeline<S> {
pub fn new() -> PipelineBuilder<S, pipeline_state::Empty> {
PipelineBuilder::new()
}
}
impl<S: BosStr> PipelineBuilder<S, pipeline_state::Empty> {
pub fn new() -> Self {
PipelineBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> PipelineBuilder<S, St>
where
St: pipeline_state::State,
St::TriggerMetadata: pipeline_state::IsUnset,
{
pub fn trigger_metadata(
mut self,
value: impl Into<pipeline::TriggerMetadata<S>>,
) -> PipelineBuilder<S, pipeline_state::SetTriggerMetadata<St>> {
self._fields.0 = Option::Some(value.into());
PipelineBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> PipelineBuilder<S, St>
where
St: pipeline_state::State,
St::Workflows: pipeline_state::IsUnset,
{
pub fn workflows(
mut self,
value: impl Into<Vec<pipeline::Workflow<S>>>,
) -> PipelineBuilder<S, pipeline_state::SetWorkflows<St>> {
self._fields.1 = Option::Some(value.into());
PipelineBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> PipelineBuilder<S, St>
where
St: pipeline_state::State,
St::Workflows: pipeline_state::IsSet,
St::TriggerMetadata: pipeline_state::IsSet,
{
pub fn build(self) -> Pipeline<S> {
Pipeline {
trigger_metadata: self._fields.0.unwrap(),
workflows: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Pipeline<S> {
Pipeline {
trigger_metadata: self._fields.0.unwrap(),
workflows: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
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<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRepo<St> {}
impl<St: State> State for SetRepo<St> {
type Repo = Set<members::repo>;
type Kind = St::Kind;
}
pub struct SetKind<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetKind<St> {}
impl<St: State> State for SetKind<St> {
type Repo = St::Repo;
type Kind = Set<members::kind>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct repo(());
pub struct kind(());
}
}
pub struct TriggerMetadataBuilder<S: BosStr, St: trigger_metadata_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<S>,
Option<pipeline::ManualTriggerData<S>>,
Option<pipeline::PullRequestTriggerData<S>>,
Option<pipeline::PushTriggerData<S>>,
Option<pipeline::TriggerRepo<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> TriggerMetadata<S> {
pub fn new() -> TriggerMetadataBuilder<S, trigger_metadata_state::Empty> {
TriggerMetadataBuilder::new()
}
}
impl<S: BosStr> TriggerMetadataBuilder<S, trigger_metadata_state::Empty> {
pub fn new() -> Self {
TriggerMetadataBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TriggerMetadataBuilder<S, St>
where
St: trigger_metadata_state::State,
St::Kind: trigger_metadata_state::IsUnset,
{
pub fn kind(
mut self,
value: impl Into<S>,
) -> TriggerMetadataBuilder<S, trigger_metadata_state::SetKind<St>> {
self._fields.0 = Option::Some(value.into());
TriggerMetadataBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: trigger_metadata_state::State> TriggerMetadataBuilder<S, St> {
pub fn manual(
mut self,
value: impl Into<Option<pipeline::ManualTriggerData<S>>>,
) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_manual(
mut self,
value: Option<pipeline::ManualTriggerData<S>>,
) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: trigger_metadata_state::State> TriggerMetadataBuilder<S, St> {
pub fn pull_request(
mut self,
value: impl Into<Option<pipeline::PullRequestTriggerData<S>>>,
) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_pull_request(
mut self,
value: Option<pipeline::PullRequestTriggerData<S>>,
) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: trigger_metadata_state::State> TriggerMetadataBuilder<S, St> {
pub fn push(
mut self,
value: impl Into<Option<pipeline::PushTriggerData<S>>>,
) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_push(mut self, value: Option<pipeline::PushTriggerData<S>>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> TriggerMetadataBuilder<S, St>
where
St: trigger_metadata_state::State,
St::Repo: trigger_metadata_state::IsUnset,
{
pub fn repo(
mut self,
value: impl Into<pipeline::TriggerRepo<S>>,
) -> TriggerMetadataBuilder<S, trigger_metadata_state::SetRepo<St>> {
self._fields.4 = Option::Some(value.into());
TriggerMetadataBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TriggerMetadataBuilder<S, St>
where
St: trigger_metadata_state::State,
St::Repo: trigger_metadata_state::IsSet,
St::Kind: trigger_metadata_state::IsSet,
{
pub fn build(self) -> TriggerMetadata<S> {
TriggerMetadata {
kind: self._fields.0.unwrap(),
manual: self._fields.1,
pull_request: self._fields.2,
push: self._fields.3,
repo: self._fields.4.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> TriggerMetadata<S> {
TriggerMetadata {
kind: self._fields.0.unwrap(),
manual: self._fields.1,
pull_request: self._fields.2,
push: self._fields.3,
repo: self._fields.4.unwrap(),
extra_data: Some(extra_data),
}
}
}
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 Knot;
type Did;
type DefaultBranch;
type Repo;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Knot = Unset;
type Did = Unset;
type DefaultBranch = Unset;
type Repo = Unset;
}
pub struct SetKnot<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetKnot<St> {}
impl<St: State> State for SetKnot<St> {
type Knot = Set<members::knot>;
type Did = St::Did;
type DefaultBranch = St::DefaultBranch;
type Repo = St::Repo;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Knot = St::Knot;
type Did = Set<members::did>;
type DefaultBranch = St::DefaultBranch;
type Repo = St::Repo;
}
pub struct SetDefaultBranch<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDefaultBranch<St> {}
impl<St: State> State for SetDefaultBranch<St> {
type Knot = St::Knot;
type Did = St::Did;
type DefaultBranch = Set<members::default_branch>;
type Repo = St::Repo;
}
pub struct SetRepo<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRepo<St> {}
impl<St: State> State for SetRepo<St> {
type Knot = St::Knot;
type Did = St::Did;
type DefaultBranch = St::DefaultBranch;
type Repo = Set<members::repo>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct knot(());
pub struct did(());
pub struct default_branch(());
pub struct repo(());
}
}
pub struct TriggerRepoBuilder<S: BosStr, St: trigger_repo_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<Did<S>>, Option<S>, Option<S>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> TriggerRepo<S> {
pub fn new() -> TriggerRepoBuilder<S, trigger_repo_state::Empty> {
TriggerRepoBuilder::new()
}
}
impl<S: BosStr> TriggerRepoBuilder<S, trigger_repo_state::Empty> {
pub fn new() -> Self {
TriggerRepoBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TriggerRepoBuilder<S, St>
where
St: trigger_repo_state::State,
St::DefaultBranch: trigger_repo_state::IsUnset,
{
pub fn default_branch(
mut self,
value: impl Into<S>,
) -> TriggerRepoBuilder<S, trigger_repo_state::SetDefaultBranch<St>> {
self._fields.0 = Option::Some(value.into());
TriggerRepoBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TriggerRepoBuilder<S, St>
where
St: trigger_repo_state::State,
St::Did: trigger_repo_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> TriggerRepoBuilder<S, trigger_repo_state::SetDid<St>> {
self._fields.1 = Option::Some(value.into());
TriggerRepoBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TriggerRepoBuilder<S, St>
where
St: trigger_repo_state::State,
St::Knot: trigger_repo_state::IsUnset,
{
pub fn knot(
mut self,
value: impl Into<S>,
) -> TriggerRepoBuilder<S, trigger_repo_state::SetKnot<St>> {
self._fields.2 = Option::Some(value.into());
TriggerRepoBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TriggerRepoBuilder<S, St>
where
St: trigger_repo_state::State,
St::Repo: trigger_repo_state::IsUnset,
{
pub fn repo(
mut self,
value: impl Into<S>,
) -> TriggerRepoBuilder<S, trigger_repo_state::SetRepo<St>> {
self._fields.3 = Option::Some(value.into());
TriggerRepoBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TriggerRepoBuilder<S, St>
where
St: trigger_repo_state::State,
St::Knot: trigger_repo_state::IsSet,
St::Did: trigger_repo_state::IsSet,
St::DefaultBranch: trigger_repo_state::IsSet,
St::Repo: trigger_repo_state::IsSet,
{
pub fn build(self) -> TriggerRepo<S> {
TriggerRepo {
default_branch: self._fields.0.unwrap(),
did: self._fields.1.unwrap(),
knot: self._fields.2.unwrap(),
repo: self._fields.3.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> TriggerRepo<S> {
TriggerRepo {
default_branch: self._fields.0.unwrap(),
did: self._fields.1.unwrap(),
knot: self._fields.2.unwrap(),
repo: self._fields.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
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 Clone;
type Engine;
type Name;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Raw = Unset;
type Clone = Unset;
type Engine = Unset;
type Name = Unset;
}
pub struct SetRaw<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRaw<St> {}
impl<St: State> State for SetRaw<St> {
type Raw = Set<members::raw>;
type Clone = St::Clone;
type Engine = St::Engine;
type Name = St::Name;
}
pub struct SetClone<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetClone<St> {}
impl<St: State> State for SetClone<St> {
type Raw = St::Raw;
type Clone = Set<members::clone>;
type Engine = St::Engine;
type Name = St::Name;
}
pub struct SetEngine<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetEngine<St> {}
impl<St: State> State for SetEngine<St> {
type Raw = St::Raw;
type Clone = St::Clone;
type Engine = Set<members::engine>;
type Name = St::Name;
}
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 Raw = St::Raw;
type Clone = St::Clone;
type Engine = St::Engine;
type Name = Set<members::name>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct raw(());
pub struct clone(());
pub struct engine(());
pub struct name(());
}
}
pub struct WorkflowBuilder<S: BosStr, St: workflow_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<pipeline::CloneOpts<S>>, Option<S>, Option<S>, Option<S>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Workflow<S> {
pub fn new() -> WorkflowBuilder<S, workflow_state::Empty> {
WorkflowBuilder::new()
}
}
impl<S: BosStr> WorkflowBuilder<S, workflow_state::Empty> {
pub fn new() -> Self {
WorkflowBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WorkflowBuilder<S, St>
where
St: workflow_state::State,
St::Clone: workflow_state::IsUnset,
{
pub fn clone(
mut self,
value: impl Into<pipeline::CloneOpts<S>>,
) -> WorkflowBuilder<S, workflow_state::SetClone<St>> {
self._fields.0 = Option::Some(value.into());
WorkflowBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WorkflowBuilder<S, St>
where
St: workflow_state::State,
St::Engine: workflow_state::IsUnset,
{
pub fn engine(
mut self,
value: impl Into<S>,
) -> WorkflowBuilder<S, workflow_state::SetEngine<St>> {
self._fields.1 = Option::Some(value.into());
WorkflowBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WorkflowBuilder<S, St>
where
St: workflow_state::State,
St::Name: workflow_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<S>,
) -> WorkflowBuilder<S, workflow_state::SetName<St>> {
self._fields.2 = Option::Some(value.into());
WorkflowBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WorkflowBuilder<S, St>
where
St: workflow_state::State,
St::Raw: workflow_state::IsUnset,
{
pub fn raw(
mut self,
value: impl Into<S>,
) -> WorkflowBuilder<S, workflow_state::SetRaw<St>> {
self._fields.3 = Option::Some(value.into());
WorkflowBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WorkflowBuilder<S, St>
where
St: workflow_state::State,
St::Raw: workflow_state::IsSet,
St::Clone: workflow_state::IsSet,
St::Engine: workflow_state::IsSet,
St::Name: workflow_state::IsSet,
{
pub fn build(self) -> Workflow<S> {
Workflow {
clone: self._fields.0.unwrap(),
engine: self._fields.1.unwrap(),
name: self._fields.2.unwrap(),
raw: self._fields.3.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Workflow<S> {
Workflow {
clone: self._fields.0.unwrap(),
engine: self._fields.1.unwrap(),
name: self._fields.2.unwrap(),
raw: self._fields.3.unwrap(),
extra_data: Some(extra_data),
}
}
}