Skip to main content

rustack_sts_model/
operations.rs

1//! Auto-generated from AWS STS Smithy model. DO NOT EDIT.
2
3/// All supported Sts operations.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
5pub enum StsOperation {
6    /// The GetCallerIdentity operation.
7    GetCallerIdentity,
8    /// The AssumeRole operation.
9    AssumeRole,
10    /// The GetSessionToken operation.
11    GetSessionToken,
12    /// The GetAccessKeyInfo operation.
13    GetAccessKeyInfo,
14    /// The AssumeRoleWithSAML operation.
15    AssumeRoleWithSAML,
16    /// The AssumeRoleWithWebIdentity operation.
17    AssumeRoleWithWebIdentity,
18    /// The DecodeAuthorizationMessage operation.
19    DecodeAuthorizationMessage,
20    /// The GetFederationToken operation.
21    GetFederationToken,
22}
23
24impl StsOperation {
25    /// Returns the AWS operation name string.
26    #[must_use]
27    pub fn as_str(&self) -> &'static str {
28        match self {
29            Self::GetCallerIdentity => "GetCallerIdentity",
30            Self::AssumeRole => "AssumeRole",
31            Self::GetSessionToken => "GetSessionToken",
32            Self::GetAccessKeyInfo => "GetAccessKeyInfo",
33            Self::AssumeRoleWithSAML => "AssumeRoleWithSAML",
34            Self::AssumeRoleWithWebIdentity => "AssumeRoleWithWebIdentity",
35            Self::DecodeAuthorizationMessage => "DecodeAuthorizationMessage",
36            Self::GetFederationToken => "GetFederationToken",
37        }
38    }
39
40    /// Parse an operation name string into an StsOperation.
41    #[must_use]
42    pub fn from_name(name: &str) -> Option<Self> {
43        match name {
44            "GetCallerIdentity" => Some(Self::GetCallerIdentity),
45            "AssumeRole" => Some(Self::AssumeRole),
46            "GetSessionToken" => Some(Self::GetSessionToken),
47            "GetAccessKeyInfo" => Some(Self::GetAccessKeyInfo),
48            "AssumeRoleWithSAML" => Some(Self::AssumeRoleWithSAML),
49            "AssumeRoleWithWebIdentity" => Some(Self::AssumeRoleWithWebIdentity),
50            "DecodeAuthorizationMessage" => Some(Self::DecodeAuthorizationMessage),
51            "GetFederationToken" => Some(Self::GetFederationToken),
52            _ => None,
53        }
54    }
55}
56
57impl std::fmt::Display for StsOperation {
58    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
59        f.write_str(self.as_str())
60    }
61}