1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes a refresh token.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct RefreshTokenRequestBody {
    /// <p>The token to use to refresh a previously issued access token that might have expired.</p>
    pub token: ::std::string::String,
    /// <p>The ID of the client to request the token from.</p>
    pub client_id: ::std::option::Option<::std::string::String>,
}
impl RefreshTokenRequestBody {
    /// <p>The token to use to refresh a previously issued access token that might have expired.</p>
    pub fn token(&self) -> &str {
        use std::ops::Deref;
        self.token.deref()
    }
    /// <p>The ID of the client to request the token from.</p>
    pub fn client_id(&self) -> ::std::option::Option<&str> {
        self.client_id.as_deref()
    }
}
impl ::std::fmt::Debug for RefreshTokenRequestBody {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("RefreshTokenRequestBody");
        formatter.field("token", &"*** Sensitive Data Redacted ***");
        formatter.field("client_id", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl RefreshTokenRequestBody {
    /// Creates a new builder-style object to manufacture [`RefreshTokenRequestBody`](crate::types::RefreshTokenRequestBody).
    pub fn builder() -> crate::types::builders::RefreshTokenRequestBodyBuilder {
        crate::types::builders::RefreshTokenRequestBodyBuilder::default()
    }
}

/// A builder for [`RefreshTokenRequestBody`](crate::types::RefreshTokenRequestBody).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct RefreshTokenRequestBodyBuilder {
    pub(crate) token: ::std::option::Option<::std::string::String>,
    pub(crate) client_id: ::std::option::Option<::std::string::String>,
}
impl RefreshTokenRequestBodyBuilder {
    /// <p>The token to use to refresh a previously issued access token that might have expired.</p>
    /// This field is required.
    pub fn token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The token to use to refresh a previously issued access token that might have expired.</p>
    pub fn set_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.token = input;
        self
    }
    /// <p>The token to use to refresh a previously issued access token that might have expired.</p>
    pub fn get_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.token
    }
    /// <p>The ID of the client to request the token from.</p>
    pub fn client_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the client to request the token from.</p>
    pub fn set_client_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_id = input;
        self
    }
    /// <p>The ID of the client to request the token from.</p>
    pub fn get_client_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_id
    }
    /// Consumes the builder and constructs a [`RefreshTokenRequestBody`](crate::types::RefreshTokenRequestBody).
    /// This method will fail if any of the following fields are not set:
    /// - [`token`](crate::types::builders::RefreshTokenRequestBodyBuilder::token)
    pub fn build(self) -> ::std::result::Result<crate::types::RefreshTokenRequestBody, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::RefreshTokenRequestBody {
            token: self.token.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "token",
                    "token was not specified but it is required when building RefreshTokenRequestBody",
                )
            })?,
            client_id: self.client_id,
        })
    }
}
impl ::std::fmt::Debug for RefreshTokenRequestBodyBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("RefreshTokenRequestBodyBuilder");
        formatter.field("token", &"*** Sensitive Data Redacted ***");
        formatter.field("client_id", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}