Skip to main content

aws_sdk_supplychain/operation/create_data_integration_flow/
_create_data_integration_flow_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The response parameters for CreateDataIntegrationFlow.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateDataIntegrationFlowOutput {
7    /// <p>The Amazon Web Services Supply Chain instance identifier.</p>
8    pub instance_id: ::std::string::String,
9    /// <p>The name of the DataIntegrationFlow created.</p>
10    pub name: ::std::string::String,
11    _request_id: Option<String>,
12}
13impl CreateDataIntegrationFlowOutput {
14    /// <p>The Amazon Web Services Supply Chain instance identifier.</p>
15    pub fn instance_id(&self) -> &str {
16        use std::ops::Deref;
17        self.instance_id.deref()
18    }
19    /// <p>The name of the DataIntegrationFlow created.</p>
20    pub fn name(&self) -> &str {
21        use std::ops::Deref;
22        self.name.deref()
23    }
24}
25impl ::aws_types::request_id::RequestId for CreateDataIntegrationFlowOutput {
26    fn request_id(&self) -> Option<&str> {
27        self._request_id.as_deref()
28    }
29}
30impl CreateDataIntegrationFlowOutput {
31    /// Creates a new builder-style object to manufacture [`CreateDataIntegrationFlowOutput`](crate::operation::create_data_integration_flow::CreateDataIntegrationFlowOutput).
32    pub fn builder() -> crate::operation::create_data_integration_flow::builders::CreateDataIntegrationFlowOutputBuilder {
33        crate::operation::create_data_integration_flow::builders::CreateDataIntegrationFlowOutputBuilder::default()
34    }
35}
36
37/// A builder for [`CreateDataIntegrationFlowOutput`](crate::operation::create_data_integration_flow::CreateDataIntegrationFlowOutput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct CreateDataIntegrationFlowOutputBuilder {
41    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
42    pub(crate) name: ::std::option::Option<::std::string::String>,
43    _request_id: Option<String>,
44}
45impl CreateDataIntegrationFlowOutputBuilder {
46    /// <p>The Amazon Web Services Supply Chain instance identifier.</p>
47    /// This field is required.
48    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49        self.instance_id = ::std::option::Option::Some(input.into());
50        self
51    }
52    /// <p>The Amazon Web Services Supply Chain instance identifier.</p>
53    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54        self.instance_id = input;
55        self
56    }
57    /// <p>The Amazon Web Services Supply Chain instance identifier.</p>
58    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
59        &self.instance_id
60    }
61    /// <p>The name of the DataIntegrationFlow created.</p>
62    /// This field is required.
63    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.name = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// <p>The name of the DataIntegrationFlow created.</p>
68    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69        self.name = input;
70        self
71    }
72    /// <p>The name of the DataIntegrationFlow created.</p>
73    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
74        &self.name
75    }
76    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
77        self._request_id = Some(request_id.into());
78        self
79    }
80
81    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
82        self._request_id = request_id;
83        self
84    }
85    /// Consumes the builder and constructs a [`CreateDataIntegrationFlowOutput`](crate::operation::create_data_integration_flow::CreateDataIntegrationFlowOutput).
86    /// This method will fail if any of the following fields are not set:
87    /// - [`instance_id`](crate::operation::create_data_integration_flow::builders::CreateDataIntegrationFlowOutputBuilder::instance_id)
88    /// - [`name`](crate::operation::create_data_integration_flow::builders::CreateDataIntegrationFlowOutputBuilder::name)
89    pub fn build(
90        self,
91    ) -> ::std::result::Result<
92        crate::operation::create_data_integration_flow::CreateDataIntegrationFlowOutput,
93        ::aws_smithy_types::error::operation::BuildError,
94    > {
95        ::std::result::Result::Ok(crate::operation::create_data_integration_flow::CreateDataIntegrationFlowOutput {
96            instance_id: self.instance_id.ok_or_else(|| {
97                ::aws_smithy_types::error::operation::BuildError::missing_field(
98                    "instance_id",
99                    "instance_id was not specified but it is required when building CreateDataIntegrationFlowOutput",
100                )
101            })?,
102            name: self.name.ok_or_else(|| {
103                ::aws_smithy_types::error::operation::BuildError::missing_field(
104                    "name",
105                    "name was not specified but it is required when building CreateDataIntegrationFlowOutput",
106                )
107            })?,
108            _request_id: self._request_id,
109        })
110    }
111}