Skip to main content

aws_sdk_rds/types/
_restore_window.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Earliest and latest time an instance can be restored to:</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RestoreWindow {
7    /// <p>The earliest time you can restore an instance to.</p>
8    pub earliest_time: ::std::option::Option<::aws_smithy_types::DateTime>,
9    /// <p>The latest time you can restore an instance to.</p>
10    pub latest_time: ::std::option::Option<::aws_smithy_types::DateTime>,
11}
12impl RestoreWindow {
13    /// <p>The earliest time you can restore an instance to.</p>
14    pub fn earliest_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
15        self.earliest_time.as_ref()
16    }
17    /// <p>The latest time you can restore an instance to.</p>
18    pub fn latest_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
19        self.latest_time.as_ref()
20    }
21}
22impl RestoreWindow {
23    /// Creates a new builder-style object to manufacture [`RestoreWindow`](crate::types::RestoreWindow).
24    pub fn builder() -> crate::types::builders::RestoreWindowBuilder {
25        crate::types::builders::RestoreWindowBuilder::default()
26    }
27}
28
29/// A builder for [`RestoreWindow`](crate::types::RestoreWindow).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct RestoreWindowBuilder {
33    pub(crate) earliest_time: ::std::option::Option<::aws_smithy_types::DateTime>,
34    pub(crate) latest_time: ::std::option::Option<::aws_smithy_types::DateTime>,
35}
36impl RestoreWindowBuilder {
37    /// <p>The earliest time you can restore an instance to.</p>
38    pub fn earliest_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
39        self.earliest_time = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The earliest time you can restore an instance to.</p>
43    pub fn set_earliest_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
44        self.earliest_time = input;
45        self
46    }
47    /// <p>The earliest time you can restore an instance to.</p>
48    pub fn get_earliest_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
49        &self.earliest_time
50    }
51    /// <p>The latest time you can restore an instance to.</p>
52    pub fn latest_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
53        self.latest_time = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>The latest time you can restore an instance to.</p>
57    pub fn set_latest_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
58        self.latest_time = input;
59        self
60    }
61    /// <p>The latest time you can restore an instance to.</p>
62    pub fn get_latest_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
63        &self.latest_time
64    }
65    /// Consumes the builder and constructs a [`RestoreWindow`](crate::types::RestoreWindow).
66    pub fn build(self) -> crate::types::RestoreWindow {
67        crate::types::RestoreWindow {
68            earliest_time: self.earliest_time,
69            latest_time: self.latest_time,
70        }
71    }
72}