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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateTokenInput {
    /// <p>Amazon Resource Name (ARN) of the license. The ARN is mapped to the aud claim of the JWT token.</p>
    pub license_arn: ::std::option::Option<::std::string::String>,
    /// <p>Amazon Resource Name (ARN) of the IAM roles to embed in the token. License Manager does not check whether the roles are in use.</p>
    pub role_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Token expiration, in days, counted from token creation. The default is 365 days.</p>
    pub expiration_in_days: ::std::option::Option<i32>,
    /// <p>Data specified by the caller to be included in the JWT token. The data is mapped to the amr claim of the JWT token.</p>
    pub token_properties: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Idempotency token, valid for 10 minutes.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateTokenInput {
    /// <p>Amazon Resource Name (ARN) of the license. The ARN is mapped to the aud claim of the JWT token.</p>
    pub fn license_arn(&self) -> ::std::option::Option<&str> {
        self.license_arn.as_deref()
    }
    /// <p>Amazon Resource Name (ARN) of the IAM roles to embed in the token. License Manager does not check whether the roles are in use.</p>
    pub fn role_arns(&self) -> ::std::option::Option<&[::std::string::String]> {
        self.role_arns.as_deref()
    }
    /// <p>Token expiration, in days, counted from token creation. The default is 365 days.</p>
    pub fn expiration_in_days(&self) -> ::std::option::Option<i32> {
        self.expiration_in_days
    }
    /// <p>Data specified by the caller to be included in the JWT token. The data is mapped to the amr claim of the JWT token.</p>
    pub fn token_properties(&self) -> ::std::option::Option<&[::std::string::String]> {
        self.token_properties.as_deref()
    }
    /// <p>Idempotency token, valid for 10 minutes.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CreateTokenInput {
    /// Creates a new builder-style object to manufacture [`CreateTokenInput`](crate::operation::create_token::CreateTokenInput).
    pub fn builder() -> crate::operation::create_token::builders::CreateTokenInputBuilder {
        crate::operation::create_token::builders::CreateTokenInputBuilder::default()
    }
}

/// A builder for [`CreateTokenInput`](crate::operation::create_token::CreateTokenInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateTokenInputBuilder {
    pub(crate) license_arn: ::std::option::Option<::std::string::String>,
    pub(crate) role_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) expiration_in_days: ::std::option::Option<i32>,
    pub(crate) token_properties: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateTokenInputBuilder {
    /// <p>Amazon Resource Name (ARN) of the license. The ARN is mapped to the aud claim of the JWT token.</p>
    pub fn license_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.license_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Amazon Resource Name (ARN) of the license. The ARN is mapped to the aud claim of the JWT token.</p>
    pub fn set_license_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.license_arn = input;
        self
    }
    /// <p>Amazon Resource Name (ARN) of the license. The ARN is mapped to the aud claim of the JWT token.</p>
    pub fn get_license_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.license_arn
    }
    /// Appends an item to `role_arns`.
    ///
    /// To override the contents of this collection use [`set_role_arns`](Self::set_role_arns).
    ///
    /// <p>Amazon Resource Name (ARN) of the IAM roles to embed in the token. License Manager does not check whether the roles are in use.</p>
    pub fn role_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.role_arns.unwrap_or_default();
        v.push(input.into());
        self.role_arns = ::std::option::Option::Some(v);
        self
    }
    /// <p>Amazon Resource Name (ARN) of the IAM roles to embed in the token. License Manager does not check whether the roles are in use.</p>
    pub fn set_role_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.role_arns = input;
        self
    }
    /// <p>Amazon Resource Name (ARN) of the IAM roles to embed in the token. License Manager does not check whether the roles are in use.</p>
    pub fn get_role_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.role_arns
    }
    /// <p>Token expiration, in days, counted from token creation. The default is 365 days.</p>
    pub fn expiration_in_days(mut self, input: i32) -> Self {
        self.expiration_in_days = ::std::option::Option::Some(input);
        self
    }
    /// <p>Token expiration, in days, counted from token creation. The default is 365 days.</p>
    pub fn set_expiration_in_days(mut self, input: ::std::option::Option<i32>) -> Self {
        self.expiration_in_days = input;
        self
    }
    /// <p>Token expiration, in days, counted from token creation. The default is 365 days.</p>
    pub fn get_expiration_in_days(&self) -> &::std::option::Option<i32> {
        &self.expiration_in_days
    }
    /// Appends an item to `token_properties`.
    ///
    /// To override the contents of this collection use [`set_token_properties`](Self::set_token_properties).
    ///
    /// <p>Data specified by the caller to be included in the JWT token. The data is mapped to the amr claim of the JWT token.</p>
    pub fn token_properties(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.token_properties.unwrap_or_default();
        v.push(input.into());
        self.token_properties = ::std::option::Option::Some(v);
        self
    }
    /// <p>Data specified by the caller to be included in the JWT token. The data is mapped to the amr claim of the JWT token.</p>
    pub fn set_token_properties(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.token_properties = input;
        self
    }
    /// <p>Data specified by the caller to be included in the JWT token. The data is mapped to the amr claim of the JWT token.</p>
    pub fn get_token_properties(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.token_properties
    }
    /// <p>Idempotency token, valid for 10 minutes.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Idempotency token, valid for 10 minutes.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>Idempotency token, valid for 10 minutes.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateTokenInput`](crate::operation::create_token::CreateTokenInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::create_token::CreateTokenInput, ::aws_smithy_http::operation::error::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_token::CreateTokenInput {
            license_arn: self.license_arn,
            role_arns: self.role_arns,
            expiration_in_days: self.expiration_in_days,
            token_properties: self.token_properties,
            client_token: self.client_token,
        })
    }
}