Skip to main content

rustack_secretsmanager_model/
operations.rs

1//! Auto-generated from AWS Secrets Manager Smithy model. DO NOT EDIT.
2
3/// All supported SecretsManager operations.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
5pub enum SecretsManagerOperation {
6    /// The CreateSecret operation.
7    CreateSecret,
8    /// The DescribeSecret operation.
9    DescribeSecret,
10    /// The GetSecretValue operation.
11    GetSecretValue,
12    /// The PutSecretValue operation.
13    PutSecretValue,
14    /// The UpdateSecret operation.
15    UpdateSecret,
16    /// The DeleteSecret operation.
17    DeleteSecret,
18    /// The RestoreSecret operation.
19    RestoreSecret,
20    /// The ListSecrets operation.
21    ListSecrets,
22    /// The ListSecretVersionIds operation.
23    ListSecretVersionIds,
24    /// The GetRandomPassword operation.
25    GetRandomPassword,
26    /// The TagResource operation.
27    TagResource,
28    /// The UntagResource operation.
29    UntagResource,
30    /// The UpdateSecretVersionStage operation.
31    UpdateSecretVersionStage,
32    /// The RotateSecret operation.
33    RotateSecret,
34    /// The CancelRotateSecret operation.
35    CancelRotateSecret,
36    /// The BatchGetSecretValue operation.
37    BatchGetSecretValue,
38    /// The GetResourcePolicy operation.
39    GetResourcePolicy,
40    /// The PutResourcePolicy operation.
41    PutResourcePolicy,
42    /// The DeleteResourcePolicy operation.
43    DeleteResourcePolicy,
44    /// The ValidateResourcePolicy operation.
45    ValidateResourcePolicy,
46    /// The ReplicateSecretToRegions operation.
47    ReplicateSecretToRegions,
48    /// The RemoveRegionsFromReplication operation.
49    RemoveRegionsFromReplication,
50    /// The StopReplicationToReplica operation.
51    StopReplicationToReplica,
52}
53
54impl SecretsManagerOperation {
55    /// Returns the AWS operation name string.
56    #[must_use]
57    pub fn as_str(&self) -> &'static str {
58        match self {
59            Self::CreateSecret => "CreateSecret",
60            Self::DescribeSecret => "DescribeSecret",
61            Self::GetSecretValue => "GetSecretValue",
62            Self::PutSecretValue => "PutSecretValue",
63            Self::UpdateSecret => "UpdateSecret",
64            Self::DeleteSecret => "DeleteSecret",
65            Self::RestoreSecret => "RestoreSecret",
66            Self::ListSecrets => "ListSecrets",
67            Self::ListSecretVersionIds => "ListSecretVersionIds",
68            Self::GetRandomPassword => "GetRandomPassword",
69            Self::TagResource => "TagResource",
70            Self::UntagResource => "UntagResource",
71            Self::UpdateSecretVersionStage => "UpdateSecretVersionStage",
72            Self::RotateSecret => "RotateSecret",
73            Self::CancelRotateSecret => "CancelRotateSecret",
74            Self::BatchGetSecretValue => "BatchGetSecretValue",
75            Self::GetResourcePolicy => "GetResourcePolicy",
76            Self::PutResourcePolicy => "PutResourcePolicy",
77            Self::DeleteResourcePolicy => "DeleteResourcePolicy",
78            Self::ValidateResourcePolicy => "ValidateResourcePolicy",
79            Self::ReplicateSecretToRegions => "ReplicateSecretToRegions",
80            Self::RemoveRegionsFromReplication => "RemoveRegionsFromReplication",
81            Self::StopReplicationToReplica => "StopReplicationToReplica",
82        }
83    }
84
85    /// Parse an operation name string into an SecretsManagerOperation.
86    #[must_use]
87    pub fn from_name(name: &str) -> Option<Self> {
88        match name {
89            "CreateSecret" => Some(Self::CreateSecret),
90            "DescribeSecret" => Some(Self::DescribeSecret),
91            "GetSecretValue" => Some(Self::GetSecretValue),
92            "PutSecretValue" => Some(Self::PutSecretValue),
93            "UpdateSecret" => Some(Self::UpdateSecret),
94            "DeleteSecret" => Some(Self::DeleteSecret),
95            "RestoreSecret" => Some(Self::RestoreSecret),
96            "ListSecrets" => Some(Self::ListSecrets),
97            "ListSecretVersionIds" => Some(Self::ListSecretVersionIds),
98            "GetRandomPassword" => Some(Self::GetRandomPassword),
99            "TagResource" => Some(Self::TagResource),
100            "UntagResource" => Some(Self::UntagResource),
101            "UpdateSecretVersionStage" => Some(Self::UpdateSecretVersionStage),
102            "RotateSecret" => Some(Self::RotateSecret),
103            "CancelRotateSecret" => Some(Self::CancelRotateSecret),
104            "BatchGetSecretValue" => Some(Self::BatchGetSecretValue),
105            "GetResourcePolicy" => Some(Self::GetResourcePolicy),
106            "PutResourcePolicy" => Some(Self::PutResourcePolicy),
107            "DeleteResourcePolicy" => Some(Self::DeleteResourcePolicy),
108            "ValidateResourcePolicy" => Some(Self::ValidateResourcePolicy),
109            "ReplicateSecretToRegions" => Some(Self::ReplicateSecretToRegions),
110            "RemoveRegionsFromReplication" => Some(Self::RemoveRegionsFromReplication),
111            "StopReplicationToReplica" => Some(Self::StopReplicationToReplica),
112            _ => None,
113        }
114    }
115}
116
117impl std::fmt::Display for SecretsManagerOperation {
118    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
119        f.write_str(self.as_str())
120    }
121}