1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The schedule of when Amazon Redshift Serverless should run the scheduled action.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub enum Schedule {
/// <p>The timestamp of when Amazon Redshift Serverless should run the scheduled action. Timestamp is in UTC. Format of at expression is <code>yyyy-mm-ddThh:mm:ss</code>. For example, <code>2016-03-04T17:27:00</code>.</p>
At(::aws_smithy_types::DateTime),
/// <p>The cron expression to use to schedule a recurring scheduled action. Schedule invocations must be separated by at least one hour. Times are in UTC.</p>
/// <p>Format of cron expressions is <code>(Minutes Hours Day-of-month Month Day-of-week Year)</code>. For example, <code>"(0 10 ? * MON *)"</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions">Cron Expressions</a> in the <i>Amazon CloudWatch Events User Guide</i>.</p>
Cron(::std::string::String),
/// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version.
/// An unknown enum variant
///
/// _Note: If you encounter this error, consider upgrading your SDK to the latest version._
/// The `Unknown` variant represents cases where the server sent a value that wasn't recognized
/// by the client. This can happen when the server adds new functionality, but the client has not been updated.
/// To investigate this, consider turning on debug logging to print the raw HTTP response.
#[non_exhaustive]
Unknown,
}
impl Schedule {
/// Tries to convert the enum instance into [`At`](crate::types::Schedule::At), extracting the inner [`DateTime`](::aws_smithy_types::DateTime).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_at(&self) -> ::std::result::Result<&::aws_smithy_types::DateTime, &Self> {
if let Schedule::At(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`At`](crate::types::Schedule::At).
pub fn is_at(&self) -> bool {
self.as_at().is_ok()
}
/// Tries to convert the enum instance into [`Cron`](crate::types::Schedule::Cron), extracting the inner [`String`](::std::string::String).
/// Returns `Err(&Self)` if it can't be converted.
pub fn as_cron(&self) -> ::std::result::Result<&::std::string::String, &Self> {
if let Schedule::Cron(val) = &self {
::std::result::Result::Ok(val)
} else {
::std::result::Result::Err(self)
}
}
/// Returns true if this is a [`Cron`](crate::types::Schedule::Cron).
pub fn is_cron(&self) -> bool {
self.as_cron().is_ok()
}
/// Returns true if the enum instance is the `Unknown` variant.
pub fn is_unknown(&self) -> bool {
matches!(self, Self::Unknown)
}
}