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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The full details of a flat-rate pricing subscription, including its current configuration, status, and associated resources.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Subscription {
/// <p>The Amazon Resource Name (ARN) that uniquely identifies this subscription.</p>
pub arn: ::std::string::String,
/// <p>The pricing plan family for the subscription, such as <code>CloudFront</code>.</p>
pub plan_family: ::std::string::String,
/// <p>The current tier level of the pricing plan, such as <code>FREE</code>, <code>PRO</code>, <code>BUSINESS</code>, or <code>PREMIUM</code>.</p>
pub plan_tier: ::std::string::String,
/// <p>The usage level within the plan tier. When present, indicates a specific capacity configuration beyond the base tier.</p>
pub usage_level: ::std::option::Option<::std::string::String>,
/// <p>A pending change that will take effect at the end of the current billing period. This field is present only when a downgrade or cancellation is scheduled.</p>
pub scheduled_change: ::std::option::Option<crate::types::ScheduledChange>,
/// <p>The current status of the subscription. For the list of possible values, see the <code>Status</code> type.</p>
pub status: crate::types::Status,
/// <p>A human-readable explanation of the current status, present when additional context is available.</p>
pub status_reason: ::std::option::Option<::std::string::String>,
/// <p>The ARNs of the AWS resources covered by this subscription.</p>
pub resource_arns: ::std::vec::Vec<::std::string::String>,
/// <p>The date and time when the subscription was created, in ISO 8601 format.</p>
pub created_at: ::aws_smithy_types::DateTime,
/// <p>The date and time when the subscription was last modified, in ISO 8601 format.</p>
pub updated_at: ::aws_smithy_types::DateTime,
}
impl Subscription {
/// <p>The Amazon Resource Name (ARN) that uniquely identifies this subscription.</p>
pub fn arn(&self) -> &str {
use std::ops::Deref;
self.arn.deref()
}
/// <p>The pricing plan family for the subscription, such as <code>CloudFront</code>.</p>
pub fn plan_family(&self) -> &str {
use std::ops::Deref;
self.plan_family.deref()
}
/// <p>The current tier level of the pricing plan, such as <code>FREE</code>, <code>PRO</code>, <code>BUSINESS</code>, or <code>PREMIUM</code>.</p>
pub fn plan_tier(&self) -> &str {
use std::ops::Deref;
self.plan_tier.deref()
}
/// <p>The usage level within the plan tier. When present, indicates a specific capacity configuration beyond the base tier.</p>
pub fn usage_level(&self) -> ::std::option::Option<&str> {
self.usage_level.as_deref()
}
/// <p>A pending change that will take effect at the end of the current billing period. This field is present only when a downgrade or cancellation is scheduled.</p>
pub fn scheduled_change(&self) -> ::std::option::Option<&crate::types::ScheduledChange> {
self.scheduled_change.as_ref()
}
/// <p>The current status of the subscription. For the list of possible values, see the <code>Status</code> type.</p>
pub fn status(&self) -> &crate::types::Status {
&self.status
}
/// <p>A human-readable explanation of the current status, present when additional context is available.</p>
pub fn status_reason(&self) -> ::std::option::Option<&str> {
self.status_reason.as_deref()
}
/// <p>The ARNs of the AWS resources covered by this subscription.</p>
pub fn resource_arns(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.resource_arns.deref()
}
/// <p>The date and time when the subscription was created, in ISO 8601 format.</p>
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
/// <p>The date and time when the subscription was last modified, in ISO 8601 format.</p>
pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
&self.updated_at
}
}
impl Subscription {
/// Creates a new builder-style object to manufacture [`Subscription`](crate::types::Subscription).
pub fn builder() -> crate::types::builders::SubscriptionBuilder {
crate::types::builders::SubscriptionBuilder::default()
}
}
/// A builder for [`Subscription`](crate::types::Subscription).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SubscriptionBuilder {
pub(crate) arn: ::std::option::Option<::std::string::String>,
pub(crate) plan_family: ::std::option::Option<::std::string::String>,
pub(crate) plan_tier: ::std::option::Option<::std::string::String>,
pub(crate) usage_level: ::std::option::Option<::std::string::String>,
pub(crate) scheduled_change: ::std::option::Option<crate::types::ScheduledChange>,
pub(crate) status: ::std::option::Option<crate::types::Status>,
pub(crate) status_reason: ::std::option::Option<::std::string::String>,
pub(crate) resource_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl SubscriptionBuilder {
/// <p>The Amazon Resource Name (ARN) that uniquely identifies this subscription.</p>
/// This field is required.
pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) that uniquely identifies this subscription.</p>
pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) that uniquely identifies this subscription.</p>
pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.arn
}
/// <p>The pricing plan family for the subscription, such as <code>CloudFront</code>.</p>
/// This field is required.
pub fn plan_family(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.plan_family = ::std::option::Option::Some(input.into());
self
}
/// <p>The pricing plan family for the subscription, such as <code>CloudFront</code>.</p>
pub fn set_plan_family(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.plan_family = input;
self
}
/// <p>The pricing plan family for the subscription, such as <code>CloudFront</code>.</p>
pub fn get_plan_family(&self) -> &::std::option::Option<::std::string::String> {
&self.plan_family
}
/// <p>The current tier level of the pricing plan, such as <code>FREE</code>, <code>PRO</code>, <code>BUSINESS</code>, or <code>PREMIUM</code>.</p>
/// This field is required.
pub fn plan_tier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.plan_tier = ::std::option::Option::Some(input.into());
self
}
/// <p>The current tier level of the pricing plan, such as <code>FREE</code>, <code>PRO</code>, <code>BUSINESS</code>, or <code>PREMIUM</code>.</p>
pub fn set_plan_tier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.plan_tier = input;
self
}
/// <p>The current tier level of the pricing plan, such as <code>FREE</code>, <code>PRO</code>, <code>BUSINESS</code>, or <code>PREMIUM</code>.</p>
pub fn get_plan_tier(&self) -> &::std::option::Option<::std::string::String> {
&self.plan_tier
}
/// <p>The usage level within the plan tier. When present, indicates a specific capacity configuration beyond the base tier.</p>
pub fn usage_level(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.usage_level = ::std::option::Option::Some(input.into());
self
}
/// <p>The usage level within the plan tier. When present, indicates a specific capacity configuration beyond the base tier.</p>
pub fn set_usage_level(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.usage_level = input;
self
}
/// <p>The usage level within the plan tier. When present, indicates a specific capacity configuration beyond the base tier.</p>
pub fn get_usage_level(&self) -> &::std::option::Option<::std::string::String> {
&self.usage_level
}
/// <p>A pending change that will take effect at the end of the current billing period. This field is present only when a downgrade or cancellation is scheduled.</p>
pub fn scheduled_change(mut self, input: crate::types::ScheduledChange) -> Self {
self.scheduled_change = ::std::option::Option::Some(input);
self
}
/// <p>A pending change that will take effect at the end of the current billing period. This field is present only when a downgrade or cancellation is scheduled.</p>
pub fn set_scheduled_change(mut self, input: ::std::option::Option<crate::types::ScheduledChange>) -> Self {
self.scheduled_change = input;
self
}
/// <p>A pending change that will take effect at the end of the current billing period. This field is present only when a downgrade or cancellation is scheduled.</p>
pub fn get_scheduled_change(&self) -> &::std::option::Option<crate::types::ScheduledChange> {
&self.scheduled_change
}
/// <p>The current status of the subscription. For the list of possible values, see the <code>Status</code> type.</p>
/// This field is required.
pub fn status(mut self, input: crate::types::Status) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The current status of the subscription. For the list of possible values, see the <code>Status</code> type.</p>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
self.status = input;
self
}
/// <p>The current status of the subscription. For the list of possible values, see the <code>Status</code> type.</p>
pub fn get_status(&self) -> &::std::option::Option<crate::types::Status> {
&self.status
}
/// <p>A human-readable explanation of the current status, present when additional context is available.</p>
pub fn status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.status_reason = ::std::option::Option::Some(input.into());
self
}
/// <p>A human-readable explanation of the current status, present when additional context is available.</p>
pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.status_reason = input;
self
}
/// <p>A human-readable explanation of the current status, present when additional context is available.</p>
pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> {
&self.status_reason
}
/// Appends an item to `resource_arns`.
///
/// To override the contents of this collection use [`set_resource_arns`](Self::set_resource_arns).
///
/// <p>The ARNs of the AWS resources covered by this subscription.</p>
pub fn resource_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.resource_arns.unwrap_or_default();
v.push(input.into());
self.resource_arns = ::std::option::Option::Some(v);
self
}
/// <p>The ARNs of the AWS resources covered by this subscription.</p>
pub fn set_resource_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.resource_arns = input;
self
}
/// <p>The ARNs of the AWS resources covered by this subscription.</p>
pub fn get_resource_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.resource_arns
}
/// <p>The date and time when the subscription was created, in ISO 8601 format.</p>
/// This field is required.
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
/// <p>The date and time when the subscription was created, in ISO 8601 format.</p>
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
/// <p>The date and time when the subscription was created, in ISO 8601 format.</p>
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
/// <p>The date and time when the subscription was last modified, in ISO 8601 format.</p>
/// This field is required.
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
/// <p>The date and time when the subscription was last modified, in ISO 8601 format.</p>
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
/// <p>The date and time when the subscription was last modified, in ISO 8601 format.</p>
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
/// Consumes the builder and constructs a [`Subscription`](crate::types::Subscription).
/// This method will fail if any of the following fields are not set:
/// - [`arn`](crate::types::builders::SubscriptionBuilder::arn)
/// - [`plan_family`](crate::types::builders::SubscriptionBuilder::plan_family)
/// - [`plan_tier`](crate::types::builders::SubscriptionBuilder::plan_tier)
/// - [`status`](crate::types::builders::SubscriptionBuilder::status)
/// - [`resource_arns`](crate::types::builders::SubscriptionBuilder::resource_arns)
/// - [`created_at`](crate::types::builders::SubscriptionBuilder::created_at)
/// - [`updated_at`](crate::types::builders::SubscriptionBuilder::updated_at)
pub fn build(self) -> ::std::result::Result<crate::types::Subscription, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Subscription {
arn: self.arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"arn",
"arn was not specified but it is required when building Subscription",
)
})?,
plan_family: self.plan_family.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"plan_family",
"plan_family was not specified but it is required when building Subscription",
)
})?,
plan_tier: self.plan_tier.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"plan_tier",
"plan_tier was not specified but it is required when building Subscription",
)
})?,
usage_level: self.usage_level,
scheduled_change: self.scheduled_change,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building Subscription",
)
})?,
status_reason: self.status_reason,
resource_arns: self.resource_arns.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"resource_arns",
"resource_arns was not specified but it is required when building Subscription",
)
})?,
created_at: self.created_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_at",
"created_at was not specified but it is required when building Subscription",
)
})?,
updated_at: self.updated_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"updated_at",
"updated_at was not specified but it is required when building Subscription",
)
})?,
})
}
}