aws_sdk_datapipeline/operation/create_pipeline/
_create_pipeline_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the output of CreatePipeline.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreatePipelineOutput {
7    /// <p>The ID that AWS Data Pipeline assigns the newly created pipeline. For example, <code>df-06372391ZG65EXAMPLE</code>.</p>
8    pub pipeline_id: ::std::string::String,
9    _request_id: Option<String>,
10}
11impl CreatePipelineOutput {
12    /// <p>The ID that AWS Data Pipeline assigns the newly created pipeline. For example, <code>df-06372391ZG65EXAMPLE</code>.</p>
13    pub fn pipeline_id(&self) -> &str {
14        use std::ops::Deref;
15        self.pipeline_id.deref()
16    }
17}
18impl ::aws_types::request_id::RequestId for CreatePipelineOutput {
19    fn request_id(&self) -> Option<&str> {
20        self._request_id.as_deref()
21    }
22}
23impl CreatePipelineOutput {
24    /// Creates a new builder-style object to manufacture [`CreatePipelineOutput`](crate::operation::create_pipeline::CreatePipelineOutput).
25    pub fn builder() -> crate::operation::create_pipeline::builders::CreatePipelineOutputBuilder {
26        crate::operation::create_pipeline::builders::CreatePipelineOutputBuilder::default()
27    }
28}
29
30/// A builder for [`CreatePipelineOutput`](crate::operation::create_pipeline::CreatePipelineOutput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct CreatePipelineOutputBuilder {
34    pub(crate) pipeline_id: ::std::option::Option<::std::string::String>,
35    _request_id: Option<String>,
36}
37impl CreatePipelineOutputBuilder {
38    /// <p>The ID that AWS Data Pipeline assigns the newly created pipeline. For example, <code>df-06372391ZG65EXAMPLE</code>.</p>
39    /// This field is required.
40    pub fn pipeline_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.pipeline_id = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The ID that AWS Data Pipeline assigns the newly created pipeline. For example, <code>df-06372391ZG65EXAMPLE</code>.</p>
45    pub fn set_pipeline_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.pipeline_id = input;
47        self
48    }
49    /// <p>The ID that AWS Data Pipeline assigns the newly created pipeline. For example, <code>df-06372391ZG65EXAMPLE</code>.</p>
50    pub fn get_pipeline_id(&self) -> &::std::option::Option<::std::string::String> {
51        &self.pipeline_id
52    }
53    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
54        self._request_id = Some(request_id.into());
55        self
56    }
57
58    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
59        self._request_id = request_id;
60        self
61    }
62    /// Consumes the builder and constructs a [`CreatePipelineOutput`](crate::operation::create_pipeline::CreatePipelineOutput).
63    /// This method will fail if any of the following fields are not set:
64    /// - [`pipeline_id`](crate::operation::create_pipeline::builders::CreatePipelineOutputBuilder::pipeline_id)
65    pub fn build(
66        self,
67    ) -> ::std::result::Result<crate::operation::create_pipeline::CreatePipelineOutput, ::aws_smithy_types::error::operation::BuildError> {
68        ::std::result::Result::Ok(crate::operation::create_pipeline::CreatePipelineOutput {
69            pipeline_id: self.pipeline_id.ok_or_else(|| {
70                ::aws_smithy_types::error::operation::BuildError::missing_field(
71                    "pipeline_id",
72                    "pipeline_id was not specified but it is required when building CreatePipelineOutput",
73                )
74            })?,
75            _request_id: self._request_id,
76        })
77    }
78}