aws_sdk_iam/operation/get_role/
_get_role_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the response to a successful <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetRole.html">GetRole</a> request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetRoleOutput {
7    /// <p>A structure containing details about the IAM role.</p>
8    pub role: ::std::option::Option<crate::types::Role>,
9    _request_id: Option<String>,
10}
11impl GetRoleOutput {
12    /// <p>A structure containing details about the IAM role.</p>
13    pub fn role(&self) -> ::std::option::Option<&crate::types::Role> {
14        self.role.as_ref()
15    }
16}
17impl ::aws_types::request_id::RequestId for GetRoleOutput {
18    fn request_id(&self) -> Option<&str> {
19        self._request_id.as_deref()
20    }
21}
22impl GetRoleOutput {
23    /// Creates a new builder-style object to manufacture [`GetRoleOutput`](crate::operation::get_role::GetRoleOutput).
24    pub fn builder() -> crate::operation::get_role::builders::GetRoleOutputBuilder {
25        crate::operation::get_role::builders::GetRoleOutputBuilder::default()
26    }
27}
28
29/// A builder for [`GetRoleOutput`](crate::operation::get_role::GetRoleOutput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct GetRoleOutputBuilder {
33    pub(crate) role: ::std::option::Option<crate::types::Role>,
34    _request_id: Option<String>,
35}
36impl GetRoleOutputBuilder {
37    /// <p>A structure containing details about the IAM role.</p>
38    /// This field is required.
39    pub fn role(mut self, input: crate::types::Role) -> Self {
40        self.role = ::std::option::Option::Some(input);
41        self
42    }
43    /// <p>A structure containing details about the IAM role.</p>
44    pub fn set_role(mut self, input: ::std::option::Option<crate::types::Role>) -> Self {
45        self.role = input;
46        self
47    }
48    /// <p>A structure containing details about the IAM role.</p>
49    pub fn get_role(&self) -> &::std::option::Option<crate::types::Role> {
50        &self.role
51    }
52    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
53        self._request_id = Some(request_id.into());
54        self
55    }
56
57    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
58        self._request_id = request_id;
59        self
60    }
61    /// Consumes the builder and constructs a [`GetRoleOutput`](crate::operation::get_role::GetRoleOutput).
62    pub fn build(self) -> crate::operation::get_role::GetRoleOutput {
63        crate::operation::get_role::GetRoleOutput {
64            role: self.role,
65            _request_id: self._request_id,
66        }
67    }
68}