#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct TimeRange {
pub start_time: ::aws_smithy_types::DateTime,
pub end_time: ::aws_smithy_types::DateTime,
}
impl TimeRange {
pub fn start_time(&self) -> &::aws_smithy_types::DateTime {
&self.start_time
}
pub fn end_time(&self) -> &::aws_smithy_types::DateTime {
&self.end_time
}
}
impl TimeRange {
pub fn builder() -> crate::types::builders::TimeRangeBuilder {
crate::types::builders::TimeRangeBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct TimeRangeBuilder {
pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl TimeRangeBuilder {
pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.start_time = ::std::option::Option::Some(input);
self
}
pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.start_time = input;
self
}
pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.start_time
}
pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.end_time = ::std::option::Option::Some(input);
self
}
pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.end_time = input;
self
}
pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.end_time
}
pub fn build(self) -> ::std::result::Result<crate::types::TimeRange, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::TimeRange {
start_time: self.start_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"start_time",
"start_time was not specified but it is required when building TimeRange",
)
})?,
end_time: self.end_time.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"end_time",
"end_time was not specified but it is required when building TimeRange",
)
})?,
})
}
}