#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct StartSelector {
#[doc(hidden)]
pub start_selector_type: std::option::Option<crate::model::StartSelectorType>,
#[doc(hidden)]
pub after_fragment_number: std::option::Option<std::string::String>,
#[doc(hidden)]
pub start_timestamp: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub continuation_token: std::option::Option<std::string::String>,
}
impl StartSelector {
pub fn start_selector_type(&self) -> std::option::Option<&crate::model::StartSelectorType> {
self.start_selector_type.as_ref()
}
pub fn after_fragment_number(&self) -> std::option::Option<&str> {
self.after_fragment_number.as_deref()
}
pub fn start_timestamp(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.start_timestamp.as_ref()
}
pub fn continuation_token(&self) -> std::option::Option<&str> {
self.continuation_token.as_deref()
}
}
pub mod start_selector {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) start_selector_type: std::option::Option<crate::model::StartSelectorType>,
pub(crate) after_fragment_number: std::option::Option<std::string::String>,
pub(crate) start_timestamp: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) continuation_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn start_selector_type(mut self, input: crate::model::StartSelectorType) -> Self {
self.start_selector_type = Some(input);
self
}
pub fn set_start_selector_type(
mut self,
input: std::option::Option<crate::model::StartSelectorType>,
) -> Self {
self.start_selector_type = input;
self
}
pub fn after_fragment_number(mut self, input: impl Into<std::string::String>) -> Self {
self.after_fragment_number = Some(input.into());
self
}
pub fn set_after_fragment_number(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.after_fragment_number = input;
self
}
pub fn start_timestamp(mut self, input: aws_smithy_types::DateTime) -> Self {
self.start_timestamp = Some(input);
self
}
pub fn set_start_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.start_timestamp = input;
self
}
pub fn continuation_token(mut self, input: impl Into<std::string::String>) -> Self {
self.continuation_token = Some(input.into());
self
}
pub fn set_continuation_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.continuation_token = input;
self
}
pub fn build(self) -> crate::model::StartSelector {
crate::model::StartSelector {
start_selector_type: self.start_selector_type,
after_fragment_number: self.after_fragment_number,
start_timestamp: self.start_timestamp,
continuation_token: self.continuation_token,
}
}
}
}
impl StartSelector {
pub fn builder() -> crate::model::start_selector::Builder {
crate::model::start_selector::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum StartSelectorType {
#[allow(missing_docs)] ContinuationToken,
#[allow(missing_docs)] Earliest,
#[allow(missing_docs)] FragmentNumber,
#[allow(missing_docs)] Now,
#[allow(missing_docs)] ProducerTimestamp,
#[allow(missing_docs)] ServerTimestamp,
Unknown(crate::types::UnknownVariantValue),
}
impl std::convert::From<&str> for StartSelectorType {
fn from(s: &str) -> Self {
match s {
"CONTINUATION_TOKEN" => StartSelectorType::ContinuationToken,
"EARLIEST" => StartSelectorType::Earliest,
"FRAGMENT_NUMBER" => StartSelectorType::FragmentNumber,
"NOW" => StartSelectorType::Now,
"PRODUCER_TIMESTAMP" => StartSelectorType::ProducerTimestamp,
"SERVER_TIMESTAMP" => StartSelectorType::ServerTimestamp,
other => {
StartSelectorType::Unknown(crate::types::UnknownVariantValue(other.to_owned()))
}
}
}
}
impl std::str::FromStr for StartSelectorType {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(StartSelectorType::from(s))
}
}
impl StartSelectorType {
pub fn as_str(&self) -> &str {
match self {
StartSelectorType::ContinuationToken => "CONTINUATION_TOKEN",
StartSelectorType::Earliest => "EARLIEST",
StartSelectorType::FragmentNumber => "FRAGMENT_NUMBER",
StartSelectorType::Now => "NOW",
StartSelectorType::ProducerTimestamp => "PRODUCER_TIMESTAMP",
StartSelectorType::ServerTimestamp => "SERVER_TIMESTAMP",
StartSelectorType::Unknown(value) => value.as_str(),
}
}
pub const fn values() -> &'static [&'static str] {
&[
"CONTINUATION_TOKEN",
"EARLIEST",
"FRAGMENT_NUMBER",
"NOW",
"PRODUCER_TIMESTAMP",
"SERVER_TIMESTAMP",
]
}
}
impl AsRef<str> for StartSelectorType {
fn as_ref(&self) -> &str {
self.as_str()
}
}