aws_sdk_emrserverless/operation/create_application/
_create_application_output.rs

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