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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes a Reserved Instance listing.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ReservedInstancesListing {
    /// <p>A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The time the listing was created.</p>
    pub create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The number of instances in this state.</p>
    pub instance_counts: ::std::option::Option<::std::vec::Vec<crate::types::InstanceCount>>,
    /// <p>The price of the Reserved Instance listing.</p>
    pub price_schedules: ::std::option::Option<::std::vec::Vec<crate::types::PriceSchedule>>,
    /// <p>The ID of the Reserved Instance.</p>
    pub reserved_instances_id: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the Reserved Instance listing.</p>
    pub reserved_instances_listing_id: ::std::option::Option<::std::string::String>,
    /// <p>The status of the Reserved Instance listing.</p>
    pub status: ::std::option::Option<crate::types::ListingStatus>,
    /// <p>The reason for the current status of the Reserved Instance listing. The response can be blank.</p>
    pub status_message: ::std::option::Option<::std::string::String>,
    /// <p>Any tags assigned to the resource.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>The last modified timestamp of the listing.</p>
    pub update_date: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl ReservedInstancesListing {
    /// <p>A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The time the listing was created.</p>
    pub fn create_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.create_date.as_ref()
    }
    /// <p>The number of instances in this state.</p>
    pub fn instance_counts(&self) -> ::std::option::Option<&[crate::types::InstanceCount]> {
        self.instance_counts.as_deref()
    }
    /// <p>The price of the Reserved Instance listing.</p>
    pub fn price_schedules(&self) -> ::std::option::Option<&[crate::types::PriceSchedule]> {
        self.price_schedules.as_deref()
    }
    /// <p>The ID of the Reserved Instance.</p>
    pub fn reserved_instances_id(&self) -> ::std::option::Option<&str> {
        self.reserved_instances_id.as_deref()
    }
    /// <p>The ID of the Reserved Instance listing.</p>
    pub fn reserved_instances_listing_id(&self) -> ::std::option::Option<&str> {
        self.reserved_instances_listing_id.as_deref()
    }
    /// <p>The status of the Reserved Instance listing.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::ListingStatus> {
        self.status.as_ref()
    }
    /// <p>The reason for the current status of the Reserved Instance listing. The response can be blank.</p>
    pub fn status_message(&self) -> ::std::option::Option<&str> {
        self.status_message.as_deref()
    }
    /// <p>Any tags assigned to the resource.</p>
    pub fn tags(&self) -> ::std::option::Option<&[crate::types::Tag]> {
        self.tags.as_deref()
    }
    /// <p>The last modified timestamp of the listing.</p>
    pub fn update_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.update_date.as_ref()
    }
}
impl ReservedInstancesListing {
    /// Creates a new builder-style object to manufacture [`ReservedInstancesListing`](crate::types::ReservedInstancesListing).
    pub fn builder() -> crate::types::builders::ReservedInstancesListingBuilder {
        crate::types::builders::ReservedInstancesListingBuilder::default()
    }
}

/// A builder for [`ReservedInstancesListing`](crate::types::ReservedInstancesListing).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ReservedInstancesListingBuilder {
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) instance_counts: ::std::option::Option<::std::vec::Vec<crate::types::InstanceCount>>,
    pub(crate) price_schedules: ::std::option::Option<::std::vec::Vec<crate::types::PriceSchedule>>,
    pub(crate) reserved_instances_id: ::std::option::Option<::std::string::String>,
    pub(crate) reserved_instances_listing_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::ListingStatus>,
    pub(crate) status_message: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) update_date: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl ReservedInstancesListingBuilder {
    /// <p>A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive key supplied by the client to ensure that the request is idempotent. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring Idempotency</a>.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The time the listing was created.</p>
    pub fn create_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.create_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time the listing was created.</p>
    pub fn set_create_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.create_date = input;
        self
    }
    /// <p>The time the listing was created.</p>
    pub fn get_create_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.create_date
    }
    /// Appends an item to `instance_counts`.
    ///
    /// To override the contents of this collection use [`set_instance_counts`](Self::set_instance_counts).
    ///
    /// <p>The number of instances in this state.</p>
    pub fn instance_counts(mut self, input: crate::types::InstanceCount) -> Self {
        let mut v = self.instance_counts.unwrap_or_default();
        v.push(input);
        self.instance_counts = ::std::option::Option::Some(v);
        self
    }
    /// <p>The number of instances in this state.</p>
    pub fn set_instance_counts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceCount>>) -> Self {
        self.instance_counts = input;
        self
    }
    /// <p>The number of instances in this state.</p>
    pub fn get_instance_counts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceCount>> {
        &self.instance_counts
    }
    /// Appends an item to `price_schedules`.
    ///
    /// To override the contents of this collection use [`set_price_schedules`](Self::set_price_schedules).
    ///
    /// <p>The price of the Reserved Instance listing.</p>
    pub fn price_schedules(mut self, input: crate::types::PriceSchedule) -> Self {
        let mut v = self.price_schedules.unwrap_or_default();
        v.push(input);
        self.price_schedules = ::std::option::Option::Some(v);
        self
    }
    /// <p>The price of the Reserved Instance listing.</p>
    pub fn set_price_schedules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PriceSchedule>>) -> Self {
        self.price_schedules = input;
        self
    }
    /// <p>The price of the Reserved Instance listing.</p>
    pub fn get_price_schedules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PriceSchedule>> {
        &self.price_schedules
    }
    /// <p>The ID of the Reserved Instance.</p>
    pub fn reserved_instances_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reserved_instances_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the Reserved Instance.</p>
    pub fn set_reserved_instances_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reserved_instances_id = input;
        self
    }
    /// <p>The ID of the Reserved Instance.</p>
    pub fn get_reserved_instances_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.reserved_instances_id
    }
    /// <p>The ID of the Reserved Instance listing.</p>
    pub fn reserved_instances_listing_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reserved_instances_listing_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the Reserved Instance listing.</p>
    pub fn set_reserved_instances_listing_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reserved_instances_listing_id = input;
        self
    }
    /// <p>The ID of the Reserved Instance listing.</p>
    pub fn get_reserved_instances_listing_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.reserved_instances_listing_id
    }
    /// <p>The status of the Reserved Instance listing.</p>
    pub fn status(mut self, input: crate::types::ListingStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the Reserved Instance listing.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ListingStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the Reserved Instance listing.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ListingStatus> {
        &self.status
    }
    /// <p>The reason for the current status of the Reserved Instance listing. The response can be blank.</p>
    pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status_message = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The reason for the current status of the Reserved Instance listing. The response can be blank.</p>
    pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status_message = input;
        self
    }
    /// <p>The reason for the current status of the Reserved Instance listing. The response can be blank.</p>
    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.status_message
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Any tags assigned to the resource.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>Any tags assigned to the resource.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Any tags assigned to the resource.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>The last modified timestamp of the listing.</p>
    pub fn update_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.update_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The last modified timestamp of the listing.</p>
    pub fn set_update_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.update_date = input;
        self
    }
    /// <p>The last modified timestamp of the listing.</p>
    pub fn get_update_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.update_date
    }
    /// Consumes the builder and constructs a [`ReservedInstancesListing`](crate::types::ReservedInstancesListing).
    pub fn build(self) -> crate::types::ReservedInstancesListing {
        crate::types::ReservedInstancesListing {
            client_token: self.client_token,
            create_date: self.create_date,
            instance_counts: self.instance_counts,
            price_schedules: self.price_schedules,
            reserved_instances_id: self.reserved_instances_id,
            reserved_instances_listing_id: self.reserved_instances_listing_id,
            status: self.status,
            status_message: self.status_message,
            tags: self.tags,
            update_date: self.update_date,
        }
    }
}