Skip to main content

rustack_logs_model/
operations.rs

1//! Auto-generated from AWS CloudWatch Logs Smithy model. DO NOT EDIT.
2
3/// All supported Logs operations.
4#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
5pub enum LogsOperation {
6    /// The CreateLogGroup operation.
7    CreateLogGroup,
8    /// The DeleteLogGroup operation.
9    DeleteLogGroup,
10    /// The DescribeLogGroups operation.
11    DescribeLogGroups,
12    /// The CreateLogStream operation.
13    CreateLogStream,
14    /// The DeleteLogStream operation.
15    DeleteLogStream,
16    /// The DescribeLogStreams operation.
17    DescribeLogStreams,
18    /// The PutLogEvents operation.
19    PutLogEvents,
20    /// The GetLogEvents operation.
21    GetLogEvents,
22    /// The FilterLogEvents operation.
23    FilterLogEvents,
24    /// The PutRetentionPolicy operation.
25    PutRetentionPolicy,
26    /// The DeleteRetentionPolicy operation.
27    DeleteRetentionPolicy,
28    /// The PutMetricFilter operation.
29    PutMetricFilter,
30    /// The DeleteMetricFilter operation.
31    DeleteMetricFilter,
32    /// The DescribeMetricFilters operation.
33    DescribeMetricFilters,
34    /// The PutSubscriptionFilter operation.
35    PutSubscriptionFilter,
36    /// The DeleteSubscriptionFilter operation.
37    DeleteSubscriptionFilter,
38    /// The DescribeSubscriptionFilters operation.
39    DescribeSubscriptionFilters,
40    /// The PutResourcePolicy operation.
41    PutResourcePolicy,
42    /// The DeleteResourcePolicy operation.
43    DeleteResourcePolicy,
44    /// The DescribeResourcePolicies operation.
45    DescribeResourcePolicies,
46    /// The TagResource operation.
47    TagResource,
48    /// The UntagResource operation.
49    UntagResource,
50    /// The ListTagsForResource operation.
51    ListTagsForResource,
52    /// The TagLogGroup operation.
53    TagLogGroup,
54    /// The UntagLogGroup operation.
55    UntagLogGroup,
56    /// The ListTagsLogGroup operation.
57    ListTagsLogGroup,
58    /// The PutDestination operation.
59    PutDestination,
60    /// The PutDestinationPolicy operation.
61    PutDestinationPolicy,
62    /// The DeleteDestination operation.
63    DeleteDestination,
64    /// The DescribeDestinations operation.
65    DescribeDestinations,
66    /// The AssociateKmsKey operation.
67    AssociateKmsKey,
68    /// The DisassociateKmsKey operation.
69    DisassociateKmsKey,
70    /// The StartQuery operation.
71    StartQuery,
72    /// The StopQuery operation.
73    StopQuery,
74    /// The GetQueryResults operation.
75    GetQueryResults,
76    /// The DescribeQueries operation.
77    DescribeQueries,
78    /// The PutQueryDefinition operation.
79    PutQueryDefinition,
80    /// The DeleteQueryDefinition operation.
81    DeleteQueryDefinition,
82    /// The DescribeQueryDefinitions operation.
83    DescribeQueryDefinitions,
84    /// The CreateExportTask operation.
85    CreateExportTask,
86    /// The CancelExportTask operation.
87    CancelExportTask,
88    /// The DescribeExportTasks operation.
89    DescribeExportTasks,
90    /// The TestMetricFilter operation.
91    TestMetricFilter,
92}
93
94impl LogsOperation {
95    /// Returns the AWS operation name string.
96    #[must_use]
97    pub fn as_str(&self) -> &'static str {
98        match self {
99            Self::CreateLogGroup => "CreateLogGroup",
100            Self::DeleteLogGroup => "DeleteLogGroup",
101            Self::DescribeLogGroups => "DescribeLogGroups",
102            Self::CreateLogStream => "CreateLogStream",
103            Self::DeleteLogStream => "DeleteLogStream",
104            Self::DescribeLogStreams => "DescribeLogStreams",
105            Self::PutLogEvents => "PutLogEvents",
106            Self::GetLogEvents => "GetLogEvents",
107            Self::FilterLogEvents => "FilterLogEvents",
108            Self::PutRetentionPolicy => "PutRetentionPolicy",
109            Self::DeleteRetentionPolicy => "DeleteRetentionPolicy",
110            Self::PutMetricFilter => "PutMetricFilter",
111            Self::DeleteMetricFilter => "DeleteMetricFilter",
112            Self::DescribeMetricFilters => "DescribeMetricFilters",
113            Self::PutSubscriptionFilter => "PutSubscriptionFilter",
114            Self::DeleteSubscriptionFilter => "DeleteSubscriptionFilter",
115            Self::DescribeSubscriptionFilters => "DescribeSubscriptionFilters",
116            Self::PutResourcePolicy => "PutResourcePolicy",
117            Self::DeleteResourcePolicy => "DeleteResourcePolicy",
118            Self::DescribeResourcePolicies => "DescribeResourcePolicies",
119            Self::TagResource => "TagResource",
120            Self::UntagResource => "UntagResource",
121            Self::ListTagsForResource => "ListTagsForResource",
122            Self::TagLogGroup => "TagLogGroup",
123            Self::UntagLogGroup => "UntagLogGroup",
124            Self::ListTagsLogGroup => "ListTagsLogGroup",
125            Self::PutDestination => "PutDestination",
126            Self::PutDestinationPolicy => "PutDestinationPolicy",
127            Self::DeleteDestination => "DeleteDestination",
128            Self::DescribeDestinations => "DescribeDestinations",
129            Self::AssociateKmsKey => "AssociateKmsKey",
130            Self::DisassociateKmsKey => "DisassociateKmsKey",
131            Self::StartQuery => "StartQuery",
132            Self::StopQuery => "StopQuery",
133            Self::GetQueryResults => "GetQueryResults",
134            Self::DescribeQueries => "DescribeQueries",
135            Self::PutQueryDefinition => "PutQueryDefinition",
136            Self::DeleteQueryDefinition => "DeleteQueryDefinition",
137            Self::DescribeQueryDefinitions => "DescribeQueryDefinitions",
138            Self::CreateExportTask => "CreateExportTask",
139            Self::CancelExportTask => "CancelExportTask",
140            Self::DescribeExportTasks => "DescribeExportTasks",
141            Self::TestMetricFilter => "TestMetricFilter",
142        }
143    }
144
145    /// Parse an operation name string into an LogsOperation.
146    #[must_use]
147    pub fn from_name(name: &str) -> Option<Self> {
148        match name {
149            "CreateLogGroup" => Some(Self::CreateLogGroup),
150            "DeleteLogGroup" => Some(Self::DeleteLogGroup),
151            "DescribeLogGroups" => Some(Self::DescribeLogGroups),
152            "CreateLogStream" => Some(Self::CreateLogStream),
153            "DeleteLogStream" => Some(Self::DeleteLogStream),
154            "DescribeLogStreams" => Some(Self::DescribeLogStreams),
155            "PutLogEvents" => Some(Self::PutLogEvents),
156            "GetLogEvents" => Some(Self::GetLogEvents),
157            "FilterLogEvents" => Some(Self::FilterLogEvents),
158            "PutRetentionPolicy" => Some(Self::PutRetentionPolicy),
159            "DeleteRetentionPolicy" => Some(Self::DeleteRetentionPolicy),
160            "PutMetricFilter" => Some(Self::PutMetricFilter),
161            "DeleteMetricFilter" => Some(Self::DeleteMetricFilter),
162            "DescribeMetricFilters" => Some(Self::DescribeMetricFilters),
163            "PutSubscriptionFilter" => Some(Self::PutSubscriptionFilter),
164            "DeleteSubscriptionFilter" => Some(Self::DeleteSubscriptionFilter),
165            "DescribeSubscriptionFilters" => Some(Self::DescribeSubscriptionFilters),
166            "PutResourcePolicy" => Some(Self::PutResourcePolicy),
167            "DeleteResourcePolicy" => Some(Self::DeleteResourcePolicy),
168            "DescribeResourcePolicies" => Some(Self::DescribeResourcePolicies),
169            "TagResource" => Some(Self::TagResource),
170            "UntagResource" => Some(Self::UntagResource),
171            "ListTagsForResource" => Some(Self::ListTagsForResource),
172            "TagLogGroup" => Some(Self::TagLogGroup),
173            "UntagLogGroup" => Some(Self::UntagLogGroup),
174            "ListTagsLogGroup" => Some(Self::ListTagsLogGroup),
175            "PutDestination" => Some(Self::PutDestination),
176            "PutDestinationPolicy" => Some(Self::PutDestinationPolicy),
177            "DeleteDestination" => Some(Self::DeleteDestination),
178            "DescribeDestinations" => Some(Self::DescribeDestinations),
179            "AssociateKmsKey" => Some(Self::AssociateKmsKey),
180            "DisassociateKmsKey" => Some(Self::DisassociateKmsKey),
181            "StartQuery" => Some(Self::StartQuery),
182            "StopQuery" => Some(Self::StopQuery),
183            "GetQueryResults" => Some(Self::GetQueryResults),
184            "DescribeQueries" => Some(Self::DescribeQueries),
185            "PutQueryDefinition" => Some(Self::PutQueryDefinition),
186            "DeleteQueryDefinition" => Some(Self::DeleteQueryDefinition),
187            "DescribeQueryDefinitions" => Some(Self::DescribeQueryDefinitions),
188            "CreateExportTask" => Some(Self::CreateExportTask),
189            "CancelExportTask" => Some(Self::CancelExportTask),
190            "DescribeExportTasks" => Some(Self::DescribeExportTasks),
191            "TestMetricFilter" => Some(Self::TestMetricFilter),
192            _ => None,
193        }
194    }
195}
196
197impl std::fmt::Display for LogsOperation {
198    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
199        f.write_str(self.as_str())
200    }
201}