Skip to main content

aws_sdk_cloudextensions/operation/update_profile/
_update_profile_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// The identifier of the profile to update and the fields to change.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateProfileInput {
7    /// The identifier (id or name) of the profile to update.
8    pub identifier: ::std::option::Option<::std::string::String>,
9    /// The new 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. An empty string removes the description.
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}
16impl UpdateProfileInput {
17    /// The identifier (id or name) of the profile to update.
18    pub fn identifier(&self) -> ::std::option::Option<&str> {
19        self.identifier.as_deref()
20    }
21    /// The new name of the profile. Must be unique within the account.
22    pub fn name(&self) -> ::std::option::Option<&str> {
23        self.name.as_deref()
24    }
25    /// A human-readable description of the profile's purpose or target environment. An empty string removes the description.
26    pub fn description(&self) -> ::std::option::Option<&str> {
27        self.description.as_deref()
28    }
29    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
30    pub fn extension_defaults(&self) -> ::std::option::Option<&crate::types::ExtensionDefaults> {
31        self.extension_defaults.as_ref()
32    }
33}
34impl UpdateProfileInput {
35    /// Creates a new builder-style object to manufacture [`UpdateProfileInput`](crate::operation::update_profile::UpdateProfileInput).
36    pub fn builder() -> crate::operation::update_profile::builders::UpdateProfileInputBuilder {
37        crate::operation::update_profile::builders::UpdateProfileInputBuilder::default()
38    }
39}
40
41/// A builder for [`UpdateProfileInput`](crate::operation::update_profile::UpdateProfileInput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct UpdateProfileInputBuilder {
45    pub(crate) identifier: ::std::option::Option<::std::string::String>,
46    pub(crate) name: ::std::option::Option<::std::string::String>,
47    pub(crate) description: ::std::option::Option<::std::string::String>,
48    pub(crate) extension_defaults: ::std::option::Option<crate::types::ExtensionDefaults>,
49}
50impl UpdateProfileInputBuilder {
51    /// The identifier (id or name) of the profile to update.
52    /// This field is required.
53    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
54        self.identifier = ::std::option::Option::Some(input.into());
55        self
56    }
57    /// The identifier (id or name) of the profile to update.
58    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.identifier = input;
60        self
61    }
62    /// The identifier (id or name) of the profile to update.
63    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
64        &self.identifier
65    }
66    /// The new name of the profile. Must be unique within the account.
67    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.name = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// The new name of the profile. Must be unique within the account.
72    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.name = input;
74        self
75    }
76    /// The new name of the profile. Must be unique within the account.
77    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
78        &self.name
79    }
80    /// A human-readable description of the profile's purpose or target environment. An empty string removes the description.
81    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.description = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// A human-readable description of the profile's purpose or target environment. An empty string removes the description.
86    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.description = input;
88        self
89    }
90    /// A human-readable description of the profile's purpose or target environment. An empty string removes the description.
91    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
92        &self.description
93    }
94    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
95    pub fn extension_defaults(mut self, input: crate::types::ExtensionDefaults) -> Self {
96        self.extension_defaults = ::std::option::Option::Some(input);
97        self
98    }
99    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
100    pub fn set_extension_defaults(mut self, input: ::std::option::Option<crate::types::ExtensionDefaults>) -> Self {
101        self.extension_defaults = input;
102        self
103    }
104    /// Default values used by the extensions in this profile. These can be overridden at the profile entry level.
105    pub fn get_extension_defaults(&self) -> &::std::option::Option<crate::types::ExtensionDefaults> {
106        &self.extension_defaults
107    }
108    /// Consumes the builder and constructs a [`UpdateProfileInput`](crate::operation::update_profile::UpdateProfileInput).
109    pub fn build(
110        self,
111    ) -> ::std::result::Result<crate::operation::update_profile::UpdateProfileInput, ::aws_smithy_types::error::operation::BuildError> {
112        ::std::result::Result::Ok(crate::operation::update_profile::UpdateProfileInput {
113            identifier: self.identifier,
114            name: self.name,
115            description: self.description,
116            extension_defaults: self.extension_defaults,
117        })
118    }
119}