-
Notifications
You must be signed in to change notification settings - Fork 249
/
model.rs
804 lines (790 loc) · 31.5 KB
/
model.rs
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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The definition of AWS Cost and Usage Report. You can specify the report name, time unit, report format, compression format, S3 bucket, additional artifacts, and schema elements in the definition. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ReportDefinition {
/// <p>The name of the report that you want to create. The name must be unique, is case sensitive, and can't include spaces. </p>
pub report_name: std::option::Option<std::string::String>,
/// <p>The length of time covered by the report. </p>
pub time_unit: std::option::Option<crate::model::TimeUnit>,
/// <p>The format that AWS saves the report in.</p>
pub format: std::option::Option<crate::model::ReportFormat>,
/// <p>The compression format that AWS uses for the report.</p>
pub compression: std::option::Option<crate::model::CompressionFormat>,
/// <p>A list of strings that indicate additional content that Amazon Web Services includes in the report, such as individual resource IDs. </p>
pub additional_schema_elements: std::option::Option<std::vec::Vec<crate::model::SchemaElement>>,
/// <p>The S3 bucket where AWS delivers the report.</p>
pub s3_bucket: std::option::Option<std::string::String>,
/// <p>The prefix that AWS adds to the report name when AWS delivers the report. Your prefix can't include spaces.</p>
pub s3_prefix: std::option::Option<std::string::String>,
/// <p>The region of the S3 bucket that AWS delivers the report into.</p>
pub s3_region: std::option::Option<crate::model::AwsRegion>,
/// <p>A list of manifests that you want Amazon Web Services to create for this report.</p>
pub additional_artifacts: std::option::Option<std::vec::Vec<crate::model::AdditionalArtifact>>,
/// <p>Whether you want Amazon Web Services to update your reports after they have been finalized if Amazon Web Services detects charges related to previous months. These charges can include refunds, credits, or support fees.</p>
pub refresh_closed_reports: std::option::Option<bool>,
/// <p>Whether you want Amazon Web Services to overwrite the previous version of each report or to deliver the report in addition to the previous versions.</p>
pub report_versioning: std::option::Option<crate::model::ReportVersioning>,
/// <p> The Amazon resource name of the billing view. You can get this value by using the billing view service public APIs. </p>
pub billing_view_arn: std::option::Option<std::string::String>,
}
impl ReportDefinition {
/// <p>The name of the report that you want to create. The name must be unique, is case sensitive, and can't include spaces. </p>
pub fn report_name(&self) -> std::option::Option<&str> {
self.report_name.as_deref()
}
/// <p>The length of time covered by the report. </p>
pub fn time_unit(&self) -> std::option::Option<&crate::model::TimeUnit> {
self.time_unit.as_ref()
}
/// <p>The format that AWS saves the report in.</p>
pub fn format(&self) -> std::option::Option<&crate::model::ReportFormat> {
self.format.as_ref()
}
/// <p>The compression format that AWS uses for the report.</p>
pub fn compression(&self) -> std::option::Option<&crate::model::CompressionFormat> {
self.compression.as_ref()
}
/// <p>A list of strings that indicate additional content that Amazon Web Services includes in the report, such as individual resource IDs. </p>
pub fn additional_schema_elements(
&self,
) -> std::option::Option<&[crate::model::SchemaElement]> {
self.additional_schema_elements.as_deref()
}
/// <p>The S3 bucket where AWS delivers the report.</p>
pub fn s3_bucket(&self) -> std::option::Option<&str> {
self.s3_bucket.as_deref()
}
/// <p>The prefix that AWS adds to the report name when AWS delivers the report. Your prefix can't include spaces.</p>
pub fn s3_prefix(&self) -> std::option::Option<&str> {
self.s3_prefix.as_deref()
}
/// <p>The region of the S3 bucket that AWS delivers the report into.</p>
pub fn s3_region(&self) -> std::option::Option<&crate::model::AwsRegion> {
self.s3_region.as_ref()
}
/// <p>A list of manifests that you want Amazon Web Services to create for this report.</p>
pub fn additional_artifacts(&self) -> std::option::Option<&[crate::model::AdditionalArtifact]> {
self.additional_artifacts.as_deref()
}
/// <p>Whether you want Amazon Web Services to update your reports after they have been finalized if Amazon Web Services detects charges related to previous months. These charges can include refunds, credits, or support fees.</p>
pub fn refresh_closed_reports(&self) -> std::option::Option<bool> {
self.refresh_closed_reports
}
/// <p>Whether you want Amazon Web Services to overwrite the previous version of each report or to deliver the report in addition to the previous versions.</p>
pub fn report_versioning(&self) -> std::option::Option<&crate::model::ReportVersioning> {
self.report_versioning.as_ref()
}
/// <p> The Amazon resource name of the billing view. You can get this value by using the billing view service public APIs. </p>
pub fn billing_view_arn(&self) -> std::option::Option<&str> {
self.billing_view_arn.as_deref()
}
}
impl std::fmt::Debug for ReportDefinition {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ReportDefinition");
formatter.field("report_name", &self.report_name);
formatter.field("time_unit", &self.time_unit);
formatter.field("format", &self.format);
formatter.field("compression", &self.compression);
formatter.field(
"additional_schema_elements",
&self.additional_schema_elements,
);
formatter.field("s3_bucket", &self.s3_bucket);
formatter.field("s3_prefix", &self.s3_prefix);
formatter.field("s3_region", &self.s3_region);
formatter.field("additional_artifacts", &self.additional_artifacts);
formatter.field("refresh_closed_reports", &self.refresh_closed_reports);
formatter.field("report_versioning", &self.report_versioning);
formatter.field("billing_view_arn", &self.billing_view_arn);
formatter.finish()
}
}
/// See [`ReportDefinition`](crate::model::ReportDefinition)
pub mod report_definition {
/// A builder for [`ReportDefinition`](crate::model::ReportDefinition)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) report_name: std::option::Option<std::string::String>,
pub(crate) time_unit: std::option::Option<crate::model::TimeUnit>,
pub(crate) format: std::option::Option<crate::model::ReportFormat>,
pub(crate) compression: std::option::Option<crate::model::CompressionFormat>,
pub(crate) additional_schema_elements:
std::option::Option<std::vec::Vec<crate::model::SchemaElement>>,
pub(crate) s3_bucket: std::option::Option<std::string::String>,
pub(crate) s3_prefix: std::option::Option<std::string::String>,
pub(crate) s3_region: std::option::Option<crate::model::AwsRegion>,
pub(crate) additional_artifacts:
std::option::Option<std::vec::Vec<crate::model::AdditionalArtifact>>,
pub(crate) refresh_closed_reports: std::option::Option<bool>,
pub(crate) report_versioning: std::option::Option<crate::model::ReportVersioning>,
pub(crate) billing_view_arn: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of the report that you want to create. The name must be unique, is case sensitive, and can't include spaces. </p>
pub fn report_name(mut self, input: impl Into<std::string::String>) -> Self {
self.report_name = Some(input.into());
self
}
/// <p>The name of the report that you want to create. The name must be unique, is case sensitive, and can't include spaces. </p>
pub fn set_report_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.report_name = input;
self
}
/// <p>The length of time covered by the report. </p>
pub fn time_unit(mut self, input: crate::model::TimeUnit) -> Self {
self.time_unit = Some(input);
self
}
/// <p>The length of time covered by the report. </p>
pub fn set_time_unit(mut self, input: std::option::Option<crate::model::TimeUnit>) -> Self {
self.time_unit = input;
self
}
/// <p>The format that AWS saves the report in.</p>
pub fn format(mut self, input: crate::model::ReportFormat) -> Self {
self.format = Some(input);
self
}
/// <p>The format that AWS saves the report in.</p>
pub fn set_format(
mut self,
input: std::option::Option<crate::model::ReportFormat>,
) -> Self {
self.format = input;
self
}
/// <p>The compression format that AWS uses for the report.</p>
pub fn compression(mut self, input: crate::model::CompressionFormat) -> Self {
self.compression = Some(input);
self
}
/// <p>The compression format that AWS uses for the report.</p>
pub fn set_compression(
mut self,
input: std::option::Option<crate::model::CompressionFormat>,
) -> Self {
self.compression = input;
self
}
/// Appends an item to `additional_schema_elements`.
///
/// To override the contents of this collection use [`set_additional_schema_elements`](Self::set_additional_schema_elements).
///
/// <p>A list of strings that indicate additional content that Amazon Web Services includes in the report, such as individual resource IDs. </p>
pub fn additional_schema_elements(mut self, input: crate::model::SchemaElement) -> Self {
let mut v = self.additional_schema_elements.unwrap_or_default();
v.push(input);
self.additional_schema_elements = Some(v);
self
}
/// <p>A list of strings that indicate additional content that Amazon Web Services includes in the report, such as individual resource IDs. </p>
pub fn set_additional_schema_elements(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SchemaElement>>,
) -> Self {
self.additional_schema_elements = input;
self
}
/// <p>The S3 bucket where AWS delivers the report.</p>
pub fn s3_bucket(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_bucket = Some(input.into());
self
}
/// <p>The S3 bucket where AWS delivers the report.</p>
pub fn set_s3_bucket(mut self, input: std::option::Option<std::string::String>) -> Self {
self.s3_bucket = input;
self
}
/// <p>The prefix that AWS adds to the report name when AWS delivers the report. Your prefix can't include spaces.</p>
pub fn s3_prefix(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_prefix = Some(input.into());
self
}
/// <p>The prefix that AWS adds to the report name when AWS delivers the report. Your prefix can't include spaces.</p>
pub fn set_s3_prefix(mut self, input: std::option::Option<std::string::String>) -> Self {
self.s3_prefix = input;
self
}
/// <p>The region of the S3 bucket that AWS delivers the report into.</p>
pub fn s3_region(mut self, input: crate::model::AwsRegion) -> Self {
self.s3_region = Some(input);
self
}
/// <p>The region of the S3 bucket that AWS delivers the report into.</p>
pub fn set_s3_region(
mut self,
input: std::option::Option<crate::model::AwsRegion>,
) -> Self {
self.s3_region = input;
self
}
/// Appends an item to `additional_artifacts`.
///
/// To override the contents of this collection use [`set_additional_artifacts`](Self::set_additional_artifacts).
///
/// <p>A list of manifests that you want Amazon Web Services to create for this report.</p>
pub fn additional_artifacts(mut self, input: crate::model::AdditionalArtifact) -> Self {
let mut v = self.additional_artifacts.unwrap_or_default();
v.push(input);
self.additional_artifacts = Some(v);
self
}
/// <p>A list of manifests that you want Amazon Web Services to create for this report.</p>
pub fn set_additional_artifacts(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::AdditionalArtifact>>,
) -> Self {
self.additional_artifacts = input;
self
}
/// <p>Whether you want Amazon Web Services to update your reports after they have been finalized if Amazon Web Services detects charges related to previous months. These charges can include refunds, credits, or support fees.</p>
pub fn refresh_closed_reports(mut self, input: bool) -> Self {
self.refresh_closed_reports = Some(input);
self
}
/// <p>Whether you want Amazon Web Services to update your reports after they have been finalized if Amazon Web Services detects charges related to previous months. These charges can include refunds, credits, or support fees.</p>
pub fn set_refresh_closed_reports(mut self, input: std::option::Option<bool>) -> Self {
self.refresh_closed_reports = input;
self
}
/// <p>Whether you want Amazon Web Services to overwrite the previous version of each report or to deliver the report in addition to the previous versions.</p>
pub fn report_versioning(mut self, input: crate::model::ReportVersioning) -> Self {
self.report_versioning = Some(input);
self
}
/// <p>Whether you want Amazon Web Services to overwrite the previous version of each report or to deliver the report in addition to the previous versions.</p>
pub fn set_report_versioning(
mut self,
input: std::option::Option<crate::model::ReportVersioning>,
) -> Self {
self.report_versioning = input;
self
}
/// <p> The Amazon resource name of the billing view. You can get this value by using the billing view service public APIs. </p>
pub fn billing_view_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.billing_view_arn = Some(input.into());
self
}
/// <p> The Amazon resource name of the billing view. You can get this value by using the billing view service public APIs. </p>
pub fn set_billing_view_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.billing_view_arn = input;
self
}
/// Consumes the builder and constructs a [`ReportDefinition`](crate::model::ReportDefinition)
pub fn build(self) -> crate::model::ReportDefinition {
crate::model::ReportDefinition {
report_name: self.report_name,
time_unit: self.time_unit,
format: self.format,
compression: self.compression,
additional_schema_elements: self.additional_schema_elements,
s3_bucket: self.s3_bucket,
s3_prefix: self.s3_prefix,
s3_region: self.s3_region,
additional_artifacts: self.additional_artifacts,
refresh_closed_reports: self.refresh_closed_reports,
report_versioning: self.report_versioning,
billing_view_arn: self.billing_view_arn,
}
}
}
}
impl ReportDefinition {
/// Creates a new builder-style object to manufacture [`ReportDefinition`](crate::model::ReportDefinition)
pub fn builder() -> crate::model::report_definition::Builder {
crate::model::report_definition::Builder::default()
}
}
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ReportVersioning {
#[allow(missing_docs)] // documentation missing in model
CreateNewReport,
#[allow(missing_docs)] // documentation missing in model
OverwriteReport,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for ReportVersioning {
fn from(s: &str) -> Self {
match s {
"CREATE_NEW_REPORT" => ReportVersioning::CreateNewReport,
"OVERWRITE_REPORT" => ReportVersioning::OverwriteReport,
other => ReportVersioning::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ReportVersioning {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ReportVersioning::from(s))
}
}
impl ReportVersioning {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ReportVersioning::CreateNewReport => "CREATE_NEW_REPORT",
ReportVersioning::OverwriteReport => "OVERWRITE_REPORT",
ReportVersioning::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["CREATE_NEW_REPORT", "OVERWRITE_REPORT"]
}
}
impl AsRef<str> for ReportVersioning {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The types of manifest that you want AWS to create for this report.</p>
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum AdditionalArtifact {
#[allow(missing_docs)] // documentation missing in model
Athena,
#[allow(missing_docs)] // documentation missing in model
Quicksight,
#[allow(missing_docs)] // documentation missing in model
Redshift,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for AdditionalArtifact {
fn from(s: &str) -> Self {
match s {
"ATHENA" => AdditionalArtifact::Athena,
"QUICKSIGHT" => AdditionalArtifact::Quicksight,
"REDSHIFT" => AdditionalArtifact::Redshift,
other => AdditionalArtifact::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for AdditionalArtifact {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(AdditionalArtifact::from(s))
}
}
impl AdditionalArtifact {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
AdditionalArtifact::Athena => "ATHENA",
AdditionalArtifact::Quicksight => "QUICKSIGHT",
AdditionalArtifact::Redshift => "REDSHIFT",
AdditionalArtifact::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["ATHENA", "QUICKSIGHT", "REDSHIFT"]
}
}
impl AsRef<str> for AdditionalArtifact {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The region of the S3 bucket that AWS delivers the report into.</p>
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum AwsRegion {
#[allow(missing_docs)] // documentation missing in model
CapeTown,
#[allow(missing_docs)] // documentation missing in model
HongKong,
#[allow(missing_docs)] // documentation missing in model
Tokyo,
#[allow(missing_docs)] // documentation missing in model
Seoul,
#[allow(missing_docs)] // documentation missing in model
Osaka,
#[allow(missing_docs)] // documentation missing in model
Mumbai,
#[allow(missing_docs)] // documentation missing in model
Singapore,
#[allow(missing_docs)] // documentation missing in model
Sydney,
#[allow(missing_docs)] // documentation missing in model
CanadaCentral,
#[allow(missing_docs)] // documentation missing in model
Beijing,
#[allow(missing_docs)] // documentation missing in model
Ningxia,
#[allow(missing_docs)] // documentation missing in model
Frankfurt,
#[allow(missing_docs)] // documentation missing in model
Stockholm,
#[allow(missing_docs)] // documentation missing in model
Milano,
#[allow(missing_docs)] // documentation missing in model
Ireland,
#[allow(missing_docs)] // documentation missing in model
London,
#[allow(missing_docs)] // documentation missing in model
Paris,
#[allow(missing_docs)] // documentation missing in model
Bahrain,
#[allow(missing_docs)] // documentation missing in model
SaoPaulo,
#[allow(missing_docs)] // documentation missing in model
UsStandard,
#[allow(missing_docs)] // documentation missing in model
Ohio,
#[allow(missing_docs)] // documentation missing in model
NorthernCalifornia,
#[allow(missing_docs)] // documentation missing in model
Oregon,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for AwsRegion {
fn from(s: &str) -> Self {
match s {
"af-south-1" => AwsRegion::CapeTown,
"ap-east-1" => AwsRegion::HongKong,
"ap-northeast-1" => AwsRegion::Tokyo,
"ap-northeast-2" => AwsRegion::Seoul,
"ap-northeast-3" => AwsRegion::Osaka,
"ap-south-1" => AwsRegion::Mumbai,
"ap-southeast-1" => AwsRegion::Singapore,
"ap-southeast-2" => AwsRegion::Sydney,
"ca-central-1" => AwsRegion::CanadaCentral,
"cn-north-1" => AwsRegion::Beijing,
"cn-northwest-1" => AwsRegion::Ningxia,
"eu-central-1" => AwsRegion::Frankfurt,
"eu-north-1" => AwsRegion::Stockholm,
"eu-south-1" => AwsRegion::Milano,
"eu-west-1" => AwsRegion::Ireland,
"eu-west-2" => AwsRegion::London,
"eu-west-3" => AwsRegion::Paris,
"me-south-1" => AwsRegion::Bahrain,
"sa-east-1" => AwsRegion::SaoPaulo,
"us-east-1" => AwsRegion::UsStandard,
"us-east-2" => AwsRegion::Ohio,
"us-west-1" => AwsRegion::NorthernCalifornia,
"us-west-2" => AwsRegion::Oregon,
other => AwsRegion::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for AwsRegion {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(AwsRegion::from(s))
}
}
impl AwsRegion {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
AwsRegion::CapeTown => "af-south-1",
AwsRegion::HongKong => "ap-east-1",
AwsRegion::Tokyo => "ap-northeast-1",
AwsRegion::Seoul => "ap-northeast-2",
AwsRegion::Osaka => "ap-northeast-3",
AwsRegion::Mumbai => "ap-south-1",
AwsRegion::Singapore => "ap-southeast-1",
AwsRegion::Sydney => "ap-southeast-2",
AwsRegion::CanadaCentral => "ca-central-1",
AwsRegion::Beijing => "cn-north-1",
AwsRegion::Ningxia => "cn-northwest-1",
AwsRegion::Frankfurt => "eu-central-1",
AwsRegion::Stockholm => "eu-north-1",
AwsRegion::Milano => "eu-south-1",
AwsRegion::Ireland => "eu-west-1",
AwsRegion::London => "eu-west-2",
AwsRegion::Paris => "eu-west-3",
AwsRegion::Bahrain => "me-south-1",
AwsRegion::SaoPaulo => "sa-east-1",
AwsRegion::UsStandard => "us-east-1",
AwsRegion::Ohio => "us-east-2",
AwsRegion::NorthernCalifornia => "us-west-1",
AwsRegion::Oregon => "us-west-2",
AwsRegion::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&[
"af-south-1",
"ap-east-1",
"ap-northeast-1",
"ap-northeast-2",
"ap-northeast-3",
"ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"ca-central-1",
"cn-north-1",
"cn-northwest-1",
"eu-central-1",
"eu-north-1",
"eu-south-1",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"me-south-1",
"sa-east-1",
"us-east-1",
"us-east-2",
"us-west-1",
"us-west-2",
]
}
}
impl AsRef<str> for AwsRegion {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Whether or not AWS includes resource IDs in the report. </p>
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum SchemaElement {
#[allow(missing_docs)] // documentation missing in model
Resources,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for SchemaElement {
fn from(s: &str) -> Self {
match s {
"RESOURCES" => SchemaElement::Resources,
other => SchemaElement::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for SchemaElement {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(SchemaElement::from(s))
}
}
impl SchemaElement {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
SchemaElement::Resources => "RESOURCES",
SchemaElement::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["RESOURCES"]
}
}
impl AsRef<str> for SchemaElement {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The compression format that AWS uses for the report.</p>
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum CompressionFormat {
#[allow(missing_docs)] // documentation missing in model
Gzip,
#[allow(missing_docs)] // documentation missing in model
Parquet,
#[allow(missing_docs)] // documentation missing in model
Zip,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for CompressionFormat {
fn from(s: &str) -> Self {
match s {
"GZIP" => CompressionFormat::Gzip,
"Parquet" => CompressionFormat::Parquet,
"ZIP" => CompressionFormat::Zip,
other => CompressionFormat::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for CompressionFormat {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(CompressionFormat::from(s))
}
}
impl CompressionFormat {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
CompressionFormat::Gzip => "GZIP",
CompressionFormat::Parquet => "Parquet",
CompressionFormat::Zip => "ZIP",
CompressionFormat::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["GZIP", "Parquet", "ZIP"]
}
}
impl AsRef<str> for CompressionFormat {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The format that AWS saves the report in.</p>
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum ReportFormat {
#[allow(missing_docs)] // documentation missing in model
Parquet,
#[allow(missing_docs)] // documentation missing in model
Csv,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for ReportFormat {
fn from(s: &str) -> Self {
match s {
"Parquet" => ReportFormat::Parquet,
"textORcsv" => ReportFormat::Csv,
other => ReportFormat::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ReportFormat {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ReportFormat::from(s))
}
}
impl ReportFormat {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
ReportFormat::Parquet => "Parquet",
ReportFormat::Csv => "textORcsv",
ReportFormat::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["Parquet", "textORcsv"]
}
}
impl AsRef<str> for ReportFormat {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>The length of time covered by the report. </p>
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum TimeUnit {
#[allow(missing_docs)] // documentation missing in model
Daily,
#[allow(missing_docs)] // documentation missing in model
Hourly,
#[allow(missing_docs)] // documentation missing in model
Monthly,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for TimeUnit {
fn from(s: &str) -> Self {
match s {
"DAILY" => TimeUnit::Daily,
"HOURLY" => TimeUnit::Hourly,
"MONTHLY" => TimeUnit::Monthly,
other => TimeUnit::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for TimeUnit {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(TimeUnit::from(s))
}
}
impl TimeUnit {
/// Returns the `&str` value of the enum member.
pub fn as_str(&self) -> &str {
match self {
TimeUnit::Daily => "DAILY",
TimeUnit::Hourly => "HOURLY",
TimeUnit::Monthly => "MONTHLY",
TimeUnit::Unknown(s) => s.as_ref(),
}
}
/// Returns all the `&str` values of the enum members.
pub fn values() -> &'static [&'static str] {
&["DAILY", "HOURLY", "MONTHLY"]
}
}
impl AsRef<str> for TimeUnit {
fn as_ref(&self) -> &str {
self.as_str()
}
}