Skip to main content

aws_sdk_cloudextensions/operation/create_profile/
_create_profile_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// The properties for the new profile.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateProfileInput {
7    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
8    pub client_token: ::std::option::Option<::std::string::String>,
9    /// The name of the profile. Must be unique within the account.
10    pub name: ::std::option::Option<::std::string::String>,
11    /// A human-readable description of the profile's purpose or target environment.
12    pub description: ::std::option::Option<::std::string::String>,
13    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
14    pub extension_defaults: ::std::option::Option<crate::types::ExtensionDefaults>,
15    /// Tags to assign to the profile.
16    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
17}
18impl CreateProfileInput {
19    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
20    pub fn client_token(&self) -> ::std::option::Option<&str> {
21        self.client_token.as_deref()
22    }
23    /// The name of the profile. Must be unique within the account.
24    pub fn name(&self) -> ::std::option::Option<&str> {
25        self.name.as_deref()
26    }
27    /// A human-readable description of the profile's purpose or target environment.
28    pub fn description(&self) -> ::std::option::Option<&str> {
29        self.description.as_deref()
30    }
31    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
32    pub fn extension_defaults(&self) -> ::std::option::Option<&crate::types::ExtensionDefaults> {
33        self.extension_defaults.as_ref()
34    }
35    /// Tags to assign to the profile.
36    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
37        self.tags.as_ref()
38    }
39}
40impl CreateProfileInput {
41    /// Creates a new builder-style object to manufacture [`CreateProfileInput`](crate::operation::create_profile::CreateProfileInput).
42    pub fn builder() -> crate::operation::create_profile::builders::CreateProfileInputBuilder {
43        crate::operation::create_profile::builders::CreateProfileInputBuilder::default()
44    }
45}
46
47/// A builder for [`CreateProfileInput`](crate::operation::create_profile::CreateProfileInput).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct CreateProfileInputBuilder {
51    pub(crate) client_token: ::std::option::Option<::std::string::String>,
52    pub(crate) name: ::std::option::Option<::std::string::String>,
53    pub(crate) description: ::std::option::Option<::std::string::String>,
54    pub(crate) extension_defaults: ::std::option::Option<crate::types::ExtensionDefaults>,
55    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
56}
57impl CreateProfileInputBuilder {
58    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
59    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.client_token = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
64    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.client_token = input;
66        self
67    }
68    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
69    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
70        &self.client_token
71    }
72    /// The name of the profile. Must be unique within the account.
73    /// This field is required.
74    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.name = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// The name of the profile. Must be unique within the account.
79    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.name = input;
81        self
82    }
83    /// The name of the profile. Must be unique within the account.
84    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
85        &self.name
86    }
87    /// A human-readable description of the profile's purpose or target environment.
88    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.description = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// A human-readable description of the profile's purpose or target environment.
93    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.description = input;
95        self
96    }
97    /// A human-readable description of the profile's purpose or target environment.
98    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
99        &self.description
100    }
101    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
102    pub fn extension_defaults(mut self, input: crate::types::ExtensionDefaults) -> Self {
103        self.extension_defaults = ::std::option::Option::Some(input);
104        self
105    }
106    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
107    pub fn set_extension_defaults(mut self, input: ::std::option::Option<crate::types::ExtensionDefaults>) -> Self {
108        self.extension_defaults = input;
109        self
110    }
111    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
112    pub fn get_extension_defaults(&self) -> &::std::option::Option<crate::types::ExtensionDefaults> {
113        &self.extension_defaults
114    }
115    /// Adds a key-value pair to `tags`.
116    ///
117    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
118    ///
119    /// Tags to assign to the profile.
120    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
121        let mut hash_map = self.tags.unwrap_or_default();
122        hash_map.insert(k.into(), v.into());
123        self.tags = ::std::option::Option::Some(hash_map);
124        self
125    }
126    /// Tags to assign to the profile.
127    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
128        self.tags = input;
129        self
130    }
131    /// Tags to assign to the profile.
132    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
133        &self.tags
134    }
135    /// Consumes the builder and constructs a [`CreateProfileInput`](crate::operation::create_profile::CreateProfileInput).
136    pub fn build(
137        self,
138    ) -> ::std::result::Result<crate::operation::create_profile::CreateProfileInput, ::aws_smithy_types::error::operation::BuildError> {
139        ::std::result::Result::Ok(crate::operation::create_profile::CreateProfileInput {
140            client_token: self.client_token,
141            name: self.name,
142            description: self.description,
143            extension_defaults: self.extension_defaults,
144            tags: self.tags,
145        })
146    }
147}