aws-sdk-paymentcryptography 1.106.0

AWS SDK for Payment Cryptography Control Plane
Documentation
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Metadata about an Amazon Web Services Payment Cryptography key.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Key {
    /// <p>The Amazon Resource Name (ARN) of the key.</p>
    pub key_arn: ::std::string::String,
    /// <p>The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.</p>
    pub key_attributes: ::std::option::Option<crate::types::KeyAttributes>,
    /// <p>The key check value (KCV) is used to check if all parties holding a given key have the same key or to detect that a key has changed.</p>
    pub key_check_value: ::std::string::String,
    /// <p>The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV). It is used to validate the key integrity.</p>
    /// <p>For TDES keys, the KCV is computed by encrypting 8 bytes, each with value of zero, with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES keys, the KCV is computed using a CMAC algorithm where the input data is 16 bytes of zero and retaining the 3 highest order bytes of the encrypted result.</p>
    pub key_check_value_algorithm: crate::types::KeyCheckValueAlgorithm,
    /// <p>Specifies whether the key is enabled.</p>
    pub enabled: bool,
    /// <p>Specifies whether the key is exportable. This data is immutable after the key is created.</p>
    pub exportable: bool,
    /// <p>The state of key that is being created or deleted.</p>
    pub key_state: crate::types::KeyState,
    /// <p>The source of the key material. For keys created within Amazon Web Services Payment Cryptography, the value is <code>AWS_PAYMENT_CRYPTOGRAPHY</code>. For keys imported into Amazon Web Services Payment Cryptography, the value is <code>EXTERNAL</code>.</p>
    pub key_origin: crate::types::KeyOrigin,
    /// <p>The date and time when the key was created.</p>
    pub create_timestamp: ::aws_smithy_types::DateTime,
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will start using the key material for cryptographic operations.</p>
    pub usage_start_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will stop using the key material for cryptographic operations.</p>
    pub usage_stop_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when <code>KeyState</code> is <code>DELETE_PENDING</code> and the key is scheduled for deletion.</p>
    pub delete_pending_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when when the <code>KeyState</code> is <code>DELETE_COMPLETE</code> and the Amazon Web Services Payment Cryptography key is deleted.</p>
    pub delete_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The cryptographic usage of an ECDH derived key as defined in section A.5.2 of the TR-31 spec.</p>
    pub derive_key_usage: ::std::option::Option<crate::types::DeriveKeyUsage>,
    /// <p>Indicates whether this key is a Multi-Region key and its role in the Multi-Region key hierarchy.</p>
    /// <p>Multi-Region replication keys allow the same key material to be used across multiple Amazon Web Services Regions. This field specifies whether the key is a Primary Region key (PRK) (which can be replicated to other Amazon Web Services Regions) or a Replica Region key (RRK) (which is a copy of a PRK in another Region). For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a>.</p>
    pub multi_region_key_type: ::std::option::Option<crate::types::MultiRegionKeyType>,
    /// <p>An Amazon Web Services Region identifier in the standard format (e.g., <code>us-east-1</code>, <code>eu-west-1</code>).</p>
    /// <p>Used to specify regions for key replication operations. The region must be a valid Amazon Web Services Region where Amazon Web Services Payment Cryptography is available.</p>
    pub primary_region: ::std::option::Option<::std::string::String>,
    /// <p>Information about the replication status of the key across different Amazon Web Services Regions.</p>
    /// <p>This field provides details about the current state of key replication, including any status messages or operational information. It helps track the progress and health of key replication operations.</p>
    pub replication_status: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ReplicationStatusType>>,
    /// <p>Indicates whether this key is using the account's default replication regions configuration for <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a>.</p>
    /// <p>When set to <code>true</code>, the key automatically replicates to the regions specified in the account's default replication settings. When set to <code>false</code>, the key has a custom replication configuration that overrides the account defaults.</p>
    pub using_default_replication_regions: ::std::option::Option<bool>,
}
impl Key {
    /// <p>The Amazon Resource Name (ARN) of the key.</p>
    pub fn key_arn(&self) -> &str {
        use std::ops::Deref;
        self.key_arn.deref()
    }
    /// <p>The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.</p>
    pub fn key_attributes(&self) -> ::std::option::Option<&crate::types::KeyAttributes> {
        self.key_attributes.as_ref()
    }
    /// <p>The key check value (KCV) is used to check if all parties holding a given key have the same key or to detect that a key has changed.</p>
    pub fn key_check_value(&self) -> &str {
        use std::ops::Deref;
        self.key_check_value.deref()
    }
    /// <p>The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV). It is used to validate the key integrity.</p>
    /// <p>For TDES keys, the KCV is computed by encrypting 8 bytes, each with value of zero, with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES keys, the KCV is computed using a CMAC algorithm where the input data is 16 bytes of zero and retaining the 3 highest order bytes of the encrypted result.</p>
    pub fn key_check_value_algorithm(&self) -> &crate::types::KeyCheckValueAlgorithm {
        &self.key_check_value_algorithm
    }
    /// <p>Specifies whether the key is enabled.</p>
    pub fn enabled(&self) -> bool {
        self.enabled
    }
    /// <p>Specifies whether the key is exportable. This data is immutable after the key is created.</p>
    pub fn exportable(&self) -> bool {
        self.exportable
    }
    /// <p>The state of key that is being created or deleted.</p>
    pub fn key_state(&self) -> &crate::types::KeyState {
        &self.key_state
    }
    /// <p>The source of the key material. For keys created within Amazon Web Services Payment Cryptography, the value is <code>AWS_PAYMENT_CRYPTOGRAPHY</code>. For keys imported into Amazon Web Services Payment Cryptography, the value is <code>EXTERNAL</code>.</p>
    pub fn key_origin(&self) -> &crate::types::KeyOrigin {
        &self.key_origin
    }
    /// <p>The date and time when the key was created.</p>
    pub fn create_timestamp(&self) -> &::aws_smithy_types::DateTime {
        &self.create_timestamp
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will start using the key material for cryptographic operations.</p>
    pub fn usage_start_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.usage_start_timestamp.as_ref()
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will stop using the key material for cryptographic operations.</p>
    pub fn usage_stop_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.usage_stop_timestamp.as_ref()
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when <code>KeyState</code> is <code>DELETE_PENDING</code> and the key is scheduled for deletion.</p>
    pub fn delete_pending_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.delete_pending_timestamp.as_ref()
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when when the <code>KeyState</code> is <code>DELETE_COMPLETE</code> and the Amazon Web Services Payment Cryptography key is deleted.</p>
    pub fn delete_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.delete_timestamp.as_ref()
    }
    /// <p>The cryptographic usage of an ECDH derived key as defined in section A.5.2 of the TR-31 spec.</p>
    pub fn derive_key_usage(&self) -> ::std::option::Option<&crate::types::DeriveKeyUsage> {
        self.derive_key_usage.as_ref()
    }
    /// <p>Indicates whether this key is a Multi-Region key and its role in the Multi-Region key hierarchy.</p>
    /// <p>Multi-Region replication keys allow the same key material to be used across multiple Amazon Web Services Regions. This field specifies whether the key is a Primary Region key (PRK) (which can be replicated to other Amazon Web Services Regions) or a Replica Region key (RRK) (which is a copy of a PRK in another Region). For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a>.</p>
    pub fn multi_region_key_type(&self) -> ::std::option::Option<&crate::types::MultiRegionKeyType> {
        self.multi_region_key_type.as_ref()
    }
    /// <p>An Amazon Web Services Region identifier in the standard format (e.g., <code>us-east-1</code>, <code>eu-west-1</code>).</p>
    /// <p>Used to specify regions for key replication operations. The region must be a valid Amazon Web Services Region where Amazon Web Services Payment Cryptography is available.</p>
    pub fn primary_region(&self) -> ::std::option::Option<&str> {
        self.primary_region.as_deref()
    }
    /// <p>Information about the replication status of the key across different Amazon Web Services Regions.</p>
    /// <p>This field provides details about the current state of key replication, including any status messages or operational information. It helps track the progress and health of key replication operations.</p>
    pub fn replication_status(
        &self,
    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ReplicationStatusType>> {
        self.replication_status.as_ref()
    }
    /// <p>Indicates whether this key is using the account's default replication regions configuration for <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a>.</p>
    /// <p>When set to <code>true</code>, the key automatically replicates to the regions specified in the account's default replication settings. When set to <code>false</code>, the key has a custom replication configuration that overrides the account defaults.</p>
    pub fn using_default_replication_regions(&self) -> ::std::option::Option<bool> {
        self.using_default_replication_regions
    }
}
impl Key {
    /// Creates a new builder-style object to manufacture [`Key`](crate::types::Key).
    pub fn builder() -> crate::types::builders::KeyBuilder {
        crate::types::builders::KeyBuilder::default()
    }
}

/// A builder for [`Key`](crate::types::Key).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct KeyBuilder {
    pub(crate) key_arn: ::std::option::Option<::std::string::String>,
    pub(crate) key_attributes: ::std::option::Option<crate::types::KeyAttributes>,
    pub(crate) key_check_value: ::std::option::Option<::std::string::String>,
    pub(crate) key_check_value_algorithm: ::std::option::Option<crate::types::KeyCheckValueAlgorithm>,
    pub(crate) enabled: ::std::option::Option<bool>,
    pub(crate) exportable: ::std::option::Option<bool>,
    pub(crate) key_state: ::std::option::Option<crate::types::KeyState>,
    pub(crate) key_origin: ::std::option::Option<crate::types::KeyOrigin>,
    pub(crate) create_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) usage_start_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) usage_stop_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) delete_pending_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) delete_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) derive_key_usage: ::std::option::Option<crate::types::DeriveKeyUsage>,
    pub(crate) multi_region_key_type: ::std::option::Option<crate::types::MultiRegionKeyType>,
    pub(crate) primary_region: ::std::option::Option<::std::string::String>,
    pub(crate) replication_status: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ReplicationStatusType>>,
    pub(crate) using_default_replication_regions: ::std::option::Option<bool>,
}
impl KeyBuilder {
    /// <p>The Amazon Resource Name (ARN) of the key.</p>
    /// This field is required.
    pub fn key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.key_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the key.</p>
    pub fn set_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.key_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the key.</p>
    pub fn get_key_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.key_arn
    }
    /// <p>The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.</p>
    /// This field is required.
    pub fn key_attributes(mut self, input: crate::types::KeyAttributes) -> Self {
        self.key_attributes = ::std::option::Option::Some(input);
        self
    }
    /// <p>The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.</p>
    pub fn set_key_attributes(mut self, input: ::std::option::Option<crate::types::KeyAttributes>) -> Self {
        self.key_attributes = input;
        self
    }
    /// <p>The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key. This data is immutable after the key is created.</p>
    pub fn get_key_attributes(&self) -> &::std::option::Option<crate::types::KeyAttributes> {
        &self.key_attributes
    }
    /// <p>The key check value (KCV) is used to check if all parties holding a given key have the same key or to detect that a key has changed.</p>
    /// This field is required.
    pub fn key_check_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.key_check_value = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The key check value (KCV) is used to check if all parties holding a given key have the same key or to detect that a key has changed.</p>
    pub fn set_key_check_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.key_check_value = input;
        self
    }
    /// <p>The key check value (KCV) is used to check if all parties holding a given key have the same key or to detect that a key has changed.</p>
    pub fn get_key_check_value(&self) -> &::std::option::Option<::std::string::String> {
        &self.key_check_value
    }
    /// <p>The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV). It is used to validate the key integrity.</p>
    /// <p>For TDES keys, the KCV is computed by encrypting 8 bytes, each with value of zero, with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES keys, the KCV is computed using a CMAC algorithm where the input data is 16 bytes of zero and retaining the 3 highest order bytes of the encrypted result.</p>
    /// This field is required.
    pub fn key_check_value_algorithm(mut self, input: crate::types::KeyCheckValueAlgorithm) -> Self {
        self.key_check_value_algorithm = ::std::option::Option::Some(input);
        self
    }
    /// <p>The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV). It is used to validate the key integrity.</p>
    /// <p>For TDES keys, the KCV is computed by encrypting 8 bytes, each with value of zero, with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES keys, the KCV is computed using a CMAC algorithm where the input data is 16 bytes of zero and retaining the 3 highest order bytes of the encrypted result.</p>
    pub fn set_key_check_value_algorithm(mut self, input: ::std::option::Option<crate::types::KeyCheckValueAlgorithm>) -> Self {
        self.key_check_value_algorithm = input;
        self
    }
    /// <p>The algorithm that Amazon Web Services Payment Cryptography uses to calculate the key check value (KCV). It is used to validate the key integrity.</p>
    /// <p>For TDES keys, the KCV is computed by encrypting 8 bytes, each with value of zero, with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES keys, the KCV is computed using a CMAC algorithm where the input data is 16 bytes of zero and retaining the 3 highest order bytes of the encrypted result.</p>
    pub fn get_key_check_value_algorithm(&self) -> &::std::option::Option<crate::types::KeyCheckValueAlgorithm> {
        &self.key_check_value_algorithm
    }
    /// <p>Specifies whether the key is enabled.</p>
    /// This field is required.
    pub fn enabled(mut self, input: bool) -> Self {
        self.enabled = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether the key is enabled.</p>
    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.enabled = input;
        self
    }
    /// <p>Specifies whether the key is enabled.</p>
    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
        &self.enabled
    }
    /// <p>Specifies whether the key is exportable. This data is immutable after the key is created.</p>
    /// This field is required.
    pub fn exportable(mut self, input: bool) -> Self {
        self.exportable = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether the key is exportable. This data is immutable after the key is created.</p>
    pub fn set_exportable(mut self, input: ::std::option::Option<bool>) -> Self {
        self.exportable = input;
        self
    }
    /// <p>Specifies whether the key is exportable. This data is immutable after the key is created.</p>
    pub fn get_exportable(&self) -> &::std::option::Option<bool> {
        &self.exportable
    }
    /// <p>The state of key that is being created or deleted.</p>
    /// This field is required.
    pub fn key_state(mut self, input: crate::types::KeyState) -> Self {
        self.key_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of key that is being created or deleted.</p>
    pub fn set_key_state(mut self, input: ::std::option::Option<crate::types::KeyState>) -> Self {
        self.key_state = input;
        self
    }
    /// <p>The state of key that is being created or deleted.</p>
    pub fn get_key_state(&self) -> &::std::option::Option<crate::types::KeyState> {
        &self.key_state
    }
    /// <p>The source of the key material. For keys created within Amazon Web Services Payment Cryptography, the value is <code>AWS_PAYMENT_CRYPTOGRAPHY</code>. For keys imported into Amazon Web Services Payment Cryptography, the value is <code>EXTERNAL</code>.</p>
    /// This field is required.
    pub fn key_origin(mut self, input: crate::types::KeyOrigin) -> Self {
        self.key_origin = ::std::option::Option::Some(input);
        self
    }
    /// <p>The source of the key material. For keys created within Amazon Web Services Payment Cryptography, the value is <code>AWS_PAYMENT_CRYPTOGRAPHY</code>. For keys imported into Amazon Web Services Payment Cryptography, the value is <code>EXTERNAL</code>.</p>
    pub fn set_key_origin(mut self, input: ::std::option::Option<crate::types::KeyOrigin>) -> Self {
        self.key_origin = input;
        self
    }
    /// <p>The source of the key material. For keys created within Amazon Web Services Payment Cryptography, the value is <code>AWS_PAYMENT_CRYPTOGRAPHY</code>. For keys imported into Amazon Web Services Payment Cryptography, the value is <code>EXTERNAL</code>.</p>
    pub fn get_key_origin(&self) -> &::std::option::Option<crate::types::KeyOrigin> {
        &self.key_origin
    }
    /// <p>The date and time when the key was created.</p>
    /// This field is required.
    pub fn create_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.create_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the key was created.</p>
    pub fn set_create_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.create_timestamp = input;
        self
    }
    /// <p>The date and time when the key was created.</p>
    pub fn get_create_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.create_timestamp
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will start using the key material for cryptographic operations.</p>
    pub fn usage_start_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.usage_start_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will start using the key material for cryptographic operations.</p>
    pub fn set_usage_start_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.usage_start_timestamp = input;
        self
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will start using the key material for cryptographic operations.</p>
    pub fn get_usage_start_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.usage_start_timestamp
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will stop using the key material for cryptographic operations.</p>
    pub fn usage_stop_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.usage_stop_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will stop using the key material for cryptographic operations.</p>
    pub fn set_usage_stop_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.usage_stop_timestamp = input;
        self
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will stop using the key material for cryptographic operations.</p>
    pub fn get_usage_stop_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.usage_stop_timestamp
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when <code>KeyState</code> is <code>DELETE_PENDING</code> and the key is scheduled for deletion.</p>
    pub fn delete_pending_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.delete_pending_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when <code>KeyState</code> is <code>DELETE_PENDING</code> and the key is scheduled for deletion.</p>
    pub fn set_delete_pending_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.delete_pending_timestamp = input;
        self
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when <code>KeyState</code> is <code>DELETE_PENDING</code> and the key is scheduled for deletion.</p>
    pub fn get_delete_pending_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.delete_pending_timestamp
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when when the <code>KeyState</code> is <code>DELETE_COMPLETE</code> and the Amazon Web Services Payment Cryptography key is deleted.</p>
    pub fn delete_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.delete_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when when the <code>KeyState</code> is <code>DELETE_COMPLETE</code> and the Amazon Web Services Payment Cryptography key is deleted.</p>
    pub fn set_delete_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.delete_timestamp = input;
        self
    }
    /// <p>The date and time after which Amazon Web Services Payment Cryptography will delete the key. This value is present only when when the <code>KeyState</code> is <code>DELETE_COMPLETE</code> and the Amazon Web Services Payment Cryptography key is deleted.</p>
    pub fn get_delete_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.delete_timestamp
    }
    /// <p>The cryptographic usage of an ECDH derived key as defined in section A.5.2 of the TR-31 spec.</p>
    pub fn derive_key_usage(mut self, input: crate::types::DeriveKeyUsage) -> Self {
        self.derive_key_usage = ::std::option::Option::Some(input);
        self
    }
    /// <p>The cryptographic usage of an ECDH derived key as defined in section A.5.2 of the TR-31 spec.</p>
    pub fn set_derive_key_usage(mut self, input: ::std::option::Option<crate::types::DeriveKeyUsage>) -> Self {
        self.derive_key_usage = input;
        self
    }
    /// <p>The cryptographic usage of an ECDH derived key as defined in section A.5.2 of the TR-31 spec.</p>
    pub fn get_derive_key_usage(&self) -> &::std::option::Option<crate::types::DeriveKeyUsage> {
        &self.derive_key_usage
    }
    /// <p>Indicates whether this key is a Multi-Region key and its role in the Multi-Region key hierarchy.</p>
    /// <p>Multi-Region replication keys allow the same key material to be used across multiple Amazon Web Services Regions. This field specifies whether the key is a Primary Region key (PRK) (which can be replicated to other Amazon Web Services Regions) or a Replica Region key (RRK) (which is a copy of a PRK in another Region). For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a>.</p>
    pub fn multi_region_key_type(mut self, input: crate::types::MultiRegionKeyType) -> Self {
        self.multi_region_key_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether this key is a Multi-Region key and its role in the Multi-Region key hierarchy.</p>
    /// <p>Multi-Region replication keys allow the same key material to be used across multiple Amazon Web Services Regions. This field specifies whether the key is a Primary Region key (PRK) (which can be replicated to other Amazon Web Services Regions) or a Replica Region key (RRK) (which is a copy of a PRK in another Region). For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a>.</p>
    pub fn set_multi_region_key_type(mut self, input: ::std::option::Option<crate::types::MultiRegionKeyType>) -> Self {
        self.multi_region_key_type = input;
        self
    }
    /// <p>Indicates whether this key is a Multi-Region key and its role in the Multi-Region key hierarchy.</p>
    /// <p>Multi-Region replication keys allow the same key material to be used across multiple Amazon Web Services Regions. This field specifies whether the key is a Primary Region key (PRK) (which can be replicated to other Amazon Web Services Regions) or a Replica Region key (RRK) (which is a copy of a PRK in another Region). For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a>.</p>
    pub fn get_multi_region_key_type(&self) -> &::std::option::Option<crate::types::MultiRegionKeyType> {
        &self.multi_region_key_type
    }
    /// <p>An Amazon Web Services Region identifier in the standard format (e.g., <code>us-east-1</code>, <code>eu-west-1</code>).</p>
    /// <p>Used to specify regions for key replication operations. The region must be a valid Amazon Web Services Region where Amazon Web Services Payment Cryptography is available.</p>
    pub fn primary_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.primary_region = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An Amazon Web Services Region identifier in the standard format (e.g., <code>us-east-1</code>, <code>eu-west-1</code>).</p>
    /// <p>Used to specify regions for key replication operations. The region must be a valid Amazon Web Services Region where Amazon Web Services Payment Cryptography is available.</p>
    pub fn set_primary_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.primary_region = input;
        self
    }
    /// <p>An Amazon Web Services Region identifier in the standard format (e.g., <code>us-east-1</code>, <code>eu-west-1</code>).</p>
    /// <p>Used to specify regions for key replication operations. The region must be a valid Amazon Web Services Region where Amazon Web Services Payment Cryptography is available.</p>
    pub fn get_primary_region(&self) -> &::std::option::Option<::std::string::String> {
        &self.primary_region
    }
    /// Adds a key-value pair to `replication_status`.
    ///
    /// To override the contents of this collection use [`set_replication_status`](Self::set_replication_status).
    ///
    /// <p>Information about the replication status of the key across different Amazon Web Services Regions.</p>
    /// <p>This field provides details about the current state of key replication, including any status messages or operational information. It helps track the progress and health of key replication operations.</p>
    pub fn replication_status(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ReplicationStatusType) -> Self {
        let mut hash_map = self.replication_status.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.replication_status = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Information about the replication status of the key across different Amazon Web Services Regions.</p>
    /// <p>This field provides details about the current state of key replication, including any status messages or operational information. It helps track the progress and health of key replication operations.</p>
    pub fn set_replication_status(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ReplicationStatusType>>,
    ) -> Self {
        self.replication_status = input;
        self
    }
    /// <p>Information about the replication status of the key across different Amazon Web Services Regions.</p>
    /// <p>This field provides details about the current state of key replication, including any status messages or operational information. It helps track the progress and health of key replication operations.</p>
    pub fn get_replication_status(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ReplicationStatusType>> {
        &self.replication_status
    }
    /// <p>Indicates whether this key is using the account's default replication regions configuration for <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a>.</p>
    /// <p>When set to <code>true</code>, the key automatically replicates to the regions specified in the account's default replication settings. When set to <code>false</code>, the key has a custom replication configuration that overrides the account defaults.</p>
    pub fn using_default_replication_regions(mut self, input: bool) -> Self {
        self.using_default_replication_regions = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether this key is using the account's default replication regions configuration for <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a>.</p>
    /// <p>When set to <code>true</code>, the key automatically replicates to the regions specified in the account's default replication settings. When set to <code>false</code>, the key has a custom replication configuration that overrides the account defaults.</p>
    pub fn set_using_default_replication_regions(mut self, input: ::std::option::Option<bool>) -> Self {
        self.using_default_replication_regions = input;
        self
    }
    /// <p>Indicates whether this key is using the account's default replication regions configuration for <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a>.</p>
    /// <p>When set to <code>true</code>, the key automatically replicates to the regions specified in the account's default replication settings. When set to <code>false</code>, the key has a custom replication configuration that overrides the account defaults.</p>
    pub fn get_using_default_replication_regions(&self) -> &::std::option::Option<bool> {
        &self.using_default_replication_regions
    }
    /// Consumes the builder and constructs a [`Key`](crate::types::Key).
    /// This method will fail if any of the following fields are not set:
    /// - [`key_arn`](crate::types::builders::KeyBuilder::key_arn)
    /// - [`key_check_value`](crate::types::builders::KeyBuilder::key_check_value)
    /// - [`key_check_value_algorithm`](crate::types::builders::KeyBuilder::key_check_value_algorithm)
    /// - [`enabled`](crate::types::builders::KeyBuilder::enabled)
    /// - [`exportable`](crate::types::builders::KeyBuilder::exportable)
    /// - [`key_state`](crate::types::builders::KeyBuilder::key_state)
    /// - [`key_origin`](crate::types::builders::KeyBuilder::key_origin)
    /// - [`create_timestamp`](crate::types::builders::KeyBuilder::create_timestamp)
    pub fn build(self) -> ::std::result::Result<crate::types::Key, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Key {
            key_arn: self.key_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "key_arn",
                    "key_arn was not specified but it is required when building Key",
                )
            })?,
            key_attributes: self.key_attributes,
            key_check_value: self.key_check_value.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "key_check_value",
                    "key_check_value was not specified but it is required when building Key",
                )
            })?,
            key_check_value_algorithm: self.key_check_value_algorithm.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "key_check_value_algorithm",
                    "key_check_value_algorithm was not specified but it is required when building Key",
                )
            })?,
            enabled: self.enabled.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "enabled",
                    "enabled was not specified but it is required when building Key",
                )
            })?,
            exportable: self.exportable.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "exportable",
                    "exportable was not specified but it is required when building Key",
                )
            })?,
            key_state: self.key_state.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "key_state",
                    "key_state was not specified but it is required when building Key",
                )
            })?,
            key_origin: self.key_origin.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "key_origin",
                    "key_origin was not specified but it is required when building Key",
                )
            })?,
            create_timestamp: self.create_timestamp.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "create_timestamp",
                    "create_timestamp was not specified but it is required when building Key",
                )
            })?,
            usage_start_timestamp: self.usage_start_timestamp,
            usage_stop_timestamp: self.usage_stop_timestamp,
            delete_pending_timestamp: self.delete_pending_timestamp,
            delete_timestamp: self.delete_timestamp,
            derive_key_usage: self.derive_key_usage,
            multi_region_key_type: self.multi_region_key_type,
            primary_region: self.primary_region,
            replication_status: self.replication_status,
            using_default_replication_regions: self.using_default_replication_regions,
        })
    }
}