Skip to main content

rustack_kms_model/
operations.rs

1//! Auto-generated from AWS KMS Smithy model. DO NOT EDIT.
2
3/// All supported Kms operations.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
5pub enum KmsOperation {
6    /// The CreateKey operation.
7    CreateKey,
8    /// The DescribeKey operation.
9    DescribeKey,
10    /// The ListKeys operation.
11    ListKeys,
12    /// The EnableKey operation.
13    EnableKey,
14    /// The DisableKey operation.
15    DisableKey,
16    /// The ScheduleKeyDeletion operation.
17    ScheduleKeyDeletion,
18    /// The CancelKeyDeletion operation.
19    CancelKeyDeletion,
20    /// The UpdateKeyDescription operation.
21    UpdateKeyDescription,
22    /// The Encrypt operation.
23    Encrypt,
24    /// The Decrypt operation.
25    Decrypt,
26    /// The ReEncrypt operation.
27    ReEncrypt,
28    /// The GenerateDataKey operation.
29    GenerateDataKey,
30    /// The GenerateDataKeyWithoutPlaintext operation.
31    GenerateDataKeyWithoutPlaintext,
32    /// The GenerateDataKeyPair operation.
33    GenerateDataKeyPair,
34    /// The GenerateDataKeyPairWithoutPlaintext operation.
35    GenerateDataKeyPairWithoutPlaintext,
36    /// The Sign operation.
37    Sign,
38    /// The Verify operation.
39    Verify,
40    /// The GetPublicKey operation.
41    GetPublicKey,
42    /// The GenerateMac operation.
43    GenerateMac,
44    /// The VerifyMac operation.
45    VerifyMac,
46    /// The GenerateRandom operation.
47    GenerateRandom,
48    /// The CreateAlias operation.
49    CreateAlias,
50    /// The DeleteAlias operation.
51    DeleteAlias,
52    /// The ListAliases operation.
53    ListAliases,
54    /// The UpdateAlias operation.
55    UpdateAlias,
56    /// The TagResource operation.
57    TagResource,
58    /// The UntagResource operation.
59    UntagResource,
60    /// The ListResourceTags operation.
61    ListResourceTags,
62    /// The GetKeyPolicy operation.
63    GetKeyPolicy,
64    /// The PutKeyPolicy operation.
65    PutKeyPolicy,
66    /// The ListKeyPolicies operation.
67    ListKeyPolicies,
68    /// The CreateGrant operation.
69    CreateGrant,
70    /// The ListGrants operation.
71    ListGrants,
72    /// The RetireGrant operation.
73    RetireGrant,
74    /// The RevokeGrant operation.
75    RevokeGrant,
76    /// The ListRetirableGrants operation.
77    ListRetirableGrants,
78    /// The EnableKeyRotation operation.
79    EnableKeyRotation,
80    /// The DisableKeyRotation operation.
81    DisableKeyRotation,
82    /// The GetKeyRotationStatus operation.
83    GetKeyRotationStatus,
84}
85
86impl KmsOperation {
87    /// Returns the AWS operation name string.
88    #[must_use]
89    pub fn as_str(&self) -> &'static str {
90        match self {
91            Self::CreateKey => "CreateKey",
92            Self::DescribeKey => "DescribeKey",
93            Self::ListKeys => "ListKeys",
94            Self::EnableKey => "EnableKey",
95            Self::DisableKey => "DisableKey",
96            Self::ScheduleKeyDeletion => "ScheduleKeyDeletion",
97            Self::CancelKeyDeletion => "CancelKeyDeletion",
98            Self::UpdateKeyDescription => "UpdateKeyDescription",
99            Self::Encrypt => "Encrypt",
100            Self::Decrypt => "Decrypt",
101            Self::ReEncrypt => "ReEncrypt",
102            Self::GenerateDataKey => "GenerateDataKey",
103            Self::GenerateDataKeyWithoutPlaintext => "GenerateDataKeyWithoutPlaintext",
104            Self::GenerateDataKeyPair => "GenerateDataKeyPair",
105            Self::GenerateDataKeyPairWithoutPlaintext => "GenerateDataKeyPairWithoutPlaintext",
106            Self::Sign => "Sign",
107            Self::Verify => "Verify",
108            Self::GetPublicKey => "GetPublicKey",
109            Self::GenerateMac => "GenerateMac",
110            Self::VerifyMac => "VerifyMac",
111            Self::GenerateRandom => "GenerateRandom",
112            Self::CreateAlias => "CreateAlias",
113            Self::DeleteAlias => "DeleteAlias",
114            Self::ListAliases => "ListAliases",
115            Self::UpdateAlias => "UpdateAlias",
116            Self::TagResource => "TagResource",
117            Self::UntagResource => "UntagResource",
118            Self::ListResourceTags => "ListResourceTags",
119            Self::GetKeyPolicy => "GetKeyPolicy",
120            Self::PutKeyPolicy => "PutKeyPolicy",
121            Self::ListKeyPolicies => "ListKeyPolicies",
122            Self::CreateGrant => "CreateGrant",
123            Self::ListGrants => "ListGrants",
124            Self::RetireGrant => "RetireGrant",
125            Self::RevokeGrant => "RevokeGrant",
126            Self::ListRetirableGrants => "ListRetirableGrants",
127            Self::EnableKeyRotation => "EnableKeyRotation",
128            Self::DisableKeyRotation => "DisableKeyRotation",
129            Self::GetKeyRotationStatus => "GetKeyRotationStatus",
130        }
131    }
132
133    /// Parse an operation name string into an KmsOperation.
134    #[must_use]
135    pub fn from_name(name: &str) -> Option<Self> {
136        match name {
137            "CreateKey" => Some(Self::CreateKey),
138            "DescribeKey" => Some(Self::DescribeKey),
139            "ListKeys" => Some(Self::ListKeys),
140            "EnableKey" => Some(Self::EnableKey),
141            "DisableKey" => Some(Self::DisableKey),
142            "ScheduleKeyDeletion" => Some(Self::ScheduleKeyDeletion),
143            "CancelKeyDeletion" => Some(Self::CancelKeyDeletion),
144            "UpdateKeyDescription" => Some(Self::UpdateKeyDescription),
145            "Encrypt" => Some(Self::Encrypt),
146            "Decrypt" => Some(Self::Decrypt),
147            "ReEncrypt" => Some(Self::ReEncrypt),
148            "GenerateDataKey" => Some(Self::GenerateDataKey),
149            "GenerateDataKeyWithoutPlaintext" => Some(Self::GenerateDataKeyWithoutPlaintext),
150            "GenerateDataKeyPair" => Some(Self::GenerateDataKeyPair),
151            "GenerateDataKeyPairWithoutPlaintext" => {
152                Some(Self::GenerateDataKeyPairWithoutPlaintext)
153            }
154            "Sign" => Some(Self::Sign),
155            "Verify" => Some(Self::Verify),
156            "GetPublicKey" => Some(Self::GetPublicKey),
157            "GenerateMac" => Some(Self::GenerateMac),
158            "VerifyMac" => Some(Self::VerifyMac),
159            "GenerateRandom" => Some(Self::GenerateRandom),
160            "CreateAlias" => Some(Self::CreateAlias),
161            "DeleteAlias" => Some(Self::DeleteAlias),
162            "ListAliases" => Some(Self::ListAliases),
163            "UpdateAlias" => Some(Self::UpdateAlias),
164            "TagResource" => Some(Self::TagResource),
165            "UntagResource" => Some(Self::UntagResource),
166            "ListResourceTags" => Some(Self::ListResourceTags),
167            "GetKeyPolicy" => Some(Self::GetKeyPolicy),
168            "PutKeyPolicy" => Some(Self::PutKeyPolicy),
169            "ListKeyPolicies" => Some(Self::ListKeyPolicies),
170            "CreateGrant" => Some(Self::CreateGrant),
171            "ListGrants" => Some(Self::ListGrants),
172            "RetireGrant" => Some(Self::RetireGrant),
173            "RevokeGrant" => Some(Self::RevokeGrant),
174            "ListRetirableGrants" => Some(Self::ListRetirableGrants),
175            "EnableKeyRotation" => Some(Self::EnableKeyRotation),
176            "DisableKeyRotation" => Some(Self::DisableKeyRotation),
177            "GetKeyRotationStatus" => Some(Self::GetKeyRotationStatus),
178            _ => None,
179        }
180    }
181}
182
183impl std::fmt::Display for KmsOperation {
184    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
185        f.write_str(self.as_str())
186    }
187}