aws_sdk_devopsguru/types/
_insight_time_range.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct InsightTimeRange {
7 pub start_time: ::aws_smithy_types::DateTime,
9 pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
11}
12impl InsightTimeRange {
13 pub fn start_time(&self) -> &::aws_smithy_types::DateTime {
15 &self.start_time
16 }
17 pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
19 self.end_time.as_ref()
20 }
21}
22impl InsightTimeRange {
23 pub fn builder() -> crate::types::builders::InsightTimeRangeBuilder {
25 crate::types::builders::InsightTimeRangeBuilder::default()
26 }
27}
28
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct InsightTimeRangeBuilder {
33 pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
34 pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
35}
36impl InsightTimeRangeBuilder {
37 pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
40 self.start_time = ::std::option::Option::Some(input);
41 self
42 }
43 pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
45 self.start_time = input;
46 self
47 }
48 pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
50 &self.start_time
51 }
52 pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
54 self.end_time = ::std::option::Option::Some(input);
55 self
56 }
57 pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
59 self.end_time = input;
60 self
61 }
62 pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
64 &self.end_time
65 }
66 pub fn build(self) -> ::std::result::Result<crate::types::InsightTimeRange, ::aws_smithy_types::error::operation::BuildError> {
70 ::std::result::Result::Ok(crate::types::InsightTimeRange {
71 start_time: self.start_time.ok_or_else(|| {
72 ::aws_smithy_types::error::operation::BuildError::missing_field(
73 "start_time",
74 "start_time was not specified but it is required when building InsightTimeRange",
75 )
76 })?,
77 end_time: self.end_time,
78 })
79 }
80}