aws_sdk_iam/operation/update_role/
_update_role_input.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 UpdateRoleInput {
6    /// <p>The name of the role that you want to modify.</p>
7    pub role_name: ::std::option::Option<::std::string::String>,
8    /// <p>The new description that you want to apply to the specified role.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default value of one hour is applied. This setting can have a value from 1 hour to 12 hours.</p>
11    /// <p>Anyone who assumes the role from the CLI or API can use the <code>DurationSeconds</code> API parameter or the <code>duration-seconds</code> CLI parameter to request a longer session. The <code>MaxSessionDuration</code> setting determines the maximum duration that can be requested using the <code>DurationSeconds</code> parameter. If users don't specify a value for the <code>DurationSeconds</code> parameter, their security credentials are valid for one hour by default. This applies when you use the <code>AssumeRole*</code> API operations or the <code>assume-role*</code> CLI operations but does not apply when you use those operations to create a console URL. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html">Using IAM roles</a> in the <i>IAM User Guide</i>.</p><note>
12    /// <p>IAM role credentials provided by Amazon EC2 instances assigned to the role are not subject to the specified maximum session duration.</p>
13    /// </note>
14    pub max_session_duration: ::std::option::Option<i32>,
15}
16impl UpdateRoleInput {
17    /// <p>The name of the role that you want to modify.</p>
18    pub fn role_name(&self) -> ::std::option::Option<&str> {
19        self.role_name.as_deref()
20    }
21    /// <p>The new description that you want to apply to the specified role.</p>
22    pub fn description(&self) -> ::std::option::Option<&str> {
23        self.description.as_deref()
24    }
25    /// <p>The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default value of one hour is applied. This setting can have a value from 1 hour to 12 hours.</p>
26    /// <p>Anyone who assumes the role from the CLI or API can use the <code>DurationSeconds</code> API parameter or the <code>duration-seconds</code> CLI parameter to request a longer session. The <code>MaxSessionDuration</code> setting determines the maximum duration that can be requested using the <code>DurationSeconds</code> parameter. If users don't specify a value for the <code>DurationSeconds</code> parameter, their security credentials are valid for one hour by default. This applies when you use the <code>AssumeRole*</code> API operations or the <code>assume-role*</code> CLI operations but does not apply when you use those operations to create a console URL. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html">Using IAM roles</a> in the <i>IAM User Guide</i>.</p><note>
27    /// <p>IAM role credentials provided by Amazon EC2 instances assigned to the role are not subject to the specified maximum session duration.</p>
28    /// </note>
29    pub fn max_session_duration(&self) -> ::std::option::Option<i32> {
30        self.max_session_duration
31    }
32}
33impl UpdateRoleInput {
34    /// Creates a new builder-style object to manufacture [`UpdateRoleInput`](crate::operation::update_role::UpdateRoleInput).
35    pub fn builder() -> crate::operation::update_role::builders::UpdateRoleInputBuilder {
36        crate::operation::update_role::builders::UpdateRoleInputBuilder::default()
37    }
38}
39
40/// A builder for [`UpdateRoleInput`](crate::operation::update_role::UpdateRoleInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct UpdateRoleInputBuilder {
44    pub(crate) role_name: ::std::option::Option<::std::string::String>,
45    pub(crate) description: ::std::option::Option<::std::string::String>,
46    pub(crate) max_session_duration: ::std::option::Option<i32>,
47}
48impl UpdateRoleInputBuilder {
49    /// <p>The name of the role that you want to modify.</p>
50    /// This field is required.
51    pub fn role_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52        self.role_name = ::std::option::Option::Some(input.into());
53        self
54    }
55    /// <p>The name of the role that you want to modify.</p>
56    pub fn set_role_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57        self.role_name = input;
58        self
59    }
60    /// <p>The name of the role that you want to modify.</p>
61    pub fn get_role_name(&self) -> &::std::option::Option<::std::string::String> {
62        &self.role_name
63    }
64    /// <p>The new description that you want to apply to the specified role.</p>
65    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.description = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The new description that you want to apply to the specified role.</p>
70    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.description = input;
72        self
73    }
74    /// <p>The new description that you want to apply to the specified role.</p>
75    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
76        &self.description
77    }
78    /// <p>The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default value of one hour is applied. This setting can have a value from 1 hour to 12 hours.</p>
79    /// <p>Anyone who assumes the role from the CLI or API can use the <code>DurationSeconds</code> API parameter or the <code>duration-seconds</code> CLI parameter to request a longer session. The <code>MaxSessionDuration</code> setting determines the maximum duration that can be requested using the <code>DurationSeconds</code> parameter. If users don't specify a value for the <code>DurationSeconds</code> parameter, their security credentials are valid for one hour by default. This applies when you use the <code>AssumeRole*</code> API operations or the <code>assume-role*</code> CLI operations but does not apply when you use those operations to create a console URL. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html">Using IAM roles</a> in the <i>IAM User Guide</i>.</p><note>
80    /// <p>IAM role credentials provided by Amazon EC2 instances assigned to the role are not subject to the specified maximum session duration.</p>
81    /// </note>
82    pub fn max_session_duration(mut self, input: i32) -> Self {
83        self.max_session_duration = ::std::option::Option::Some(input);
84        self
85    }
86    /// <p>The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default value of one hour is applied. This setting can have a value from 1 hour to 12 hours.</p>
87    /// <p>Anyone who assumes the role from the CLI or API can use the <code>DurationSeconds</code> API parameter or the <code>duration-seconds</code> CLI parameter to request a longer session. The <code>MaxSessionDuration</code> setting determines the maximum duration that can be requested using the <code>DurationSeconds</code> parameter. If users don't specify a value for the <code>DurationSeconds</code> parameter, their security credentials are valid for one hour by default. This applies when you use the <code>AssumeRole*</code> API operations or the <code>assume-role*</code> CLI operations but does not apply when you use those operations to create a console URL. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html">Using IAM roles</a> in the <i>IAM User Guide</i>.</p><note>
88    /// <p>IAM role credentials provided by Amazon EC2 instances assigned to the role are not subject to the specified maximum session duration.</p>
89    /// </note>
90    pub fn set_max_session_duration(mut self, input: ::std::option::Option<i32>) -> Self {
91        self.max_session_duration = input;
92        self
93    }
94    /// <p>The maximum session duration (in seconds) that you want to set for the specified role. If you do not specify a value for this setting, the default value of one hour is applied. This setting can have a value from 1 hour to 12 hours.</p>
95    /// <p>Anyone who assumes the role from the CLI or API can use the <code>DurationSeconds</code> API parameter or the <code>duration-seconds</code> CLI parameter to request a longer session. The <code>MaxSessionDuration</code> setting determines the maximum duration that can be requested using the <code>DurationSeconds</code> parameter. If users don't specify a value for the <code>DurationSeconds</code> parameter, their security credentials are valid for one hour by default. This applies when you use the <code>AssumeRole*</code> API operations or the <code>assume-role*</code> CLI operations but does not apply when you use those operations to create a console URL. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html">Using IAM roles</a> in the <i>IAM User Guide</i>.</p><note>
96    /// <p>IAM role credentials provided by Amazon EC2 instances assigned to the role are not subject to the specified maximum session duration.</p>
97    /// </note>
98    pub fn get_max_session_duration(&self) -> &::std::option::Option<i32> {
99        &self.max_session_duration
100    }
101    /// Consumes the builder and constructs a [`UpdateRoleInput`](crate::operation::update_role::UpdateRoleInput).
102    pub fn build(self) -> ::std::result::Result<crate::operation::update_role::UpdateRoleInput, ::aws_smithy_types::error::operation::BuildError> {
103        ::std::result::Result::Ok(crate::operation::update_role::UpdateRoleInput {
104            role_name: self.role_name,
105            description: self.description,
106            max_session_duration: self.max_session_duration,
107        })
108    }
109}