Skip to main content

rustack_kms_model/
types.rs

1//! Auto-generated from AWS KMS Smithy model. DO NOT EDIT.
2
3use std::collections::HashMap;
4
5use serde::{Deserialize, Serialize};
6
7/// KMS CustomerMasterKeySpec enum.
8#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
9pub enum CustomerMasterKeySpec {
10    /// Default variant.
11    #[default]
12    #[serde(rename = "ECC_NIST_P256")]
13    EccNistP256,
14    #[serde(rename = "ECC_NIST_P384")]
15    EccNistP384,
16    #[serde(rename = "ECC_NIST_P521")]
17    EccNistP521,
18    #[serde(rename = "ECC_SECG_P256K1")]
19    EccSecgP256k1,
20    #[serde(rename = "HMAC_224")]
21    Hmac224,
22    #[serde(rename = "HMAC_256")]
23    Hmac256,
24    #[serde(rename = "HMAC_384")]
25    Hmac384,
26    #[serde(rename = "HMAC_512")]
27    Hmac512,
28    #[serde(rename = "RSA_2048")]
29    Rsa2048,
30    #[serde(rename = "RSA_3072")]
31    Rsa3072,
32    #[serde(rename = "RSA_4096")]
33    Rsa4096,
34    #[serde(rename = "SM2")]
35    Sm2,
36    #[serde(rename = "SYMMETRIC_DEFAULT")]
37    SymmetricDefault,
38}
39
40impl CustomerMasterKeySpec {
41    /// Returns the string value of this enum variant.
42    #[must_use]
43    pub fn as_str(&self) -> &'static str {
44        match self {
45            Self::EccNistP256 => "ECC_NIST_P256",
46            Self::EccNistP384 => "ECC_NIST_P384",
47            Self::EccNistP521 => "ECC_NIST_P521",
48            Self::EccSecgP256k1 => "ECC_SECG_P256K1",
49            Self::Hmac224 => "HMAC_224",
50            Self::Hmac256 => "HMAC_256",
51            Self::Hmac384 => "HMAC_384",
52            Self::Hmac512 => "HMAC_512",
53            Self::Rsa2048 => "RSA_2048",
54            Self::Rsa3072 => "RSA_3072",
55            Self::Rsa4096 => "RSA_4096",
56            Self::Sm2 => "SM2",
57            Self::SymmetricDefault => "SYMMETRIC_DEFAULT",
58        }
59    }
60}
61
62impl std::fmt::Display for CustomerMasterKeySpec {
63    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
64        f.write_str(self.as_str())
65    }
66}
67
68impl From<&str> for CustomerMasterKeySpec {
69    fn from(s: &str) -> Self {
70        match s {
71            "ECC_NIST_P256" => Self::EccNistP256,
72            "ECC_NIST_P384" => Self::EccNistP384,
73            "ECC_NIST_P521" => Self::EccNistP521,
74            "ECC_SECG_P256K1" => Self::EccSecgP256k1,
75            "HMAC_224" => Self::Hmac224,
76            "HMAC_256" => Self::Hmac256,
77            "HMAC_384" => Self::Hmac384,
78            "HMAC_512" => Self::Hmac512,
79            "RSA_2048" => Self::Rsa2048,
80            "RSA_3072" => Self::Rsa3072,
81            "RSA_4096" => Self::Rsa4096,
82            "SM2" => Self::Sm2,
83            "SYMMETRIC_DEFAULT" => Self::SymmetricDefault,
84            _ => Self::default(),
85        }
86    }
87}
88
89/// KMS DataKeyPairSpec enum.
90#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
91pub enum DataKeyPairSpec {
92    /// Default variant.
93    #[default]
94    #[serde(rename = "ECC_NIST_EDWARDS25519")]
95    EccNistEdwards25519,
96    #[serde(rename = "ECC_NIST_P256")]
97    EccNistP256,
98    #[serde(rename = "ECC_NIST_P384")]
99    EccNistP384,
100    #[serde(rename = "ECC_NIST_P521")]
101    EccNistP521,
102    #[serde(rename = "ECC_SECG_P256K1")]
103    EccSecgP256k1,
104    #[serde(rename = "RSA_2048")]
105    Rsa2048,
106    #[serde(rename = "RSA_3072")]
107    Rsa3072,
108    #[serde(rename = "RSA_4096")]
109    Rsa4096,
110    #[serde(rename = "SM2")]
111    Sm2,
112}
113
114impl DataKeyPairSpec {
115    /// Returns the string value of this enum variant.
116    #[must_use]
117    pub fn as_str(&self) -> &'static str {
118        match self {
119            Self::EccNistEdwards25519 => "ECC_NIST_EDWARDS25519",
120            Self::EccNistP256 => "ECC_NIST_P256",
121            Self::EccNistP384 => "ECC_NIST_P384",
122            Self::EccNistP521 => "ECC_NIST_P521",
123            Self::EccSecgP256k1 => "ECC_SECG_P256K1",
124            Self::Rsa2048 => "RSA_2048",
125            Self::Rsa3072 => "RSA_3072",
126            Self::Rsa4096 => "RSA_4096",
127            Self::Sm2 => "SM2",
128        }
129    }
130}
131
132impl std::fmt::Display for DataKeyPairSpec {
133    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
134        f.write_str(self.as_str())
135    }
136}
137
138impl From<&str> for DataKeyPairSpec {
139    fn from(s: &str) -> Self {
140        match s {
141            "ECC_NIST_EDWARDS25519" => Self::EccNistEdwards25519,
142            "ECC_NIST_P256" => Self::EccNistP256,
143            "ECC_NIST_P384" => Self::EccNistP384,
144            "ECC_NIST_P521" => Self::EccNistP521,
145            "ECC_SECG_P256K1" => Self::EccSecgP256k1,
146            "RSA_2048" => Self::Rsa2048,
147            "RSA_3072" => Self::Rsa3072,
148            "RSA_4096" => Self::Rsa4096,
149            "SM2" => Self::Sm2,
150            _ => Self::default(),
151        }
152    }
153}
154
155/// KMS DataKeySpec enum.
156#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
157pub enum DataKeySpec {
158    /// Default variant.
159    #[default]
160    #[serde(rename = "AES_128")]
161    Aes128,
162    #[serde(rename = "AES_256")]
163    Aes256,
164}
165
166impl DataKeySpec {
167    /// Returns the string value of this enum variant.
168    #[must_use]
169    pub fn as_str(&self) -> &'static str {
170        match self {
171            Self::Aes128 => "AES_128",
172            Self::Aes256 => "AES_256",
173        }
174    }
175}
176
177impl std::fmt::Display for DataKeySpec {
178    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
179        f.write_str(self.as_str())
180    }
181}
182
183impl From<&str> for DataKeySpec {
184    fn from(s: &str) -> Self {
185        match s {
186            "AES_128" => Self::Aes128,
187            "AES_256" => Self::Aes256,
188            _ => Self::default(),
189        }
190    }
191}
192
193/// KMS DryRunModifierType enum.
194#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
195pub enum DryRunModifierType {
196    /// Default variant.
197    #[default]
198    #[serde(rename = "IGNORE_CIPHERTEXT")]
199    IgnoreCiphertext,
200}
201
202impl DryRunModifierType {
203    /// Returns the string value of this enum variant.
204    #[must_use]
205    pub fn as_str(&self) -> &'static str {
206        match self {
207            Self::IgnoreCiphertext => "IGNORE_CIPHERTEXT",
208        }
209    }
210}
211
212impl std::fmt::Display for DryRunModifierType {
213    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
214        f.write_str(self.as_str())
215    }
216}
217
218impl From<&str> for DryRunModifierType {
219    fn from(s: &str) -> Self {
220        match s {
221            "IGNORE_CIPHERTEXT" => Self::IgnoreCiphertext,
222            _ => Self::default(),
223        }
224    }
225}
226
227/// KMS EncryptionAlgorithmSpec enum.
228#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
229pub enum EncryptionAlgorithmSpec {
230    /// Default variant.
231    #[default]
232    #[serde(rename = "RSAES_OAEP_SHA_1")]
233    RsaesOaepSha1,
234    #[serde(rename = "RSAES_OAEP_SHA_256")]
235    RsaesOaepSha256,
236    #[serde(rename = "SM2PKE")]
237    Sm2pke,
238    #[serde(rename = "SYMMETRIC_DEFAULT")]
239    SymmetricDefault,
240}
241
242impl EncryptionAlgorithmSpec {
243    /// Returns the string value of this enum variant.
244    #[must_use]
245    pub fn as_str(&self) -> &'static str {
246        match self {
247            Self::RsaesOaepSha1 => "RSAES_OAEP_SHA_1",
248            Self::RsaesOaepSha256 => "RSAES_OAEP_SHA_256",
249            Self::Sm2pke => "SM2PKE",
250            Self::SymmetricDefault => "SYMMETRIC_DEFAULT",
251        }
252    }
253}
254
255impl std::fmt::Display for EncryptionAlgorithmSpec {
256    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
257        f.write_str(self.as_str())
258    }
259}
260
261impl From<&str> for EncryptionAlgorithmSpec {
262    fn from(s: &str) -> Self {
263        match s {
264            "RSAES_OAEP_SHA_1" => Self::RsaesOaepSha1,
265            "RSAES_OAEP_SHA_256" => Self::RsaesOaepSha256,
266            "SM2PKE" => Self::Sm2pke,
267            "SYMMETRIC_DEFAULT" => Self::SymmetricDefault,
268            _ => Self::default(),
269        }
270    }
271}
272
273/// KMS ExpirationModelType enum.
274#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
275pub enum ExpirationModelType {
276    /// Default variant.
277    #[default]
278    #[serde(rename = "KEY_MATERIAL_DOES_NOT_EXPIRE")]
279    KeyMaterialDoesNotExpire,
280    #[serde(rename = "KEY_MATERIAL_EXPIRES")]
281    KeyMaterialExpires,
282}
283
284impl ExpirationModelType {
285    /// Returns the string value of this enum variant.
286    #[must_use]
287    pub fn as_str(&self) -> &'static str {
288        match self {
289            Self::KeyMaterialDoesNotExpire => "KEY_MATERIAL_DOES_NOT_EXPIRE",
290            Self::KeyMaterialExpires => "KEY_MATERIAL_EXPIRES",
291        }
292    }
293}
294
295impl std::fmt::Display for ExpirationModelType {
296    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
297        f.write_str(self.as_str())
298    }
299}
300
301impl From<&str> for ExpirationModelType {
302    fn from(s: &str) -> Self {
303        match s {
304            "KEY_MATERIAL_DOES_NOT_EXPIRE" => Self::KeyMaterialDoesNotExpire,
305            "KEY_MATERIAL_EXPIRES" => Self::KeyMaterialExpires,
306            _ => Self::default(),
307        }
308    }
309}
310
311/// KMS GrantOperation enum.
312#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
313pub enum GrantOperation {
314    /// Default variant.
315    #[default]
316    CreateGrant,
317    Decrypt,
318    DeriveSharedSecret,
319    DescribeKey,
320    Encrypt,
321    GenerateDataKey,
322    GenerateDataKeyPair,
323    GenerateDataKeyPairWithoutPlaintext,
324    GenerateDataKeyWithoutPlaintext,
325    GenerateMac,
326    GetPublicKey,
327    ReEncryptFrom,
328    ReEncryptTo,
329    RetireGrant,
330    Sign,
331    Verify,
332    VerifyMac,
333}
334
335impl GrantOperation {
336    /// Returns the string value of this enum variant.
337    #[must_use]
338    pub fn as_str(&self) -> &'static str {
339        match self {
340            Self::CreateGrant => "CreateGrant",
341            Self::Decrypt => "Decrypt",
342            Self::DeriveSharedSecret => "DeriveSharedSecret",
343            Self::DescribeKey => "DescribeKey",
344            Self::Encrypt => "Encrypt",
345            Self::GenerateDataKey => "GenerateDataKey",
346            Self::GenerateDataKeyPair => "GenerateDataKeyPair",
347            Self::GenerateDataKeyPairWithoutPlaintext => "GenerateDataKeyPairWithoutPlaintext",
348            Self::GenerateDataKeyWithoutPlaintext => "GenerateDataKeyWithoutPlaintext",
349            Self::GenerateMac => "GenerateMac",
350            Self::GetPublicKey => "GetPublicKey",
351            Self::ReEncryptFrom => "ReEncryptFrom",
352            Self::ReEncryptTo => "ReEncryptTo",
353            Self::RetireGrant => "RetireGrant",
354            Self::Sign => "Sign",
355            Self::Verify => "Verify",
356            Self::VerifyMac => "VerifyMac",
357        }
358    }
359}
360
361impl std::fmt::Display for GrantOperation {
362    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
363        f.write_str(self.as_str())
364    }
365}
366
367impl From<&str> for GrantOperation {
368    fn from(s: &str) -> Self {
369        match s {
370            "CreateGrant" => Self::CreateGrant,
371            "Decrypt" => Self::Decrypt,
372            "DeriveSharedSecret" => Self::DeriveSharedSecret,
373            "DescribeKey" => Self::DescribeKey,
374            "Encrypt" => Self::Encrypt,
375            "GenerateDataKey" => Self::GenerateDataKey,
376            "GenerateDataKeyPair" => Self::GenerateDataKeyPair,
377            "GenerateDataKeyPairWithoutPlaintext" => Self::GenerateDataKeyPairWithoutPlaintext,
378            "GenerateDataKeyWithoutPlaintext" => Self::GenerateDataKeyWithoutPlaintext,
379            "GenerateMac" => Self::GenerateMac,
380            "GetPublicKey" => Self::GetPublicKey,
381            "ReEncryptFrom" => Self::ReEncryptFrom,
382            "ReEncryptTo" => Self::ReEncryptTo,
383            "RetireGrant" => Self::RetireGrant,
384            "Sign" => Self::Sign,
385            "Verify" => Self::Verify,
386            "VerifyMac" => Self::VerifyMac,
387            _ => Self::default(),
388        }
389    }
390}
391
392/// KMS KeyAgreementAlgorithmSpec enum.
393#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
394pub enum KeyAgreementAlgorithmSpec {
395    /// Default variant.
396    #[default]
397    #[serde(rename = "ECDH")]
398    Ecdh,
399}
400
401impl KeyAgreementAlgorithmSpec {
402    /// Returns the string value of this enum variant.
403    #[must_use]
404    pub fn as_str(&self) -> &'static str {
405        match self {
406            Self::Ecdh => "ECDH",
407        }
408    }
409}
410
411impl std::fmt::Display for KeyAgreementAlgorithmSpec {
412    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
413        f.write_str(self.as_str())
414    }
415}
416
417impl From<&str> for KeyAgreementAlgorithmSpec {
418    fn from(s: &str) -> Self {
419        match s {
420            "ECDH" => Self::Ecdh,
421            _ => Self::default(),
422        }
423    }
424}
425
426/// KMS KeyEncryptionMechanism enum.
427#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
428pub enum KeyEncryptionMechanism {
429    /// Default variant.
430    #[default]
431    #[serde(rename = "RSAES_OAEP_SHA_256")]
432    RsaesOaepSha256,
433}
434
435impl KeyEncryptionMechanism {
436    /// Returns the string value of this enum variant.
437    #[must_use]
438    pub fn as_str(&self) -> &'static str {
439        match self {
440            Self::RsaesOaepSha256 => "RSAES_OAEP_SHA_256",
441        }
442    }
443}
444
445impl std::fmt::Display for KeyEncryptionMechanism {
446    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
447        f.write_str(self.as_str())
448    }
449}
450
451impl From<&str> for KeyEncryptionMechanism {
452    fn from(s: &str) -> Self {
453        match s {
454            "RSAES_OAEP_SHA_256" => Self::RsaesOaepSha256,
455            _ => Self::default(),
456        }
457    }
458}
459
460/// KMS KeyManagerType enum.
461#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
462pub enum KeyManagerType {
463    /// Default variant.
464    #[default]
465    #[serde(rename = "AWS")]
466    Aws,
467    #[serde(rename = "CUSTOMER")]
468    Customer,
469}
470
471impl KeyManagerType {
472    /// Returns the string value of this enum variant.
473    #[must_use]
474    pub fn as_str(&self) -> &'static str {
475        match self {
476            Self::Aws => "AWS",
477            Self::Customer => "CUSTOMER",
478        }
479    }
480}
481
482impl std::fmt::Display for KeyManagerType {
483    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
484        f.write_str(self.as_str())
485    }
486}
487
488impl From<&str> for KeyManagerType {
489    fn from(s: &str) -> Self {
490        match s {
491            "AWS" => Self::Aws,
492            "CUSTOMER" => Self::Customer,
493            _ => Self::default(),
494        }
495    }
496}
497
498/// KMS KeySpec enum.
499#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
500pub enum KeySpec {
501    /// Default variant.
502    #[default]
503    #[serde(rename = "ECC_NIST_EDWARDS25519")]
504    EccNistEdwards25519,
505    #[serde(rename = "ECC_NIST_P256")]
506    EccNistP256,
507    #[serde(rename = "ECC_NIST_P384")]
508    EccNistP384,
509    #[serde(rename = "ECC_NIST_P521")]
510    EccNistP521,
511    #[serde(rename = "ECC_SECG_P256K1")]
512    EccSecgP256k1,
513    #[serde(rename = "HMAC_224")]
514    Hmac224,
515    #[serde(rename = "HMAC_256")]
516    Hmac256,
517    #[serde(rename = "HMAC_384")]
518    Hmac384,
519    #[serde(rename = "HMAC_512")]
520    Hmac512,
521    #[serde(rename = "ML_DSA_44")]
522    MlDsa44,
523    #[serde(rename = "ML_DSA_65")]
524    MlDsa65,
525    #[serde(rename = "ML_DSA_87")]
526    MlDsa87,
527    #[serde(rename = "RSA_2048")]
528    Rsa2048,
529    #[serde(rename = "RSA_3072")]
530    Rsa3072,
531    #[serde(rename = "RSA_4096")]
532    Rsa4096,
533    #[serde(rename = "SM2")]
534    Sm2,
535    #[serde(rename = "SYMMETRIC_DEFAULT")]
536    SymmetricDefault,
537}
538
539impl KeySpec {
540    /// Returns the string value of this enum variant.
541    #[must_use]
542    pub fn as_str(&self) -> &'static str {
543        match self {
544            Self::EccNistEdwards25519 => "ECC_NIST_EDWARDS25519",
545            Self::EccNistP256 => "ECC_NIST_P256",
546            Self::EccNistP384 => "ECC_NIST_P384",
547            Self::EccNistP521 => "ECC_NIST_P521",
548            Self::EccSecgP256k1 => "ECC_SECG_P256K1",
549            Self::Hmac224 => "HMAC_224",
550            Self::Hmac256 => "HMAC_256",
551            Self::Hmac384 => "HMAC_384",
552            Self::Hmac512 => "HMAC_512",
553            Self::MlDsa44 => "ML_DSA_44",
554            Self::MlDsa65 => "ML_DSA_65",
555            Self::MlDsa87 => "ML_DSA_87",
556            Self::Rsa2048 => "RSA_2048",
557            Self::Rsa3072 => "RSA_3072",
558            Self::Rsa4096 => "RSA_4096",
559            Self::Sm2 => "SM2",
560            Self::SymmetricDefault => "SYMMETRIC_DEFAULT",
561        }
562    }
563}
564
565impl std::fmt::Display for KeySpec {
566    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
567        f.write_str(self.as_str())
568    }
569}
570
571impl From<&str> for KeySpec {
572    fn from(s: &str) -> Self {
573        match s {
574            "ECC_NIST_EDWARDS25519" => Self::EccNistEdwards25519,
575            "ECC_NIST_P256" => Self::EccNistP256,
576            "ECC_NIST_P384" => Self::EccNistP384,
577            "ECC_NIST_P521" => Self::EccNistP521,
578            "ECC_SECG_P256K1" => Self::EccSecgP256k1,
579            "HMAC_224" => Self::Hmac224,
580            "HMAC_256" => Self::Hmac256,
581            "HMAC_384" => Self::Hmac384,
582            "HMAC_512" => Self::Hmac512,
583            "ML_DSA_44" => Self::MlDsa44,
584            "ML_DSA_65" => Self::MlDsa65,
585            "ML_DSA_87" => Self::MlDsa87,
586            "RSA_2048" => Self::Rsa2048,
587            "RSA_3072" => Self::Rsa3072,
588            "RSA_4096" => Self::Rsa4096,
589            "SM2" => Self::Sm2,
590            "SYMMETRIC_DEFAULT" => Self::SymmetricDefault,
591            _ => Self::default(),
592        }
593    }
594}
595
596/// KMS KeyState enum.
597#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
598pub enum KeyState {
599    /// Default variant.
600    #[default]
601    Creating,
602    Disabled,
603    Enabled,
604    PendingDeletion,
605    PendingImport,
606    PendingReplicaDeletion,
607    Unavailable,
608    Updating,
609}
610
611impl KeyState {
612    /// Returns the string value of this enum variant.
613    #[must_use]
614    pub fn as_str(&self) -> &'static str {
615        match self {
616            Self::Creating => "Creating",
617            Self::Disabled => "Disabled",
618            Self::Enabled => "Enabled",
619            Self::PendingDeletion => "PendingDeletion",
620            Self::PendingImport => "PendingImport",
621            Self::PendingReplicaDeletion => "PendingReplicaDeletion",
622            Self::Unavailable => "Unavailable",
623            Self::Updating => "Updating",
624        }
625    }
626}
627
628impl std::fmt::Display for KeyState {
629    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
630        f.write_str(self.as_str())
631    }
632}
633
634impl From<&str> for KeyState {
635    fn from(s: &str) -> Self {
636        match s {
637            "Creating" => Self::Creating,
638            "Disabled" => Self::Disabled,
639            "Enabled" => Self::Enabled,
640            "PendingDeletion" => Self::PendingDeletion,
641            "PendingImport" => Self::PendingImport,
642            "PendingReplicaDeletion" => Self::PendingReplicaDeletion,
643            "Unavailable" => Self::Unavailable,
644            "Updating" => Self::Updating,
645            _ => Self::default(),
646        }
647    }
648}
649
650/// KMS KeyUsageType enum.
651#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
652pub enum KeyUsageType {
653    /// Default variant.
654    #[default]
655    #[serde(rename = "ENCRYPT_DECRYPT")]
656    EncryptDecrypt,
657    #[serde(rename = "GENERATE_VERIFY_MAC")]
658    GenerateVerifyMac,
659    #[serde(rename = "KEY_AGREEMENT")]
660    KeyAgreement,
661    #[serde(rename = "SIGN_VERIFY")]
662    SignVerify,
663}
664
665impl KeyUsageType {
666    /// Returns the string value of this enum variant.
667    #[must_use]
668    pub fn as_str(&self) -> &'static str {
669        match self {
670            Self::EncryptDecrypt => "ENCRYPT_DECRYPT",
671            Self::GenerateVerifyMac => "GENERATE_VERIFY_MAC",
672            Self::KeyAgreement => "KEY_AGREEMENT",
673            Self::SignVerify => "SIGN_VERIFY",
674        }
675    }
676}
677
678impl std::fmt::Display for KeyUsageType {
679    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
680        f.write_str(self.as_str())
681    }
682}
683
684impl From<&str> for KeyUsageType {
685    fn from(s: &str) -> Self {
686        match s {
687            "ENCRYPT_DECRYPT" => Self::EncryptDecrypt,
688            "GENERATE_VERIFY_MAC" => Self::GenerateVerifyMac,
689            "KEY_AGREEMENT" => Self::KeyAgreement,
690            "SIGN_VERIFY" => Self::SignVerify,
691            _ => Self::default(),
692        }
693    }
694}
695
696/// KMS MacAlgorithmSpec enum.
697#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
698pub enum MacAlgorithmSpec {
699    /// Default variant.
700    #[default]
701    #[serde(rename = "HMAC_SHA_224")]
702    HmacSha224,
703    #[serde(rename = "HMAC_SHA_256")]
704    HmacSha256,
705    #[serde(rename = "HMAC_SHA_384")]
706    HmacSha384,
707    #[serde(rename = "HMAC_SHA_512")]
708    HmacSha512,
709}
710
711impl MacAlgorithmSpec {
712    /// Returns the string value of this enum variant.
713    #[must_use]
714    pub fn as_str(&self) -> &'static str {
715        match self {
716            Self::HmacSha224 => "HMAC_SHA_224",
717            Self::HmacSha256 => "HMAC_SHA_256",
718            Self::HmacSha384 => "HMAC_SHA_384",
719            Self::HmacSha512 => "HMAC_SHA_512",
720        }
721    }
722}
723
724impl std::fmt::Display for MacAlgorithmSpec {
725    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
726        f.write_str(self.as_str())
727    }
728}
729
730impl From<&str> for MacAlgorithmSpec {
731    fn from(s: &str) -> Self {
732        match s {
733            "HMAC_SHA_224" => Self::HmacSha224,
734            "HMAC_SHA_256" => Self::HmacSha256,
735            "HMAC_SHA_384" => Self::HmacSha384,
736            "HMAC_SHA_512" => Self::HmacSha512,
737            _ => Self::default(),
738        }
739    }
740}
741
742/// KMS MessageType enum.
743#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
744pub enum MessageType {
745    /// Default variant.
746    #[default]
747    #[serde(rename = "DIGEST")]
748    Digest,
749    #[serde(rename = "EXTERNAL_MU")]
750    ExternalMu,
751    #[serde(rename = "RAW")]
752    Raw,
753}
754
755impl MessageType {
756    /// Returns the string value of this enum variant.
757    #[must_use]
758    pub fn as_str(&self) -> &'static str {
759        match self {
760            Self::Digest => "DIGEST",
761            Self::ExternalMu => "EXTERNAL_MU",
762            Self::Raw => "RAW",
763        }
764    }
765}
766
767impl std::fmt::Display for MessageType {
768    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
769        f.write_str(self.as_str())
770    }
771}
772
773impl From<&str> for MessageType {
774    fn from(s: &str) -> Self {
775        match s {
776            "DIGEST" => Self::Digest,
777            "EXTERNAL_MU" => Self::ExternalMu,
778            "RAW" => Self::Raw,
779            _ => Self::default(),
780        }
781    }
782}
783
784/// KMS MultiRegionKeyType enum.
785#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
786pub enum MultiRegionKeyType {
787    /// Default variant.
788    #[default]
789    #[serde(rename = "PRIMARY")]
790    Primary,
791    #[serde(rename = "REPLICA")]
792    Replica,
793}
794
795impl MultiRegionKeyType {
796    /// Returns the string value of this enum variant.
797    #[must_use]
798    pub fn as_str(&self) -> &'static str {
799        match self {
800            Self::Primary => "PRIMARY",
801            Self::Replica => "REPLICA",
802        }
803    }
804}
805
806impl std::fmt::Display for MultiRegionKeyType {
807    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
808        f.write_str(self.as_str())
809    }
810}
811
812impl From<&str> for MultiRegionKeyType {
813    fn from(s: &str) -> Self {
814        match s {
815            "PRIMARY" => Self::Primary,
816            "REPLICA" => Self::Replica,
817            _ => Self::default(),
818        }
819    }
820}
821
822/// KMS OriginType enum.
823#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
824pub enum OriginType {
825    /// Default variant.
826    #[default]
827    #[serde(rename = "AWS_CLOUDHSM")]
828    AwsCloudhsm,
829    #[serde(rename = "AWS_KMS")]
830    AwsKms,
831    #[serde(rename = "EXTERNAL")]
832    External,
833    #[serde(rename = "EXTERNAL_KEY_STORE")]
834    ExternalKeyStore,
835}
836
837impl OriginType {
838    /// Returns the string value of this enum variant.
839    #[must_use]
840    pub fn as_str(&self) -> &'static str {
841        match self {
842            Self::AwsCloudhsm => "AWS_CLOUDHSM",
843            Self::AwsKms => "AWS_KMS",
844            Self::External => "EXTERNAL",
845            Self::ExternalKeyStore => "EXTERNAL_KEY_STORE",
846        }
847    }
848}
849
850impl std::fmt::Display for OriginType {
851    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
852        f.write_str(self.as_str())
853    }
854}
855
856impl From<&str> for OriginType {
857    fn from(s: &str) -> Self {
858        match s {
859            "AWS_CLOUDHSM" => Self::AwsCloudhsm,
860            "AWS_KMS" => Self::AwsKms,
861            "EXTERNAL" => Self::External,
862            "EXTERNAL_KEY_STORE" => Self::ExternalKeyStore,
863            _ => Self::default(),
864        }
865    }
866}
867
868/// KMS SigningAlgorithmSpec enum.
869#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
870pub enum SigningAlgorithmSpec {
871    /// Default variant.
872    #[default]
873    #[serde(rename = "ECDSA_SHA_256")]
874    EcdsaSha256,
875    #[serde(rename = "ECDSA_SHA_384")]
876    EcdsaSha384,
877    #[serde(rename = "ECDSA_SHA_512")]
878    EcdsaSha512,
879    #[serde(rename = "ED25519_PH_SHA_512")]
880    Ed25519PhSha512,
881    #[serde(rename = "ED25519_SHA_512")]
882    Ed25519Sha512,
883    #[serde(rename = "ML_DSA_SHAKE_256")]
884    MlDsaShake256,
885    #[serde(rename = "RSASSA_PKCS1_V1_5_SHA_256")]
886    RsassaPkcs1V15Sha256,
887    #[serde(rename = "RSASSA_PKCS1_V1_5_SHA_384")]
888    RsassaPkcs1V15Sha384,
889    #[serde(rename = "RSASSA_PKCS1_V1_5_SHA_512")]
890    RsassaPkcs1V15Sha512,
891    #[serde(rename = "RSASSA_PSS_SHA_256")]
892    RsassaPssSha256,
893    #[serde(rename = "RSASSA_PSS_SHA_384")]
894    RsassaPssSha384,
895    #[serde(rename = "RSASSA_PSS_SHA_512")]
896    RsassaPssSha512,
897    #[serde(rename = "SM2DSA")]
898    Sm2dsa,
899}
900
901impl SigningAlgorithmSpec {
902    /// Returns the string value of this enum variant.
903    #[must_use]
904    pub fn as_str(&self) -> &'static str {
905        match self {
906            Self::EcdsaSha256 => "ECDSA_SHA_256",
907            Self::EcdsaSha384 => "ECDSA_SHA_384",
908            Self::EcdsaSha512 => "ECDSA_SHA_512",
909            Self::Ed25519PhSha512 => "ED25519_PH_SHA_512",
910            Self::Ed25519Sha512 => "ED25519_SHA_512",
911            Self::MlDsaShake256 => "ML_DSA_SHAKE_256",
912            Self::RsassaPkcs1V15Sha256 => "RSASSA_PKCS1_V1_5_SHA_256",
913            Self::RsassaPkcs1V15Sha384 => "RSASSA_PKCS1_V1_5_SHA_384",
914            Self::RsassaPkcs1V15Sha512 => "RSASSA_PKCS1_V1_5_SHA_512",
915            Self::RsassaPssSha256 => "RSASSA_PSS_SHA_256",
916            Self::RsassaPssSha384 => "RSASSA_PSS_SHA_384",
917            Self::RsassaPssSha512 => "RSASSA_PSS_SHA_512",
918            Self::Sm2dsa => "SM2DSA",
919        }
920    }
921}
922
923impl std::fmt::Display for SigningAlgorithmSpec {
924    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
925        f.write_str(self.as_str())
926    }
927}
928
929impl From<&str> for SigningAlgorithmSpec {
930    fn from(s: &str) -> Self {
931        match s {
932            "ECDSA_SHA_256" => Self::EcdsaSha256,
933            "ECDSA_SHA_384" => Self::EcdsaSha384,
934            "ECDSA_SHA_512" => Self::EcdsaSha512,
935            "ED25519_PH_SHA_512" => Self::Ed25519PhSha512,
936            "ED25519_SHA_512" => Self::Ed25519Sha512,
937            "ML_DSA_SHAKE_256" => Self::MlDsaShake256,
938            "RSASSA_PKCS1_V1_5_SHA_256" => Self::RsassaPkcs1V15Sha256,
939            "RSASSA_PKCS1_V1_5_SHA_384" => Self::RsassaPkcs1V15Sha384,
940            "RSASSA_PKCS1_V1_5_SHA_512" => Self::RsassaPkcs1V15Sha512,
941            "RSASSA_PSS_SHA_256" => Self::RsassaPssSha256,
942            "RSASSA_PSS_SHA_384" => Self::RsassaPssSha384,
943            "RSASSA_PSS_SHA_512" => Self::RsassaPssSha512,
944            "SM2DSA" => Self::Sm2dsa,
945            _ => Self::default(),
946        }
947    }
948}
949
950/// KMS AliasListEntry.
951#[derive(Debug, Clone, Default, Serialize, Deserialize)]
952#[serde(rename_all = "PascalCase")]
953pub struct AliasListEntry {
954    #[serde(skip_serializing_if = "Option::is_none")]
955    pub alias_arn: Option<String>,
956    #[serde(skip_serializing_if = "Option::is_none")]
957    pub alias_name: Option<String>,
958    #[serde(
959        skip_serializing_if = "Option::is_none",
960        serialize_with = "crate::epoch_seconds::option::serialize",
961        deserialize_with = "crate::epoch_seconds::option::deserialize"
962    )]
963    pub creation_date: Option<chrono::DateTime<chrono::Utc>>,
964    #[serde(
965        skip_serializing_if = "Option::is_none",
966        serialize_with = "crate::epoch_seconds::option::serialize",
967        deserialize_with = "crate::epoch_seconds::option::deserialize"
968    )]
969    pub last_updated_date: Option<chrono::DateTime<chrono::Utc>>,
970    #[serde(skip_serializing_if = "Option::is_none")]
971    pub target_key_id: Option<String>,
972}
973
974/// KMS GrantConstraints.
975#[derive(Debug, Clone, Default, Serialize, Deserialize)]
976#[serde(rename_all = "PascalCase")]
977pub struct GrantConstraints {
978    #[serde(default, skip_serializing_if = "HashMap::is_empty")]
979    pub encryption_context_equals: HashMap<String, String>,
980    #[serde(default, skip_serializing_if = "HashMap::is_empty")]
981    pub encryption_context_subset: HashMap<String, String>,
982}
983
984/// KMS GrantListEntry.
985#[derive(Debug, Clone, Default, Serialize, Deserialize)]
986#[serde(rename_all = "PascalCase")]
987pub struct GrantListEntry {
988    #[serde(skip_serializing_if = "Option::is_none")]
989    pub constraints: Option<GrantConstraints>,
990    #[serde(
991        skip_serializing_if = "Option::is_none",
992        serialize_with = "crate::epoch_seconds::option::serialize",
993        deserialize_with = "crate::epoch_seconds::option::deserialize"
994    )]
995    pub creation_date: Option<chrono::DateTime<chrono::Utc>>,
996    #[serde(skip_serializing_if = "Option::is_none")]
997    pub grant_id: Option<String>,
998    #[serde(skip_serializing_if = "Option::is_none")]
999    pub grantee_principal: Option<String>,
1000    #[serde(skip_serializing_if = "Option::is_none")]
1001    pub issuing_account: Option<String>,
1002    #[serde(skip_serializing_if = "Option::is_none")]
1003    pub key_id: Option<String>,
1004    #[serde(skip_serializing_if = "Option::is_none")]
1005    pub name: Option<String>,
1006    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1007    pub operations: Vec<GrantOperation>,
1008    #[serde(skip_serializing_if = "Option::is_none")]
1009    pub retiring_principal: Option<String>,
1010}
1011
1012/// KMS KeyListEntry.
1013#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1014#[serde(rename_all = "PascalCase")]
1015pub struct KeyListEntry {
1016    #[serde(skip_serializing_if = "Option::is_none")]
1017    pub key_arn: Option<String>,
1018    #[serde(skip_serializing_if = "Option::is_none")]
1019    pub key_id: Option<String>,
1020}
1021
1022/// KMS KeyMetadata.
1023#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1024#[serde(rename_all = "PascalCase")]
1025pub struct KeyMetadata {
1026    #[serde(rename = "AWSAccountId")]
1027    #[serde(skip_serializing_if = "Option::is_none")]
1028    pub aws_account_id: Option<String>,
1029    #[serde(skip_serializing_if = "Option::is_none")]
1030    pub arn: Option<String>,
1031    #[serde(skip_serializing_if = "Option::is_none")]
1032    pub cloud_hsm_cluster_id: Option<String>,
1033    #[serde(
1034        skip_serializing_if = "Option::is_none",
1035        serialize_with = "crate::epoch_seconds::option::serialize",
1036        deserialize_with = "crate::epoch_seconds::option::deserialize"
1037    )]
1038    pub creation_date: Option<chrono::DateTime<chrono::Utc>>,
1039    #[serde(skip_serializing_if = "Option::is_none")]
1040    pub current_key_material_id: Option<String>,
1041    #[serde(skip_serializing_if = "Option::is_none")]
1042    pub custom_key_store_id: Option<String>,
1043    #[serde(skip_serializing_if = "Option::is_none")]
1044    pub customer_master_key_spec: Option<CustomerMasterKeySpec>,
1045    #[serde(
1046        skip_serializing_if = "Option::is_none",
1047        serialize_with = "crate::epoch_seconds::option::serialize",
1048        deserialize_with = "crate::epoch_seconds::option::deserialize"
1049    )]
1050    pub deletion_date: Option<chrono::DateTime<chrono::Utc>>,
1051    #[serde(skip_serializing_if = "Option::is_none")]
1052    pub description: Option<String>,
1053    #[serde(skip_serializing_if = "Option::is_none")]
1054    pub enabled: Option<bool>,
1055    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1056    pub encryption_algorithms: Vec<EncryptionAlgorithmSpec>,
1057    #[serde(skip_serializing_if = "Option::is_none")]
1058    pub expiration_model: Option<ExpirationModelType>,
1059    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1060    pub key_agreement_algorithms: Vec<KeyAgreementAlgorithmSpec>,
1061    pub key_id: String,
1062    #[serde(skip_serializing_if = "Option::is_none")]
1063    pub key_manager: Option<KeyManagerType>,
1064    #[serde(skip_serializing_if = "Option::is_none")]
1065    pub key_spec: Option<KeySpec>,
1066    #[serde(skip_serializing_if = "Option::is_none")]
1067    pub key_state: Option<KeyState>,
1068    #[serde(skip_serializing_if = "Option::is_none")]
1069    pub key_usage: Option<KeyUsageType>,
1070    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1071    pub mac_algorithms: Vec<MacAlgorithmSpec>,
1072    #[serde(skip_serializing_if = "Option::is_none")]
1073    pub multi_region: Option<bool>,
1074    #[serde(skip_serializing_if = "Option::is_none")]
1075    pub multi_region_configuration: Option<MultiRegionConfiguration>,
1076    #[serde(skip_serializing_if = "Option::is_none")]
1077    pub origin: Option<OriginType>,
1078    #[serde(skip_serializing_if = "Option::is_none")]
1079    pub pending_deletion_window_in_days: Option<i32>,
1080    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1081    pub signing_algorithms: Vec<SigningAlgorithmSpec>,
1082    #[serde(
1083        skip_serializing_if = "Option::is_none",
1084        serialize_with = "crate::epoch_seconds::option::serialize",
1085        deserialize_with = "crate::epoch_seconds::option::deserialize"
1086    )]
1087    pub valid_to: Option<chrono::DateTime<chrono::Utc>>,
1088    #[serde(skip_serializing_if = "Option::is_none")]
1089    pub xks_key_configuration: Option<XksKeyConfigurationType>,
1090}
1091
1092/// KMS MultiRegionConfiguration.
1093#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1094#[serde(rename_all = "PascalCase")]
1095pub struct MultiRegionConfiguration {
1096    #[serde(skip_serializing_if = "Option::is_none")]
1097    pub multi_region_key_type: Option<MultiRegionKeyType>,
1098    #[serde(skip_serializing_if = "Option::is_none")]
1099    pub primary_key: Option<MultiRegionKey>,
1100    #[serde(default, skip_serializing_if = "Vec::is_empty")]
1101    pub replica_keys: Vec<MultiRegionKey>,
1102}
1103
1104/// KMS MultiRegionKey.
1105#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1106#[serde(rename_all = "PascalCase")]
1107pub struct MultiRegionKey {
1108    #[serde(skip_serializing_if = "Option::is_none")]
1109    pub arn: Option<String>,
1110    #[serde(skip_serializing_if = "Option::is_none")]
1111    pub region: Option<String>,
1112}
1113
1114/// KMS RecipientInfo.
1115#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1116#[serde(rename_all = "PascalCase")]
1117pub struct RecipientInfo {
1118    #[serde(
1119        skip_serializing_if = "Option::is_none",
1120        serialize_with = "crate::blob::option::serialize",
1121        deserialize_with = "crate::blob::option::deserialize"
1122    )]
1123    pub attestation_document: Option<bytes::Bytes>,
1124    #[serde(skip_serializing_if = "Option::is_none")]
1125    pub key_encryption_algorithm: Option<KeyEncryptionMechanism>,
1126}
1127
1128/// KMS Tag.
1129#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1130#[serde(rename_all = "PascalCase")]
1131pub struct Tag {
1132    pub tag_key: String,
1133    pub tag_value: String,
1134}
1135
1136/// KMS XksKeyConfigurationType.
1137#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1138#[serde(rename_all = "PascalCase")]
1139pub struct XksKeyConfigurationType {
1140    #[serde(skip_serializing_if = "Option::is_none")]
1141    pub id: Option<String>,
1142}