Skip to main content

aws_sdk_cloudextensions/operation/create_profile/
_create_profile_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// A profile represents a deployment target — the configuration context in which extensions run. Profiles own profile entries that bind specific extensions to the profile's execution environment.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateProfileOutput {
7    /// The service-generated id of the profile.
8    pub id: ::std::string::String,
9    /// The name of the profile.
10    pub name: ::std::string::String,
11    /// The Amazon Resource Name (ARN) of the profile.
12    pub arn: ::std::string::String,
13    /// The number of entries in this profile.
14    pub entry_count: i32,
15    /// When the profile was created.
16    pub created_at: ::aws_smithy_types::DateTime,
17    /// When the profile was last updated. Equal to createdAt until the first update.
18    pub updated_at: ::aws_smithy_types::DateTime,
19    /// A human-readable description of this profile's purpose or target environment.
20    pub description: ::std::option::Option<::std::string::String>,
21    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
22    pub extension_defaults: ::std::option::Option<crate::types::ExtensionDefaults>,
23    _request_id: Option<String>,
24}
25impl CreateProfileOutput {
26    /// The service-generated id of the profile.
27    pub fn id(&self) -> &str {
28        use std::ops::Deref;
29        self.id.deref()
30    }
31    /// The name of the profile.
32    pub fn name(&self) -> &str {
33        use std::ops::Deref;
34        self.name.deref()
35    }
36    /// The Amazon Resource Name (ARN) of the profile.
37    pub fn arn(&self) -> &str {
38        use std::ops::Deref;
39        self.arn.deref()
40    }
41    /// The number of entries in this profile.
42    pub fn entry_count(&self) -> i32 {
43        self.entry_count
44    }
45    /// When the profile was created.
46    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
47        &self.created_at
48    }
49    /// When the profile was last updated. Equal to createdAt until the first update.
50    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
51        &self.updated_at
52    }
53    /// A human-readable description of this profile's purpose or target environment.
54    pub fn description(&self) -> ::std::option::Option<&str> {
55        self.description.as_deref()
56    }
57    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
58    pub fn extension_defaults(&self) -> ::std::option::Option<&crate::types::ExtensionDefaults> {
59        self.extension_defaults.as_ref()
60    }
61}
62impl ::aws_types::request_id::RequestId for CreateProfileOutput {
63    fn request_id(&self) -> Option<&str> {
64        self._request_id.as_deref()
65    }
66}
67impl CreateProfileOutput {
68    /// Creates a new builder-style object to manufacture [`CreateProfileOutput`](crate::operation::create_profile::CreateProfileOutput).
69    pub fn builder() -> crate::operation::create_profile::builders::CreateProfileOutputBuilder {
70        crate::operation::create_profile::builders::CreateProfileOutputBuilder::default()
71    }
72}
73
74/// A builder for [`CreateProfileOutput`](crate::operation::create_profile::CreateProfileOutput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
76#[non_exhaustive]
77pub struct CreateProfileOutputBuilder {
78    pub(crate) id: ::std::option::Option<::std::string::String>,
79    pub(crate) name: ::std::option::Option<::std::string::String>,
80    pub(crate) arn: ::std::option::Option<::std::string::String>,
81    pub(crate) entry_count: ::std::option::Option<i32>,
82    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
83    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
84    pub(crate) description: ::std::option::Option<::std::string::String>,
85    pub(crate) extension_defaults: ::std::option::Option<crate::types::ExtensionDefaults>,
86    _request_id: Option<String>,
87}
88impl CreateProfileOutputBuilder {
89    /// The service-generated id of the profile.
90    /// This field is required.
91    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.id = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// The service-generated id of the profile.
96    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.id = input;
98        self
99    }
100    /// The service-generated id of the profile.
101    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
102        &self.id
103    }
104    /// The name of the profile.
105    /// This field is required.
106    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107        self.name = ::std::option::Option::Some(input.into());
108        self
109    }
110    /// The name of the profile.
111    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.name = input;
113        self
114    }
115    /// The name of the profile.
116    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
117        &self.name
118    }
119    /// The Amazon Resource Name (ARN) of the profile.
120    /// This field is required.
121    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.arn = ::std::option::Option::Some(input.into());
123        self
124    }
125    /// The Amazon Resource Name (ARN) of the profile.
126    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.arn = input;
128        self
129    }
130    /// The Amazon Resource Name (ARN) of the profile.
131    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
132        &self.arn
133    }
134    /// The number of entries in this profile.
135    /// This field is required.
136    pub fn entry_count(mut self, input: i32) -> Self {
137        self.entry_count = ::std::option::Option::Some(input);
138        self
139    }
140    /// The number of entries in this profile.
141    pub fn set_entry_count(mut self, input: ::std::option::Option<i32>) -> Self {
142        self.entry_count = input;
143        self
144    }
145    /// The number of entries in this profile.
146    pub fn get_entry_count(&self) -> &::std::option::Option<i32> {
147        &self.entry_count
148    }
149    /// When the profile was created.
150    /// This field is required.
151    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
152        self.created_at = ::std::option::Option::Some(input);
153        self
154    }
155    /// When the profile was created.
156    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
157        self.created_at = input;
158        self
159    }
160    /// When the profile was created.
161    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
162        &self.created_at
163    }
164    /// When the profile was last updated. Equal to createdAt until the first update.
165    /// This field is required.
166    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
167        self.updated_at = ::std::option::Option::Some(input);
168        self
169    }
170    /// When the profile was last updated. Equal to createdAt until the first update.
171    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
172        self.updated_at = input;
173        self
174    }
175    /// When the profile was last updated. Equal to createdAt until the first update.
176    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
177        &self.updated_at
178    }
179    /// A human-readable description of this profile's purpose or target environment.
180    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181        self.description = ::std::option::Option::Some(input.into());
182        self
183    }
184    /// A human-readable description of this profile's purpose or target environment.
185    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.description = input;
187        self
188    }
189    /// A human-readable description of this profile's purpose or target environment.
190    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
191        &self.description
192    }
193    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
194    pub fn extension_defaults(mut self, input: crate::types::ExtensionDefaults) -> Self {
195        self.extension_defaults = ::std::option::Option::Some(input);
196        self
197    }
198    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
199    pub fn set_extension_defaults(mut self, input: ::std::option::Option<crate::types::ExtensionDefaults>) -> Self {
200        self.extension_defaults = input;
201        self
202    }
203    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
204    pub fn get_extension_defaults(&self) -> &::std::option::Option<crate::types::ExtensionDefaults> {
205        &self.extension_defaults
206    }
207    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
208        self._request_id = Some(request_id.into());
209        self
210    }
211
212    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
213        self._request_id = request_id;
214        self
215    }
216    /// Consumes the builder and constructs a [`CreateProfileOutput`](crate::operation::create_profile::CreateProfileOutput).
217    /// This method will fail if any of the following fields are not set:
218    /// - [`id`](crate::operation::create_profile::builders::CreateProfileOutputBuilder::id)
219    /// - [`name`](crate::operation::create_profile::builders::CreateProfileOutputBuilder::name)
220    /// - [`arn`](crate::operation::create_profile::builders::CreateProfileOutputBuilder::arn)
221    /// - [`entry_count`](crate::operation::create_profile::builders::CreateProfileOutputBuilder::entry_count)
222    /// - [`created_at`](crate::operation::create_profile::builders::CreateProfileOutputBuilder::created_at)
223    /// - [`updated_at`](crate::operation::create_profile::builders::CreateProfileOutputBuilder::updated_at)
224    pub fn build(
225        self,
226    ) -> ::std::result::Result<crate::operation::create_profile::CreateProfileOutput, ::aws_smithy_types::error::operation::BuildError> {
227        ::std::result::Result::Ok(crate::operation::create_profile::CreateProfileOutput {
228            id: self.id.ok_or_else(|| {
229                ::aws_smithy_types::error::operation::BuildError::missing_field(
230                    "id",
231                    "id was not specified but it is required when building CreateProfileOutput",
232                )
233            })?,
234            name: self.name.ok_or_else(|| {
235                ::aws_smithy_types::error::operation::BuildError::missing_field(
236                    "name",
237                    "name was not specified but it is required when building CreateProfileOutput",
238                )
239            })?,
240            arn: self.arn.ok_or_else(|| {
241                ::aws_smithy_types::error::operation::BuildError::missing_field(
242                    "arn",
243                    "arn was not specified but it is required when building CreateProfileOutput",
244                )
245            })?,
246            entry_count: self.entry_count.ok_or_else(|| {
247                ::aws_smithy_types::error::operation::BuildError::missing_field(
248                    "entry_count",
249                    "entry_count was not specified but it is required when building CreateProfileOutput",
250                )
251            })?,
252            created_at: self.created_at.ok_or_else(|| {
253                ::aws_smithy_types::error::operation::BuildError::missing_field(
254                    "created_at",
255                    "created_at was not specified but it is required when building CreateProfileOutput",
256                )
257            })?,
258            updated_at: self.updated_at.ok_or_else(|| {
259                ::aws_smithy_types::error::operation::BuildError::missing_field(
260                    "updated_at",
261                    "updated_at was not specified but it is required when building CreateProfileOutput",
262                )
263            })?,
264            description: self.description,
265            extension_defaults: self.extension_defaults,
266            _request_id: self._request_id,
267        })
268    }
269}