use std::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum EventsOperation {
CreateEventBus,
DeleteEventBus,
DescribeEventBus,
ListEventBuses,
PutRule,
DeleteRule,
DescribeRule,
ListRules,
EnableRule,
DisableRule,
PutTargets,
RemoveTargets,
ListTargetsByRule,
PutEvents,
TestEventPattern,
TagResource,
UntagResource,
ListTagsForResource,
PutPermission,
RemovePermission,
ListRuleNamesByTarget,
UpdateEventBus,
CreateArchive,
DeleteArchive,
DescribeArchive,
ListArchives,
UpdateArchive,
StartReplay,
CancelReplay,
DescribeReplay,
ListReplays,
CreateApiDestination,
DeleteApiDestination,
DescribeApiDestination,
ListApiDestinations,
UpdateApiDestination,
CreateConnection,
DeleteConnection,
DescribeConnection,
ListConnections,
UpdateConnection,
DeauthorizeConnection,
CreateEndpoint,
DeleteEndpoint,
DescribeEndpoint,
ListEndpoints,
UpdateEndpoint,
ActivateEventSource,
CreatePartnerEventSource,
DeactivateEventSource,
DeletePartnerEventSource,
DescribeEventSource,
DescribePartnerEventSource,
ListEventSources,
ListPartnerEventSourceAccounts,
ListPartnerEventSources,
PutPartnerEvents,
}
impl EventsOperation {
#[must_use]
pub fn as_str(&self) -> &'static str {
match self {
Self::CreateEventBus => "CreateEventBus",
Self::DeleteEventBus => "DeleteEventBus",
Self::DescribeEventBus => "DescribeEventBus",
Self::ListEventBuses => "ListEventBuses",
Self::PutRule => "PutRule",
Self::DeleteRule => "DeleteRule",
Self::DescribeRule => "DescribeRule",
Self::ListRules => "ListRules",
Self::EnableRule => "EnableRule",
Self::DisableRule => "DisableRule",
Self::PutTargets => "PutTargets",
Self::RemoveTargets => "RemoveTargets",
Self::ListTargetsByRule => "ListTargetsByRule",
Self::PutEvents => "PutEvents",
Self::TestEventPattern => "TestEventPattern",
Self::TagResource => "TagResource",
Self::UntagResource => "UntagResource",
Self::ListTagsForResource => "ListTagsForResource",
Self::PutPermission => "PutPermission",
Self::RemovePermission => "RemovePermission",
Self::ListRuleNamesByTarget => "ListRuleNamesByTarget",
Self::UpdateEventBus => "UpdateEventBus",
Self::CreateArchive => "CreateArchive",
Self::DeleteArchive => "DeleteArchive",
Self::DescribeArchive => "DescribeArchive",
Self::ListArchives => "ListArchives",
Self::UpdateArchive => "UpdateArchive",
Self::StartReplay => "StartReplay",
Self::CancelReplay => "CancelReplay",
Self::DescribeReplay => "DescribeReplay",
Self::ListReplays => "ListReplays",
Self::CreateApiDestination => "CreateApiDestination",
Self::DeleteApiDestination => "DeleteApiDestination",
Self::DescribeApiDestination => "DescribeApiDestination",
Self::ListApiDestinations => "ListApiDestinations",
Self::UpdateApiDestination => "UpdateApiDestination",
Self::CreateConnection => "CreateConnection",
Self::DeleteConnection => "DeleteConnection",
Self::DescribeConnection => "DescribeConnection",
Self::ListConnections => "ListConnections",
Self::UpdateConnection => "UpdateConnection",
Self::DeauthorizeConnection => "DeauthorizeConnection",
Self::CreateEndpoint => "CreateEndpoint",
Self::DeleteEndpoint => "DeleteEndpoint",
Self::DescribeEndpoint => "DescribeEndpoint",
Self::ListEndpoints => "ListEndpoints",
Self::UpdateEndpoint => "UpdateEndpoint",
Self::ActivateEventSource => "ActivateEventSource",
Self::CreatePartnerEventSource => "CreatePartnerEventSource",
Self::DeactivateEventSource => "DeactivateEventSource",
Self::DeletePartnerEventSource => "DeletePartnerEventSource",
Self::DescribeEventSource => "DescribeEventSource",
Self::DescribePartnerEventSource => "DescribePartnerEventSource",
Self::ListEventSources => "ListEventSources",
Self::ListPartnerEventSourceAccounts => "ListPartnerEventSourceAccounts",
Self::ListPartnerEventSources => "ListPartnerEventSources",
Self::PutPartnerEvents => "PutPartnerEvents",
}
}
#[must_use]
pub fn from_name(name: &str) -> Option<Self> {
match name {
"CreateEventBus" => Some(Self::CreateEventBus),
"DeleteEventBus" => Some(Self::DeleteEventBus),
"DescribeEventBus" => Some(Self::DescribeEventBus),
"ListEventBuses" => Some(Self::ListEventBuses),
"PutRule" => Some(Self::PutRule),
"DeleteRule" => Some(Self::DeleteRule),
"DescribeRule" => Some(Self::DescribeRule),
"ListRules" => Some(Self::ListRules),
"EnableRule" => Some(Self::EnableRule),
"DisableRule" => Some(Self::DisableRule),
"PutTargets" => Some(Self::PutTargets),
"RemoveTargets" => Some(Self::RemoveTargets),
"ListTargetsByRule" => Some(Self::ListTargetsByRule),
"PutEvents" => Some(Self::PutEvents),
"TestEventPattern" => Some(Self::TestEventPattern),
"TagResource" => Some(Self::TagResource),
"UntagResource" => Some(Self::UntagResource),
"ListTagsForResource" => Some(Self::ListTagsForResource),
"PutPermission" => Some(Self::PutPermission),
"RemovePermission" => Some(Self::RemovePermission),
"ListRuleNamesByTarget" => Some(Self::ListRuleNamesByTarget),
"UpdateEventBus" => Some(Self::UpdateEventBus),
"CreateArchive" => Some(Self::CreateArchive),
"DeleteArchive" => Some(Self::DeleteArchive),
"DescribeArchive" => Some(Self::DescribeArchive),
"ListArchives" => Some(Self::ListArchives),
"UpdateArchive" => Some(Self::UpdateArchive),
"StartReplay" => Some(Self::StartReplay),
"CancelReplay" => Some(Self::CancelReplay),
"DescribeReplay" => Some(Self::DescribeReplay),
"ListReplays" => Some(Self::ListReplays),
"CreateApiDestination" => Some(Self::CreateApiDestination),
"DeleteApiDestination" => Some(Self::DeleteApiDestination),
"DescribeApiDestination" => Some(Self::DescribeApiDestination),
"ListApiDestinations" => Some(Self::ListApiDestinations),
"UpdateApiDestination" => Some(Self::UpdateApiDestination),
"CreateConnection" => Some(Self::CreateConnection),
"DeleteConnection" => Some(Self::DeleteConnection),
"DescribeConnection" => Some(Self::DescribeConnection),
"ListConnections" => Some(Self::ListConnections),
"UpdateConnection" => Some(Self::UpdateConnection),
"DeauthorizeConnection" => Some(Self::DeauthorizeConnection),
"CreateEndpoint" => Some(Self::CreateEndpoint),
"DeleteEndpoint" => Some(Self::DeleteEndpoint),
"DescribeEndpoint" => Some(Self::DescribeEndpoint),
"ListEndpoints" => Some(Self::ListEndpoints),
"UpdateEndpoint" => Some(Self::UpdateEndpoint),
"ActivateEventSource" => Some(Self::ActivateEventSource),
"CreatePartnerEventSource" => Some(Self::CreatePartnerEventSource),
"DeactivateEventSource" => Some(Self::DeactivateEventSource),
"DeletePartnerEventSource" => Some(Self::DeletePartnerEventSource),
"DescribeEventSource" => Some(Self::DescribeEventSource),
"DescribePartnerEventSource" => Some(Self::DescribePartnerEventSource),
"ListEventSources" => Some(Self::ListEventSources),
"ListPartnerEventSourceAccounts" => Some(Self::ListPartnerEventSourceAccounts),
"ListPartnerEventSources" => Some(Self::ListPartnerEventSources),
"PutPartnerEvents" => Some(Self::PutPartnerEvents),
_ => None,
}
}
#[must_use]
pub fn is_implemented(&self) -> bool {
matches!(
self,
Self::CreateEventBus
| Self::DeleteEventBus
| Self::DescribeEventBus
| Self::ListEventBuses
| Self::PutRule
| Self::DeleteRule
| Self::DescribeRule
| Self::ListRules
| Self::EnableRule
| Self::DisableRule
| Self::PutTargets
| Self::RemoveTargets
| Self::ListTargetsByRule
| Self::PutEvents
| Self::TestEventPattern
| Self::TagResource
| Self::UntagResource
| Self::ListTagsForResource
| Self::PutPermission
| Self::RemovePermission
| Self::ListRuleNamesByTarget
| Self::UpdateEventBus
| Self::CreateArchive
| Self::DeleteArchive
| Self::DescribeArchive
| Self::ListArchives
| Self::UpdateArchive
| Self::StartReplay
| Self::CancelReplay
| Self::DescribeReplay
| Self::ListReplays
| Self::CreateApiDestination
| Self::DeleteApiDestination
| Self::DescribeApiDestination
| Self::ListApiDestinations
| Self::UpdateApiDestination
| Self::CreateConnection
| Self::DeleteConnection
| Self::DescribeConnection
| Self::ListConnections
| Self::UpdateConnection
| Self::DeauthorizeConnection
| Self::CreateEndpoint
| Self::DeleteEndpoint
| Self::DescribeEndpoint
| Self::ListEndpoints
| Self::UpdateEndpoint
)
}
}
impl fmt::Display for EventsOperation {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())
}
}