aws_sdk_codepipeline/operation/create_pipeline/
_create_pipeline_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the input of a <code>CreatePipeline</code> action.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreatePipelineInput {
7    /// <p>Represents the structure of actions and stages to be performed in the pipeline.</p>
8    pub pipeline: ::std::option::Option<crate::types::PipelineDeclaration>,
9    /// <p>The tags for the pipeline.</p>
10    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
11}
12impl CreatePipelineInput {
13    /// <p>Represents the structure of actions and stages to be performed in the pipeline.</p>
14    pub fn pipeline(&self) -> ::std::option::Option<&crate::types::PipelineDeclaration> {
15        self.pipeline.as_ref()
16    }
17    /// <p>The tags for the pipeline.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
20    pub fn tags(&self) -> &[crate::types::Tag] {
21        self.tags.as_deref().unwrap_or_default()
22    }
23}
24impl CreatePipelineInput {
25    /// Creates a new builder-style object to manufacture [`CreatePipelineInput`](crate::operation::create_pipeline::CreatePipelineInput).
26    pub fn builder() -> crate::operation::create_pipeline::builders::CreatePipelineInputBuilder {
27        crate::operation::create_pipeline::builders::CreatePipelineInputBuilder::default()
28    }
29}
30
31/// A builder for [`CreatePipelineInput`](crate::operation::create_pipeline::CreatePipelineInput).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct CreatePipelineInputBuilder {
35    pub(crate) pipeline: ::std::option::Option<crate::types::PipelineDeclaration>,
36    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
37}
38impl CreatePipelineInputBuilder {
39    /// <p>Represents the structure of actions and stages to be performed in the pipeline.</p>
40    /// This field is required.
41    pub fn pipeline(mut self, input: crate::types::PipelineDeclaration) -> Self {
42        self.pipeline = ::std::option::Option::Some(input);
43        self
44    }
45    /// <p>Represents the structure of actions and stages to be performed in the pipeline.</p>
46    pub fn set_pipeline(mut self, input: ::std::option::Option<crate::types::PipelineDeclaration>) -> Self {
47        self.pipeline = input;
48        self
49    }
50    /// <p>Represents the structure of actions and stages to be performed in the pipeline.</p>
51    pub fn get_pipeline(&self) -> &::std::option::Option<crate::types::PipelineDeclaration> {
52        &self.pipeline
53    }
54    /// Appends an item to `tags`.
55    ///
56    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
57    ///
58    /// <p>The tags for the pipeline.</p>
59    pub fn tags(mut self, input: crate::types::Tag) -> Self {
60        let mut v = self.tags.unwrap_or_default();
61        v.push(input);
62        self.tags = ::std::option::Option::Some(v);
63        self
64    }
65    /// <p>The tags for the pipeline.</p>
66    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
67        self.tags = input;
68        self
69    }
70    /// <p>The tags for the pipeline.</p>
71    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
72        &self.tags
73    }
74    /// Consumes the builder and constructs a [`CreatePipelineInput`](crate::operation::create_pipeline::CreatePipelineInput).
75    pub fn build(
76        self,
77    ) -> ::std::result::Result<crate::operation::create_pipeline::CreatePipelineInput, ::aws_smithy_types::error::operation::BuildError> {
78        ::std::result::Result::Ok(crate::operation::create_pipeline::CreatePipelineInput {
79            pipeline: self.pipeline,
80            tags: self.tags,
81        })
82    }
83}