aws_sdk_cognitoidentity/operation/describe_identity/
_describe_identity_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A description of the identity.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeIdentityOutput {
7    /// <p>A unique identifier in the format REGION:GUID.</p>
8    pub identity_id: ::std::option::Option<::std::string::String>,
9    /// <p>The provider names.</p>
10    pub logins: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11    /// <p>Date on which the identity was created.</p>
12    pub creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
13    /// <p>Date on which the identity was last modified.</p>
14    pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
15    _request_id: Option<String>,
16}
17impl DescribeIdentityOutput {
18    /// <p>A unique identifier in the format REGION:GUID.</p>
19    pub fn identity_id(&self) -> ::std::option::Option<&str> {
20        self.identity_id.as_deref()
21    }
22    /// <p>The provider names.</p>
23    ///
24    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.logins.is_none()`.
25    pub fn logins(&self) -> &[::std::string::String] {
26        self.logins.as_deref().unwrap_or_default()
27    }
28    /// <p>Date on which the identity was created.</p>
29    pub fn creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
30        self.creation_date.as_ref()
31    }
32    /// <p>Date on which the identity was last modified.</p>
33    pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
34        self.last_modified_date.as_ref()
35    }
36}
37impl ::aws_types::request_id::RequestId for DescribeIdentityOutput {
38    fn request_id(&self) -> Option<&str> {
39        self._request_id.as_deref()
40    }
41}
42impl DescribeIdentityOutput {
43    /// Creates a new builder-style object to manufacture [`DescribeIdentityOutput`](crate::operation::describe_identity::DescribeIdentityOutput).
44    pub fn builder() -> crate::operation::describe_identity::builders::DescribeIdentityOutputBuilder {
45        crate::operation::describe_identity::builders::DescribeIdentityOutputBuilder::default()
46    }
47}
48
49/// A builder for [`DescribeIdentityOutput`](crate::operation::describe_identity::DescribeIdentityOutput).
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct DescribeIdentityOutputBuilder {
53    pub(crate) identity_id: ::std::option::Option<::std::string::String>,
54    pub(crate) logins: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
55    pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
56    pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
57    _request_id: Option<String>,
58}
59impl DescribeIdentityOutputBuilder {
60    /// <p>A unique identifier in the format REGION:GUID.</p>
61    pub fn identity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.identity_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>A unique identifier in the format REGION:GUID.</p>
66    pub fn set_identity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.identity_id = input;
68        self
69    }
70    /// <p>A unique identifier in the format REGION:GUID.</p>
71    pub fn get_identity_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.identity_id
73    }
74    /// Appends an item to `logins`.
75    ///
76    /// To override the contents of this collection use [`set_logins`](Self::set_logins).
77    ///
78    /// <p>The provider names.</p>
79    pub fn logins(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        let mut v = self.logins.unwrap_or_default();
81        v.push(input.into());
82        self.logins = ::std::option::Option::Some(v);
83        self
84    }
85    /// <p>The provider names.</p>
86    pub fn set_logins(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
87        self.logins = input;
88        self
89    }
90    /// <p>The provider names.</p>
91    pub fn get_logins(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
92        &self.logins
93    }
94    /// <p>Date on which the identity was created.</p>
95    pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
96        self.creation_date = ::std::option::Option::Some(input);
97        self
98    }
99    /// <p>Date on which the identity was created.</p>
100    pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
101        self.creation_date = input;
102        self
103    }
104    /// <p>Date on which the identity was created.</p>
105    pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
106        &self.creation_date
107    }
108    /// <p>Date on which the identity was last modified.</p>
109    pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
110        self.last_modified_date = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>Date on which the identity was last modified.</p>
114    pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
115        self.last_modified_date = input;
116        self
117    }
118    /// <p>Date on which the identity was last modified.</p>
119    pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
120        &self.last_modified_date
121    }
122    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
123        self._request_id = Some(request_id.into());
124        self
125    }
126
127    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
128        self._request_id = request_id;
129        self
130    }
131    /// Consumes the builder and constructs a [`DescribeIdentityOutput`](crate::operation::describe_identity::DescribeIdentityOutput).
132    pub fn build(self) -> crate::operation::describe_identity::DescribeIdentityOutput {
133        crate::operation::describe_identity::DescribeIdentityOutput {
134            identity_id: self.identity_id,
135            logins: self.logins,
136            creation_date: self.creation_date,
137            last_modified_date: self.last_modified_date,
138            _request_id: self._request_id,
139        }
140    }
141}