aws_sdk_codepipeline/operation/create_pipeline/
_create_pipeline_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the output of a <code>CreatePipeline</code> action.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreatePipelineOutput {
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>Specifies the tags applied to the pipeline.</p>
10    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
11    _request_id: Option<String>,
12}
13impl CreatePipelineOutput {
14    /// <p>Represents the structure of actions and stages to be performed in the pipeline.</p>
15    pub fn pipeline(&self) -> ::std::option::Option<&crate::types::PipelineDeclaration> {
16        self.pipeline.as_ref()
17    }
18    /// <p>Specifies the tags applied to the pipeline.</p>
19    ///
20    /// 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()`.
21    pub fn tags(&self) -> &[crate::types::Tag] {
22        self.tags.as_deref().unwrap_or_default()
23    }
24}
25impl ::aws_types::request_id::RequestId for CreatePipelineOutput {
26    fn request_id(&self) -> Option<&str> {
27        self._request_id.as_deref()
28    }
29}
30impl CreatePipelineOutput {
31    /// Creates a new builder-style object to manufacture [`CreatePipelineOutput`](crate::operation::create_pipeline::CreatePipelineOutput).
32    pub fn builder() -> crate::operation::create_pipeline::builders::CreatePipelineOutputBuilder {
33        crate::operation::create_pipeline::builders::CreatePipelineOutputBuilder::default()
34    }
35}
36
37/// A builder for [`CreatePipelineOutput`](crate::operation::create_pipeline::CreatePipelineOutput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct CreatePipelineOutputBuilder {
41    pub(crate) pipeline: ::std::option::Option<crate::types::PipelineDeclaration>,
42    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
43    _request_id: Option<String>,
44}
45impl CreatePipelineOutputBuilder {
46    /// <p>Represents the structure of actions and stages to be performed in the pipeline.</p>
47    pub fn pipeline(mut self, input: crate::types::PipelineDeclaration) -> Self {
48        self.pipeline = ::std::option::Option::Some(input);
49        self
50    }
51    /// <p>Represents the structure of actions and stages to be performed in the pipeline.</p>
52    pub fn set_pipeline(mut self, input: ::std::option::Option<crate::types::PipelineDeclaration>) -> Self {
53        self.pipeline = input;
54        self
55    }
56    /// <p>Represents the structure of actions and stages to be performed in the pipeline.</p>
57    pub fn get_pipeline(&self) -> &::std::option::Option<crate::types::PipelineDeclaration> {
58        &self.pipeline
59    }
60    /// Appends an item to `tags`.
61    ///
62    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
63    ///
64    /// <p>Specifies the tags applied to the pipeline.</p>
65    pub fn tags(mut self, input: crate::types::Tag) -> Self {
66        let mut v = self.tags.unwrap_or_default();
67        v.push(input);
68        self.tags = ::std::option::Option::Some(v);
69        self
70    }
71    /// <p>Specifies the tags applied to the pipeline.</p>
72    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
73        self.tags = input;
74        self
75    }
76    /// <p>Specifies the tags applied to the pipeline.</p>
77    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
78        &self.tags
79    }
80    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
81        self._request_id = Some(request_id.into());
82        self
83    }
84
85    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
86        self._request_id = request_id;
87        self
88    }
89    /// Consumes the builder and constructs a [`CreatePipelineOutput`](crate::operation::create_pipeline::CreatePipelineOutput).
90    pub fn build(self) -> crate::operation::create_pipeline::CreatePipelineOutput {
91        crate::operation::create_pipeline::CreatePipelineOutput {
92            pipeline: self.pipeline,
93            tags: self.tags,
94            _request_id: self._request_id,
95        }
96    }
97}