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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A time range with a start and end time.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct TimeRange {
    /// <p>Time in UTC at which the time range starts.</p>
    pub start_time: ::aws_smithy_types::DateTime,
    /// <p>Time in UTC at which the time range ends.</p>
    pub end_time: ::aws_smithy_types::DateTime,
}
impl TimeRange {
    /// <p>Time in UTC at which the time range starts.</p>
    pub fn start_time(&self) -> &::aws_smithy_types::DateTime {
        &self.start_time
    }
    /// <p>Time in UTC at which the time range ends.</p>
    pub fn end_time(&self) -> &::aws_smithy_types::DateTime {
        &self.end_time
    }
}
impl TimeRange {
    /// Creates a new builder-style object to manufacture [`TimeRange`](crate::types::TimeRange).
    pub fn builder() -> crate::types::builders::TimeRangeBuilder {
        crate::types::builders::TimeRangeBuilder::default()
    }
}

/// A builder for [`TimeRange`](crate::types::TimeRange).
#[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 {
    /// <p>Time in UTC at which the time range starts.</p>
    /// This field is required.
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>Time in UTC at which the time range starts.</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_time = input;
        self
    }
    /// <p>Time in UTC at which the time range starts.</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_time
    }
    /// <p>Time in UTC at which the time range ends.</p>
    /// This field is required.
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>Time in UTC at which the time range ends.</p>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_time = input;
        self
    }
    /// <p>Time in UTC at which the time range ends.</p>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_time
    }
    /// Consumes the builder and constructs a [`TimeRange`](crate::types::TimeRange).
    /// This method will fail if any of the following fields are not set:
    /// - [`start_time`](crate::types::builders::TimeRangeBuilder::start_time)
    /// - [`end_time`](crate::types::builders::TimeRangeBuilder::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",
                )
            })?,
        })
    }
}