aws_sdk_codestar/operation/create_project/
_create_project_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 CreateProjectOutput {
6    /// <p>The ID of the project.</p>
7    pub id: ::std::string::String,
8    /// <p>The Amazon Resource Name (ARN) of the created project.</p>
9    pub arn: ::std::string::String,
10    /// <p>A user- or system-generated token that identifies the entity that requested project creation.</p>
11    pub client_request_token: ::std::option::Option<::std::string::String>,
12    /// <p>Reserved for future use.</p>
13    pub project_template_id: ::std::option::Option<::std::string::String>,
14    _request_id: Option<String>,
15}
16impl CreateProjectOutput {
17    /// <p>The ID of the project.</p>
18    pub fn id(&self) -> &str {
19        use std::ops::Deref;
20        self.id.deref()
21    }
22    /// <p>The Amazon Resource Name (ARN) of the created project.</p>
23    pub fn arn(&self) -> &str {
24        use std::ops::Deref;
25        self.arn.deref()
26    }
27    /// <p>A user- or system-generated token that identifies the entity that requested project creation.</p>
28    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
29        self.client_request_token.as_deref()
30    }
31    /// <p>Reserved for future use.</p>
32    pub fn project_template_id(&self) -> ::std::option::Option<&str> {
33        self.project_template_id.as_deref()
34    }
35}
36impl ::aws_types::request_id::RequestId for CreateProjectOutput {
37    fn request_id(&self) -> Option<&str> {
38        self._request_id.as_deref()
39    }
40}
41impl CreateProjectOutput {
42    /// Creates a new builder-style object to manufacture [`CreateProjectOutput`](crate::operation::create_project::CreateProjectOutput).
43    pub fn builder() -> crate::operation::create_project::builders::CreateProjectOutputBuilder {
44        crate::operation::create_project::builders::CreateProjectOutputBuilder::default()
45    }
46}
47
48/// A builder for [`CreateProjectOutput`](crate::operation::create_project::CreateProjectOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CreateProjectOutputBuilder {
52    pub(crate) id: ::std::option::Option<::std::string::String>,
53    pub(crate) arn: ::std::option::Option<::std::string::String>,
54    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
55    pub(crate) project_template_id: ::std::option::Option<::std::string::String>,
56    _request_id: Option<String>,
57}
58impl CreateProjectOutputBuilder {
59    /// <p>The ID of the project.</p>
60    /// This field is required.
61    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The ID of the project.</p>
66    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.id = input;
68        self
69    }
70    /// <p>The ID of the project.</p>
71    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.id
73    }
74    /// <p>The Amazon Resource Name (ARN) of the created project.</p>
75    /// This field is required.
76    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.arn = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The Amazon Resource Name (ARN) of the created project.</p>
81    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.arn = input;
83        self
84    }
85    /// <p>The Amazon Resource Name (ARN) of the created project.</p>
86    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
87        &self.arn
88    }
89    /// <p>A user- or system-generated token that identifies the entity that requested project creation.</p>
90    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.client_request_token = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>A user- or system-generated token that identifies the entity that requested project creation.</p>
95    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.client_request_token = input;
97        self
98    }
99    /// <p>A user- or system-generated token that identifies the entity that requested project creation.</p>
100    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
101        &self.client_request_token
102    }
103    /// <p>Reserved for future use.</p>
104    pub fn project_template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.project_template_id = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>Reserved for future use.</p>
109    pub fn set_project_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.project_template_id = input;
111        self
112    }
113    /// <p>Reserved for future use.</p>
114    pub fn get_project_template_id(&self) -> &::std::option::Option<::std::string::String> {
115        &self.project_template_id
116    }
117    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
118        self._request_id = Some(request_id.into());
119        self
120    }
121
122    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
123        self._request_id = request_id;
124        self
125    }
126    /// Consumes the builder and constructs a [`CreateProjectOutput`](crate::operation::create_project::CreateProjectOutput).
127    /// This method will fail if any of the following fields are not set:
128    /// - [`id`](crate::operation::create_project::builders::CreateProjectOutputBuilder::id)
129    /// - [`arn`](crate::operation::create_project::builders::CreateProjectOutputBuilder::arn)
130    pub fn build(
131        self,
132    ) -> ::std::result::Result<crate::operation::create_project::CreateProjectOutput, ::aws_smithy_types::error::operation::BuildError> {
133        ::std::result::Result::Ok(crate::operation::create_project::CreateProjectOutput {
134            id: self.id.ok_or_else(|| {
135                ::aws_smithy_types::error::operation::BuildError::missing_field(
136                    "id",
137                    "id was not specified but it is required when building CreateProjectOutput",
138                )
139            })?,
140            arn: self.arn.ok_or_else(|| {
141                ::aws_smithy_types::error::operation::BuildError::missing_field(
142                    "arn",
143                    "arn was not specified but it is required when building CreateProjectOutput",
144                )
145            })?,
146            client_request_token: self.client_request_token,
147            project_template_id: self.project_template_id,
148            _request_id: self._request_id,
149        })
150    }
151}