Skip to main content

aws_sdk_cognitoidentityprovider/operation/admin_get_device/
_admin_get_device_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the request to get the device, as an administrator.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct AdminGetDeviceInput {
7    /// <p>The key of the device that you want to delete.</p>
8    pub device_key: ::std::option::Option<::std::string::String>,
9    /// <p>The ID of the user pool where the device owner is a user.</p>
10    pub user_pool_id: ::std::option::Option<::std::string::String>,
11    /// <p>The name of the user that you want to query or modify. The value of this parameter is typically your user's username, but it can be any of their alias attributes. If <code>username</code> isn't an alias attribute in your user pool, this value must be the <code>sub</code> of a local user or the username of a user from a third-party IdP.</p>
12    pub username: ::std::option::Option<::std::string::String>,
13}
14impl AdminGetDeviceInput {
15    /// <p>The key of the device that you want to delete.</p>
16    pub fn device_key(&self) -> ::std::option::Option<&str> {
17        self.device_key.as_deref()
18    }
19    /// <p>The ID of the user pool where the device owner is a user.</p>
20    pub fn user_pool_id(&self) -> ::std::option::Option<&str> {
21        self.user_pool_id.as_deref()
22    }
23    /// <p>The name of the user that you want to query or modify. The value of this parameter is typically your user's username, but it can be any of their alias attributes. If <code>username</code> isn't an alias attribute in your user pool, this value must be the <code>sub</code> of a local user or the username of a user from a third-party IdP.</p>
24    pub fn username(&self) -> ::std::option::Option<&str> {
25        self.username.as_deref()
26    }
27}
28impl ::std::fmt::Debug for AdminGetDeviceInput {
29    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
30        let mut formatter = f.debug_struct("AdminGetDeviceInput");
31        formatter.field("device_key", &self.device_key);
32        formatter.field("user_pool_id", &self.user_pool_id);
33        formatter.field("username", &"*** Sensitive Data Redacted ***");
34        formatter.finish()
35    }
36}
37impl AdminGetDeviceInput {
38    /// Creates a new builder-style object to manufacture [`AdminGetDeviceInput`](crate::operation::admin_get_device::AdminGetDeviceInput).
39    pub fn builder() -> crate::operation::admin_get_device::builders::AdminGetDeviceInputBuilder {
40        crate::operation::admin_get_device::builders::AdminGetDeviceInputBuilder::default()
41    }
42}
43
44/// A builder for [`AdminGetDeviceInput`](crate::operation::admin_get_device::AdminGetDeviceInput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
46#[non_exhaustive]
47pub struct AdminGetDeviceInputBuilder {
48    pub(crate) device_key: ::std::option::Option<::std::string::String>,
49    pub(crate) user_pool_id: ::std::option::Option<::std::string::String>,
50    pub(crate) username: ::std::option::Option<::std::string::String>,
51}
52impl AdminGetDeviceInputBuilder {
53    /// <p>The key of the device that you want to delete.</p>
54    /// This field is required.
55    pub fn device_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
56        self.device_key = ::std::option::Option::Some(input.into());
57        self
58    }
59    /// <p>The key of the device that you want to delete.</p>
60    pub fn set_device_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
61        self.device_key = input;
62        self
63    }
64    /// <p>The key of the device that you want to delete.</p>
65    pub fn get_device_key(&self) -> &::std::option::Option<::std::string::String> {
66        &self.device_key
67    }
68    /// <p>The ID of the user pool where the device owner is a user.</p>
69    /// This field is required.
70    pub fn user_pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.user_pool_id = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>The ID of the user pool where the device owner is a user.</p>
75    pub fn set_user_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.user_pool_id = input;
77        self
78    }
79    /// <p>The ID of the user pool where the device owner is a user.</p>
80    pub fn get_user_pool_id(&self) -> &::std::option::Option<::std::string::String> {
81        &self.user_pool_id
82    }
83    /// <p>The name of the user that you want to query or modify. The value of this parameter is typically your user's username, but it can be any of their alias attributes. If <code>username</code> isn't an alias attribute in your user pool, this value must be the <code>sub</code> of a local user or the username of a user from a third-party IdP.</p>
84    /// This field is required.
85    pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        self.username = ::std::option::Option::Some(input.into());
87        self
88    }
89    /// <p>The name of the user that you want to query or modify. The value of this parameter is typically your user's username, but it can be any of their alias attributes. If <code>username</code> isn't an alias attribute in your user pool, this value must be the <code>sub</code> of a local user or the username of a user from a third-party IdP.</p>
90    pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.username = input;
92        self
93    }
94    /// <p>The name of the user that you want to query or modify. The value of this parameter is typically your user's username, but it can be any of their alias attributes. If <code>username</code> isn't an alias attribute in your user pool, this value must be the <code>sub</code> of a local user or the username of a user from a third-party IdP.</p>
95    pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
96        &self.username
97    }
98    /// Consumes the builder and constructs a [`AdminGetDeviceInput`](crate::operation::admin_get_device::AdminGetDeviceInput).
99    pub fn build(
100        self,
101    ) -> ::std::result::Result<crate::operation::admin_get_device::AdminGetDeviceInput, ::aws_smithy_types::error::operation::BuildError> {
102        ::std::result::Result::Ok(crate::operation::admin_get_device::AdminGetDeviceInput {
103            device_key: self.device_key,
104            user_pool_id: self.user_pool_id,
105            username: self.username,
106        })
107    }
108}
109impl ::std::fmt::Debug for AdminGetDeviceInputBuilder {
110    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
111        let mut formatter = f.debug_struct("AdminGetDeviceInputBuilder");
112        formatter.field("device_key", &self.device_key);
113        formatter.field("user_pool_id", &self.user_pool_id);
114        formatter.field("username", &"*** Sensitive Data Redacted ***");
115        formatter.finish()
116    }
117}