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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Represents an Amazon Redshift Serverless reservation, which gives you the option to commit to a specified number of Redshift Processing Units (RPUs) for a year at a discount from Serverless on-demand (OD) rates.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Reservation {
/// <p>The identifier that uniquely identifies the serverless reservation.</p>
pub reservation_id: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Resource Name (ARN) that uniquely identifies the serverless reservation.</p>
pub reservation_arn: ::std::option::Option<::std::string::String>,
/// <p>The start date for the serverless reservation. This is the date you created the reservation.</p>
pub start_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The end date for the serverless reservation. This date is one year after the start date that you specify.</p>
pub end_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
pub capacity: i32,
/// <p>The type of offering for the reservation. The offering class determines the payment schedule for the reservation.</p>
pub offering: ::std::option::Option<crate::types::ReservationOffering>,
/// <p>The status of the reservation. Possible values include the following:</p>
/// <ul>
/// <li>
/// <p><code>payment-pending</code></p></li>
/// <li>
/// <p><code>active</code></p></li>
/// <li>
/// <p><code>payment-failed</code></p></li>
/// <li>
/// <p><code>retired</code></p></li>
/// </ul>
pub status: ::std::option::Option<::std::string::String>,
}
impl Reservation {
/// <p>The identifier that uniquely identifies the serverless reservation.</p>
pub fn reservation_id(&self) -> ::std::option::Option<&str> {
self.reservation_id.as_deref()
}
/// <p>The Amazon Resource Name (ARN) that uniquely identifies the serverless reservation.</p>
pub fn reservation_arn(&self) -> ::std::option::Option<&str> {
self.reservation_arn.as_deref()
}
/// <p>The start date for the serverless reservation. This is the date you created the reservation.</p>
pub fn start_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.start_date.as_ref()
}
/// <p>The end date for the serverless reservation. This date is one year after the start date that you specify.</p>
pub fn end_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.end_date.as_ref()
}
/// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
pub fn capacity(&self) -> i32 {
self.capacity
}
/// <p>The type of offering for the reservation. The offering class determines the payment schedule for the reservation.</p>
pub fn offering(&self) -> ::std::option::Option<&crate::types::ReservationOffering> {
self.offering.as_ref()
}
/// <p>The status of the reservation. Possible values include the following:</p>
/// <ul>
/// <li>
/// <p><code>payment-pending</code></p></li>
/// <li>
/// <p><code>active</code></p></li>
/// <li>
/// <p><code>payment-failed</code></p></li>
/// <li>
/// <p><code>retired</code></p></li>
/// </ul>
pub fn status(&self) -> ::std::option::Option<&str> {
self.status.as_deref()
}
}
impl Reservation {
/// Creates a new builder-style object to manufacture [`Reservation`](crate::types::Reservation).
pub fn builder() -> crate::types::builders::ReservationBuilder {
crate::types::builders::ReservationBuilder::default()
}
}
/// A builder for [`Reservation`](crate::types::Reservation).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ReservationBuilder {
pub(crate) reservation_id: ::std::option::Option<::std::string::String>,
pub(crate) reservation_arn: ::std::option::Option<::std::string::String>,
pub(crate) start_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) end_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) capacity: ::std::option::Option<i32>,
pub(crate) offering: ::std::option::Option<crate::types::ReservationOffering>,
pub(crate) status: ::std::option::Option<::std::string::String>,
}
impl ReservationBuilder {
/// <p>The identifier that uniquely identifies the serverless reservation.</p>
pub fn reservation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.reservation_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier that uniquely identifies the serverless reservation.</p>
pub fn set_reservation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.reservation_id = input;
self
}
/// <p>The identifier that uniquely identifies the serverless reservation.</p>
pub fn get_reservation_id(&self) -> &::std::option::Option<::std::string::String> {
&self.reservation_id
}
/// <p>The Amazon Resource Name (ARN) that uniquely identifies the serverless reservation.</p>
pub fn reservation_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.reservation_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) that uniquely identifies the serverless reservation.</p>
pub fn set_reservation_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.reservation_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) that uniquely identifies the serverless reservation.</p>
pub fn get_reservation_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.reservation_arn
}
/// <p>The start date for the serverless reservation. This is the date you created the reservation.</p>
pub fn start_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.start_date = ::std::option::Option::Some(input);
self
}
/// <p>The start date for the serverless reservation. This is the date you created the reservation.</p>
pub fn set_start_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.start_date = input;
self
}
/// <p>The start date for the serverless reservation. This is the date you created the reservation.</p>
pub fn get_start_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.start_date
}
/// <p>The end date for the serverless reservation. This date is one year after the start date that you specify.</p>
pub fn end_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.end_date = ::std::option::Option::Some(input);
self
}
/// <p>The end date for the serverless reservation. This date is one year after the start date that you specify.</p>
pub fn set_end_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.end_date = input;
self
}
/// <p>The end date for the serverless reservation. This date is one year after the start date that you specify.</p>
pub fn get_end_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.end_date
}
/// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
pub fn capacity(mut self, input: i32) -> Self {
self.capacity = ::std::option::Option::Some(input);
self
}
/// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
pub fn set_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
self.capacity = input;
self
}
/// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
pub fn get_capacity(&self) -> &::std::option::Option<i32> {
&self.capacity
}
/// <p>The type of offering for the reservation. The offering class determines the payment schedule for the reservation.</p>
pub fn offering(mut self, input: crate::types::ReservationOffering) -> Self {
self.offering = ::std::option::Option::Some(input);
self
}
/// <p>The type of offering for the reservation. The offering class determines the payment schedule for the reservation.</p>
pub fn set_offering(mut self, input: ::std::option::Option<crate::types::ReservationOffering>) -> Self {
self.offering = input;
self
}
/// <p>The type of offering for the reservation. The offering class determines the payment schedule for the reservation.</p>
pub fn get_offering(&self) -> &::std::option::Option<crate::types::ReservationOffering> {
&self.offering
}
/// <p>The status of the reservation. Possible values include the following:</p>
/// <ul>
/// <li>
/// <p><code>payment-pending</code></p></li>
/// <li>
/// <p><code>active</code></p></li>
/// <li>
/// <p><code>payment-failed</code></p></li>
/// <li>
/// <p><code>retired</code></p></li>
/// </ul>
pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.status = ::std::option::Option::Some(input.into());
self
}
/// <p>The status of the reservation. Possible values include the following:</p>
/// <ul>
/// <li>
/// <p><code>payment-pending</code></p></li>
/// <li>
/// <p><code>active</code></p></li>
/// <li>
/// <p><code>payment-failed</code></p></li>
/// <li>
/// <p><code>retired</code></p></li>
/// </ul>
pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.status = input;
self
}
/// <p>The status of the reservation. Possible values include the following:</p>
/// <ul>
/// <li>
/// <p><code>payment-pending</code></p></li>
/// <li>
/// <p><code>active</code></p></li>
/// <li>
/// <p><code>payment-failed</code></p></li>
/// <li>
/// <p><code>retired</code></p></li>
/// </ul>
pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
&self.status
}
/// Consumes the builder and constructs a [`Reservation`](crate::types::Reservation).
pub fn build(self) -> crate::types::Reservation {
crate::types::Reservation {
reservation_id: self.reservation_id,
reservation_arn: self.reservation_arn,
start_date: self.start_date,
end_date: self.end_date,
capacity: self.capacity.unwrap_or_default(),
offering: self.offering,
status: self.status,
}
}
}