-
Notifications
You must be signed in to change notification settings - Fork 248
/
model.rs
6225 lines (6180 loc) · 369 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
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Contains detailed information about a report setting.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ReportSetting {
/// <p>Identifies the report template for the report. Reports are built using a report template. The report templates are:</p>
/// <p> <code>RESOURCE_COMPLIANCE_REPORT | CONTROL_COMPLIANCE_REPORT | BACKUP_JOB_REPORT | COPY_JOB_REPORT | RESTORE_JOB_REPORT</code> </p>
pub report_template: std::option::Option<std::string::String>,
/// <p>The Amazon Resource Names (ARNs) of the frameworks a report covers.</p>
pub framework_arns: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The number of frameworks a report covers.</p>
pub number_of_frameworks: i32,
}
impl ReportSetting {
/// <p>Identifies the report template for the report. Reports are built using a report template. The report templates are:</p>
/// <p> <code>RESOURCE_COMPLIANCE_REPORT | CONTROL_COMPLIANCE_REPORT | BACKUP_JOB_REPORT | COPY_JOB_REPORT | RESTORE_JOB_REPORT</code> </p>
pub fn report_template(&self) -> std::option::Option<&str> {
self.report_template.as_deref()
}
/// <p>The Amazon Resource Names (ARNs) of the frameworks a report covers.</p>
pub fn framework_arns(&self) -> std::option::Option<&[std::string::String]> {
self.framework_arns.as_deref()
}
/// <p>The number of frameworks a report covers.</p>
pub fn number_of_frameworks(&self) -> i32 {
self.number_of_frameworks
}
}
impl std::fmt::Debug for ReportSetting {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ReportSetting");
formatter.field("report_template", &self.report_template);
formatter.field("framework_arns", &self.framework_arns);
formatter.field("number_of_frameworks", &self.number_of_frameworks);
formatter.finish()
}
}
/// See [`ReportSetting`](crate::model::ReportSetting)
pub mod report_setting {
/// A builder for [`ReportSetting`](crate::model::ReportSetting)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) report_template: std::option::Option<std::string::String>,
pub(crate) framework_arns: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) number_of_frameworks: std::option::Option<i32>,
}
impl Builder {
/// <p>Identifies the report template for the report. Reports are built using a report template. The report templates are:</p>
/// <p> <code>RESOURCE_COMPLIANCE_REPORT | CONTROL_COMPLIANCE_REPORT | BACKUP_JOB_REPORT | COPY_JOB_REPORT | RESTORE_JOB_REPORT</code> </p>
pub fn report_template(mut self, input: impl Into<std::string::String>) -> Self {
self.report_template = Some(input.into());
self
}
/// <p>Identifies the report template for the report. Reports are built using a report template. The report templates are:</p>
/// <p> <code>RESOURCE_COMPLIANCE_REPORT | CONTROL_COMPLIANCE_REPORT | BACKUP_JOB_REPORT | COPY_JOB_REPORT | RESTORE_JOB_REPORT</code> </p>
pub fn set_report_template(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.report_template = input;
self
}
/// Appends an item to `framework_arns`.
///
/// To override the contents of this collection use [`set_framework_arns`](Self::set_framework_arns).
///
/// <p>The Amazon Resource Names (ARNs) of the frameworks a report covers.</p>
pub fn framework_arns(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.framework_arns.unwrap_or_default();
v.push(input.into());
self.framework_arns = Some(v);
self
}
/// <p>The Amazon Resource Names (ARNs) of the frameworks a report covers.</p>
pub fn set_framework_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.framework_arns = input;
self
}
/// <p>The number of frameworks a report covers.</p>
pub fn number_of_frameworks(mut self, input: i32) -> Self {
self.number_of_frameworks = Some(input);
self
}
/// <p>The number of frameworks a report covers.</p>
pub fn set_number_of_frameworks(mut self, input: std::option::Option<i32>) -> Self {
self.number_of_frameworks = input;
self
}
/// Consumes the builder and constructs a [`ReportSetting`](crate::model::ReportSetting)
pub fn build(self) -> crate::model::ReportSetting {
crate::model::ReportSetting {
report_template: self.report_template,
framework_arns: self.framework_arns,
number_of_frameworks: self.number_of_frameworks.unwrap_or_default(),
}
}
}
}
impl ReportSetting {
/// Creates a new builder-style object to manufacture [`ReportSetting`](crate::model::ReportSetting)
pub fn builder() -> crate::model::report_setting::Builder {
crate::model::report_setting::Builder::default()
}
}
/// <p>Contains information from your report plan about where to deliver your reports, specifically your Amazon S3 bucket name, S3 key prefix, and the formats of your reports.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ReportDeliveryChannel {
/// <p>The unique name of the S3 bucket that receives your reports.</p>
pub s3_bucket_name: std::option::Option<std::string::String>,
/// <p>The prefix for where Backup Audit Manager delivers your reports to Amazon S3. The prefix is this part of the following path: s3://your-bucket-name/<code>prefix</code>/Backup/us-west-2/year/month/day/report-name. If not specified, there is no prefix.</p>
pub s3_key_prefix: std::option::Option<std::string::String>,
/// <p>A list of the format of your reports: <code>CSV</code>, <code>JSON</code>, or both. If not specified, the default format is <code>CSV</code>.</p>
pub formats: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl ReportDeliveryChannel {
/// <p>The unique name of the S3 bucket that receives your reports.</p>
pub fn s3_bucket_name(&self) -> std::option::Option<&str> {
self.s3_bucket_name.as_deref()
}
/// <p>The prefix for where Backup Audit Manager delivers your reports to Amazon S3. The prefix is this part of the following path: s3://your-bucket-name/<code>prefix</code>/Backup/us-west-2/year/month/day/report-name. If not specified, there is no prefix.</p>
pub fn s3_key_prefix(&self) -> std::option::Option<&str> {
self.s3_key_prefix.as_deref()
}
/// <p>A list of the format of your reports: <code>CSV</code>, <code>JSON</code>, or both. If not specified, the default format is <code>CSV</code>.</p>
pub fn formats(&self) -> std::option::Option<&[std::string::String]> {
self.formats.as_deref()
}
}
impl std::fmt::Debug for ReportDeliveryChannel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ReportDeliveryChannel");
formatter.field("s3_bucket_name", &self.s3_bucket_name);
formatter.field("s3_key_prefix", &self.s3_key_prefix);
formatter.field("formats", &self.formats);
formatter.finish()
}
}
/// See [`ReportDeliveryChannel`](crate::model::ReportDeliveryChannel)
pub mod report_delivery_channel {
/// A builder for [`ReportDeliveryChannel`](crate::model::ReportDeliveryChannel)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) s3_bucket_name: std::option::Option<std::string::String>,
pub(crate) s3_key_prefix: std::option::Option<std::string::String>,
pub(crate) formats: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
/// <p>The unique name of the S3 bucket that receives your reports.</p>
pub fn s3_bucket_name(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_bucket_name = Some(input.into());
self
}
/// <p>The unique name of the S3 bucket that receives your reports.</p>
pub fn set_s3_bucket_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.s3_bucket_name = input;
self
}
/// <p>The prefix for where Backup Audit Manager delivers your reports to Amazon S3. The prefix is this part of the following path: s3://your-bucket-name/<code>prefix</code>/Backup/us-west-2/year/month/day/report-name. If not specified, there is no prefix.</p>
pub fn s3_key_prefix(mut self, input: impl Into<std::string::String>) -> Self {
self.s3_key_prefix = Some(input.into());
self
}
/// <p>The prefix for where Backup Audit Manager delivers your reports to Amazon S3. The prefix is this part of the following path: s3://your-bucket-name/<code>prefix</code>/Backup/us-west-2/year/month/day/report-name. If not specified, there is no prefix.</p>
pub fn set_s3_key_prefix(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.s3_key_prefix = input;
self
}
/// Appends an item to `formats`.
///
/// To override the contents of this collection use [`set_formats`](Self::set_formats).
///
/// <p>A list of the format of your reports: <code>CSV</code>, <code>JSON</code>, or both. If not specified, the default format is <code>CSV</code>.</p>
pub fn formats(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.formats.unwrap_or_default();
v.push(input.into());
self.formats = Some(v);
self
}
/// <p>A list of the format of your reports: <code>CSV</code>, <code>JSON</code>, or both. If not specified, the default format is <code>CSV</code>.</p>
pub fn set_formats(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.formats = input;
self
}
/// Consumes the builder and constructs a [`ReportDeliveryChannel`](crate::model::ReportDeliveryChannel)
pub fn build(self) -> crate::model::ReportDeliveryChannel {
crate::model::ReportDeliveryChannel {
s3_bucket_name: self.s3_bucket_name,
s3_key_prefix: self.s3_key_prefix,
formats: self.formats,
}
}
}
}
impl ReportDeliveryChannel {
/// Creates a new builder-style object to manufacture [`ReportDeliveryChannel`](crate::model::ReportDeliveryChannel)
pub fn builder() -> crate::model::report_delivery_channel::Builder {
crate::model::report_delivery_channel::Builder::default()
}
}
/// <p>Contains <code>DeleteAt</code> and <code>MoveToColdStorageAt</code> timestamps, which are used to specify a lifecycle for a recovery point.</p>
/// <p>The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. Backup transitions and expires backups automatically according to the lifecycle that you define.</p>
/// <p>Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.</p>
/// <p>Only Amazon EFS file system backups can be transitioned to cold storage.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CalculatedLifecycle {
/// <p>A timestamp that specifies when to transition a recovery point to cold storage.</p>
pub move_to_cold_storage_at: std::option::Option<aws_smithy_types::DateTime>,
/// <p>A timestamp that specifies when to delete a recovery point.</p>
pub delete_at: std::option::Option<aws_smithy_types::DateTime>,
}
impl CalculatedLifecycle {
/// <p>A timestamp that specifies when to transition a recovery point to cold storage.</p>
pub fn move_to_cold_storage_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.move_to_cold_storage_at.as_ref()
}
/// <p>A timestamp that specifies when to delete a recovery point.</p>
pub fn delete_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.delete_at.as_ref()
}
}
impl std::fmt::Debug for CalculatedLifecycle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CalculatedLifecycle");
formatter.field("move_to_cold_storage_at", &self.move_to_cold_storage_at);
formatter.field("delete_at", &self.delete_at);
formatter.finish()
}
}
/// See [`CalculatedLifecycle`](crate::model::CalculatedLifecycle)
pub mod calculated_lifecycle {
/// A builder for [`CalculatedLifecycle`](crate::model::CalculatedLifecycle)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) move_to_cold_storage_at: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) delete_at: std::option::Option<aws_smithy_types::DateTime>,
}
impl Builder {
/// <p>A timestamp that specifies when to transition a recovery point to cold storage.</p>
pub fn move_to_cold_storage_at(mut self, input: aws_smithy_types::DateTime) -> Self {
self.move_to_cold_storage_at = Some(input);
self
}
/// <p>A timestamp that specifies when to transition a recovery point to cold storage.</p>
pub fn set_move_to_cold_storage_at(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.move_to_cold_storage_at = input;
self
}
/// <p>A timestamp that specifies when to delete a recovery point.</p>
pub fn delete_at(mut self, input: aws_smithy_types::DateTime) -> Self {
self.delete_at = Some(input);
self
}
/// <p>A timestamp that specifies when to delete a recovery point.</p>
pub fn set_delete_at(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.delete_at = input;
self
}
/// Consumes the builder and constructs a [`CalculatedLifecycle`](crate::model::CalculatedLifecycle)
pub fn build(self) -> crate::model::CalculatedLifecycle {
crate::model::CalculatedLifecycle {
move_to_cold_storage_at: self.move_to_cold_storage_at,
delete_at: self.delete_at,
}
}
}
}
impl CalculatedLifecycle {
/// Creates a new builder-style object to manufacture [`CalculatedLifecycle`](crate::model::CalculatedLifecycle)
pub fn builder() -> crate::model::calculated_lifecycle::Builder {
crate::model::calculated_lifecycle::Builder::default()
}
}
/// <p>Contains an array of <code>Transition</code> objects specifying how long in days before a recovery point transitions to cold storage or is deleted.</p>
/// <p>Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, on the console, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.</p>
/// <p>Only Amazon EFS file system backups can be transitioned to cold storage.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct Lifecycle {
/// <p>Specifies the number of days after creation that a recovery point is moved to cold storage.</p>
pub move_to_cold_storage_after_days: std::option::Option<i64>,
/// <p>Specifies the number of days after creation that a recovery point is deleted. Must be greater than 90 days plus <code>MoveToColdStorageAfterDays</code>.</p>
pub delete_after_days: std::option::Option<i64>,
}
impl Lifecycle {
/// <p>Specifies the number of days after creation that a recovery point is moved to cold storage.</p>
pub fn move_to_cold_storage_after_days(&self) -> std::option::Option<i64> {
self.move_to_cold_storage_after_days
}
/// <p>Specifies the number of days after creation that a recovery point is deleted. Must be greater than 90 days plus <code>MoveToColdStorageAfterDays</code>.</p>
pub fn delete_after_days(&self) -> std::option::Option<i64> {
self.delete_after_days
}
}
impl std::fmt::Debug for Lifecycle {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Lifecycle");
formatter.field(
"move_to_cold_storage_after_days",
&self.move_to_cold_storage_after_days,
);
formatter.field("delete_after_days", &self.delete_after_days);
formatter.finish()
}
}
/// See [`Lifecycle`](crate::model::Lifecycle)
pub mod lifecycle {
/// A builder for [`Lifecycle`](crate::model::Lifecycle)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) move_to_cold_storage_after_days: std::option::Option<i64>,
pub(crate) delete_after_days: std::option::Option<i64>,
}
impl Builder {
/// <p>Specifies the number of days after creation that a recovery point is moved to cold storage.</p>
pub fn move_to_cold_storage_after_days(mut self, input: i64) -> Self {
self.move_to_cold_storage_after_days = Some(input);
self
}
/// <p>Specifies the number of days after creation that a recovery point is moved to cold storage.</p>
pub fn set_move_to_cold_storage_after_days(
mut self,
input: std::option::Option<i64>,
) -> Self {
self.move_to_cold_storage_after_days = input;
self
}
/// <p>Specifies the number of days after creation that a recovery point is deleted. Must be greater than 90 days plus <code>MoveToColdStorageAfterDays</code>.</p>
pub fn delete_after_days(mut self, input: i64) -> Self {
self.delete_after_days = Some(input);
self
}
/// <p>Specifies the number of days after creation that a recovery point is deleted. Must be greater than 90 days plus <code>MoveToColdStorageAfterDays</code>.</p>
pub fn set_delete_after_days(mut self, input: std::option::Option<i64>) -> Self {
self.delete_after_days = input;
self
}
/// Consumes the builder and constructs a [`Lifecycle`](crate::model::Lifecycle)
pub fn build(self) -> crate::model::Lifecycle {
crate::model::Lifecycle {
move_to_cold_storage_after_days: self.move_to_cold_storage_after_days,
delete_after_days: self.delete_after_days,
}
}
}
}
impl Lifecycle {
/// Creates a new builder-style object to manufacture [`Lifecycle`](crate::model::Lifecycle)
pub fn builder() -> crate::model::lifecycle::Builder {
crate::model::lifecycle::Builder::default()
}
}
/// <p>Contains detailed information about all of the controls of a framework. Each framework must contain at least one control.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct FrameworkControl {
/// <p>The name of a control. This name is between 1 and 256 characters.</p>
pub control_name: std::option::Option<std::string::String>,
/// <p>A list of <code>ParameterName</code> and <code>ParameterValue</code> pairs.</p>
pub control_input_parameters:
std::option::Option<std::vec::Vec<crate::model::ControlInputParameter>>,
/// <p>The scope of a control. The control scope defines what the control will evaluate. Three examples of control scopes are: a specific backup plan, all backup plans with a specific tag, or all backup plans. For more information, see <code>ControlScope</code>.</p>
pub control_scope: std::option::Option<crate::model::ControlScope>,
}
impl FrameworkControl {
/// <p>The name of a control. This name is between 1 and 256 characters.</p>
pub fn control_name(&self) -> std::option::Option<&str> {
self.control_name.as_deref()
}
/// <p>A list of <code>ParameterName</code> and <code>ParameterValue</code> pairs.</p>
pub fn control_input_parameters(
&self,
) -> std::option::Option<&[crate::model::ControlInputParameter]> {
self.control_input_parameters.as_deref()
}
/// <p>The scope of a control. The control scope defines what the control will evaluate. Three examples of control scopes are: a specific backup plan, all backup plans with a specific tag, or all backup plans. For more information, see <code>ControlScope</code>.</p>
pub fn control_scope(&self) -> std::option::Option<&crate::model::ControlScope> {
self.control_scope.as_ref()
}
}
impl std::fmt::Debug for FrameworkControl {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("FrameworkControl");
formatter.field("control_name", &self.control_name);
formatter.field("control_input_parameters", &self.control_input_parameters);
formatter.field("control_scope", &self.control_scope);
formatter.finish()
}
}
/// See [`FrameworkControl`](crate::model::FrameworkControl)
pub mod framework_control {
/// A builder for [`FrameworkControl`](crate::model::FrameworkControl)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) control_name: std::option::Option<std::string::String>,
pub(crate) control_input_parameters:
std::option::Option<std::vec::Vec<crate::model::ControlInputParameter>>,
pub(crate) control_scope: std::option::Option<crate::model::ControlScope>,
}
impl Builder {
/// <p>The name of a control. This name is between 1 and 256 characters.</p>
pub fn control_name(mut self, input: impl Into<std::string::String>) -> Self {
self.control_name = Some(input.into());
self
}
/// <p>The name of a control. This name is between 1 and 256 characters.</p>
pub fn set_control_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.control_name = input;
self
}
/// Appends an item to `control_input_parameters`.
///
/// To override the contents of this collection use [`set_control_input_parameters`](Self::set_control_input_parameters).
///
/// <p>A list of <code>ParameterName</code> and <code>ParameterValue</code> pairs.</p>
pub fn control_input_parameters(
mut self,
input: crate::model::ControlInputParameter,
) -> Self {
let mut v = self.control_input_parameters.unwrap_or_default();
v.push(input);
self.control_input_parameters = Some(v);
self
}
/// <p>A list of <code>ParameterName</code> and <code>ParameterValue</code> pairs.</p>
pub fn set_control_input_parameters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ControlInputParameter>>,
) -> Self {
self.control_input_parameters = input;
self
}
/// <p>The scope of a control. The control scope defines what the control will evaluate. Three examples of control scopes are: a specific backup plan, all backup plans with a specific tag, or all backup plans. For more information, see <code>ControlScope</code>.</p>
pub fn control_scope(mut self, input: crate::model::ControlScope) -> Self {
self.control_scope = Some(input);
self
}
/// <p>The scope of a control. The control scope defines what the control will evaluate. Three examples of control scopes are: a specific backup plan, all backup plans with a specific tag, or all backup plans. For more information, see <code>ControlScope</code>.</p>
pub fn set_control_scope(
mut self,
input: std::option::Option<crate::model::ControlScope>,
) -> Self {
self.control_scope = input;
self
}
/// Consumes the builder and constructs a [`FrameworkControl`](crate::model::FrameworkControl)
pub fn build(self) -> crate::model::FrameworkControl {
crate::model::FrameworkControl {
control_name: self.control_name,
control_input_parameters: self.control_input_parameters,
control_scope: self.control_scope,
}
}
}
}
impl FrameworkControl {
/// Creates a new builder-style object to manufacture [`FrameworkControl`](crate::model::FrameworkControl)
pub fn builder() -> crate::model::framework_control::Builder {
crate::model::framework_control::Builder::default()
}
}
/// <p>A framework consists of one or more controls. Each control has its own control scope. The control scope can include one or more resource types, a combination of a tag key and value, or a combination of one resource type and one resource ID. If no scope is specified, evaluations for the rule are triggered when any resource in your recording group changes in configuration.</p> <note>
/// <p>To set a control scope that includes all of a particular resource, leave the <code>ControlScope</code> empty or do not pass it when calling <code>CreateFramework</code>.</p>
/// </note>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ControlScope {
/// <p>The ID of the only Amazon Web Services resource that you want your control scope to contain.</p>
pub compliance_resource_ids: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>Describes whether the control scope includes one or more types of resources, such as <code>EFS</code> or <code>RDS</code>.</p>
pub compliance_resource_types: std::option::Option<std::vec::Vec<std::string::String>>,
/// <p>The tag key-value pair applied to those Amazon Web Services resources that you want to trigger an evaluation for a rule. A maximum of one key-value pair can be provided. The tag value is optional, but it cannot be an empty string. The structure to assign a tag is: <code>[{"Key":"string","Value":"string"}]</code>.</p>
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl ControlScope {
/// <p>The ID of the only Amazon Web Services resource that you want your control scope to contain.</p>
pub fn compliance_resource_ids(&self) -> std::option::Option<&[std::string::String]> {
self.compliance_resource_ids.as_deref()
}
/// <p>Describes whether the control scope includes one or more types of resources, such as <code>EFS</code> or <code>RDS</code>.</p>
pub fn compliance_resource_types(&self) -> std::option::Option<&[std::string::String]> {
self.compliance_resource_types.as_deref()
}
/// <p>The tag key-value pair applied to those Amazon Web Services resources that you want to trigger an evaluation for a rule. A maximum of one key-value pair can be provided. The tag value is optional, but it cannot be an empty string. The structure to assign a tag is: <code>[{"Key":"string","Value":"string"}]</code>.</p>
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
impl std::fmt::Debug for ControlScope {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ControlScope");
formatter.field("compliance_resource_ids", &self.compliance_resource_ids);
formatter.field("compliance_resource_types", &self.compliance_resource_types);
formatter.field("tags", &self.tags);
formatter.finish()
}
}
/// See [`ControlScope`](crate::model::ControlScope)
pub mod control_scope {
/// A builder for [`ControlScope`](crate::model::ControlScope)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) compliance_resource_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) compliance_resource_types:
std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
/// Appends an item to `compliance_resource_ids`.
///
/// To override the contents of this collection use [`set_compliance_resource_ids`](Self::set_compliance_resource_ids).
///
/// <p>The ID of the only Amazon Web Services resource that you want your control scope to contain.</p>
pub fn compliance_resource_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.compliance_resource_ids.unwrap_or_default();
v.push(input.into());
self.compliance_resource_ids = Some(v);
self
}
/// <p>The ID of the only Amazon Web Services resource that you want your control scope to contain.</p>
pub fn set_compliance_resource_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.compliance_resource_ids = input;
self
}
/// Appends an item to `compliance_resource_types`.
///
/// To override the contents of this collection use [`set_compliance_resource_types`](Self::set_compliance_resource_types).
///
/// <p>Describes whether the control scope includes one or more types of resources, such as <code>EFS</code> or <code>RDS</code>.</p>
pub fn compliance_resource_types(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.compliance_resource_types.unwrap_or_default();
v.push(input.into());
self.compliance_resource_types = Some(v);
self
}
/// <p>Describes whether the control scope includes one or more types of resources, such as <code>EFS</code> or <code>RDS</code>.</p>
pub fn set_compliance_resource_types(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.compliance_resource_types = input;
self
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tag key-value pair applied to those Amazon Web Services resources that you want to trigger an evaluation for a rule. A maximum of one key-value pair can be provided. The tag value is optional, but it cannot be an empty string. The structure to assign a tag is: <code>[{"Key":"string","Value":"string"}]</code>.</p>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
/// <p>The tag key-value pair applied to those Amazon Web Services resources that you want to trigger an evaluation for a rule. A maximum of one key-value pair can be provided. The tag value is optional, but it cannot be an empty string. The structure to assign a tag is: <code>[{"Key":"string","Value":"string"}]</code>.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
/// Consumes the builder and constructs a [`ControlScope`](crate::model::ControlScope)
pub fn build(self) -> crate::model::ControlScope {
crate::model::ControlScope {
compliance_resource_ids: self.compliance_resource_ids,
compliance_resource_types: self.compliance_resource_types,
tags: self.tags,
}
}
}
}
impl ControlScope {
/// Creates a new builder-style object to manufacture [`ControlScope`](crate::model::ControlScope)
pub fn builder() -> crate::model::control_scope::Builder {
crate::model::control_scope::Builder::default()
}
}
/// <p>A list of parameters for a control. A control can have zero, one, or more than one parameter. An example of a control with two parameters is: "backup plan frequency is at least <code>daily</code> and the retention period is at least <code>1 year</code>". The first parameter is <code>daily</code>. The second parameter is <code>1 year</code>.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ControlInputParameter {
/// <p>The name of a parameter, for example, <code>BackupPlanFrequency</code>.</p>
pub parameter_name: std::option::Option<std::string::String>,
/// <p>The value of parameter, for example, <code>hourly</code>.</p>
pub parameter_value: std::option::Option<std::string::String>,
}
impl ControlInputParameter {
/// <p>The name of a parameter, for example, <code>BackupPlanFrequency</code>.</p>
pub fn parameter_name(&self) -> std::option::Option<&str> {
self.parameter_name.as_deref()
}
/// <p>The value of parameter, for example, <code>hourly</code>.</p>
pub fn parameter_value(&self) -> std::option::Option<&str> {
self.parameter_value.as_deref()
}
}
impl std::fmt::Debug for ControlInputParameter {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ControlInputParameter");
formatter.field("parameter_name", &self.parameter_name);
formatter.field("parameter_value", &self.parameter_value);
formatter.finish()
}
}
/// See [`ControlInputParameter`](crate::model::ControlInputParameter)
pub mod control_input_parameter {
/// A builder for [`ControlInputParameter`](crate::model::ControlInputParameter)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) parameter_name: std::option::Option<std::string::String>,
pub(crate) parameter_value: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>The name of a parameter, for example, <code>BackupPlanFrequency</code>.</p>
pub fn parameter_name(mut self, input: impl Into<std::string::String>) -> Self {
self.parameter_name = Some(input.into());
self
}
/// <p>The name of a parameter, for example, <code>BackupPlanFrequency</code>.</p>
pub fn set_parameter_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.parameter_name = input;
self
}
/// <p>The value of parameter, for example, <code>hourly</code>.</p>
pub fn parameter_value(mut self, input: impl Into<std::string::String>) -> Self {
self.parameter_value = Some(input.into());
self
}
/// <p>The value of parameter, for example, <code>hourly</code>.</p>
pub fn set_parameter_value(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.parameter_value = input;
self
}
/// Consumes the builder and constructs a [`ControlInputParameter`](crate::model::ControlInputParameter)
pub fn build(self) -> crate::model::ControlInputParameter {
crate::model::ControlInputParameter {
parameter_name: self.parameter_name,
parameter_value: self.parameter_value,
}
}
}
}
impl ControlInputParameter {
/// Creates a new builder-style object to manufacture [`ControlInputParameter`](crate::model::ControlInputParameter)
pub fn builder() -> crate::model::control_input_parameter::Builder {
crate::model::control_input_parameter::Builder::default()
}
}
/// <p>A list of backup options for each resource type.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AdvancedBackupSetting {
/// <p>Specifies an object containing resource type and backup options. The only supported resource type is Amazon EC2 instances with Windows Volume Shadow Copy Service (VSS). For a CloudFormation example, see the <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/integrate-cloudformation-with-aws-backup.html">sample CloudFormation template to enable Windows VSS</a> in the <i>Backup User Guide</i>.</p>
/// <p>Valid values: <code>EC2</code>.</p>
pub resource_type: std::option::Option<std::string::String>,
/// <p>Specifies the backup option for a selected resource. This option is only available for Windows VSS backup jobs.</p>
/// <p>Valid values: </p>
/// <p>Set to <code>"WindowsVSS":"enabled"</code> to enable the <code>WindowsVSS</code> backup option and create a Windows VSS backup. </p>
/// <p>Set to <code>"WindowsVSS":"disabled"</code> to create a regular backup. The <code>WindowsVSS</code> option is not enabled by default.</p>
/// <p>If you specify an invalid option, you get an <code>InvalidParameterValueException</code> exception.</p>
/// <p>For more information about Windows VSS backups, see <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/windows-backups.html">Creating a VSS-Enabled Windows Backup</a>.</p>
pub backup_options:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl AdvancedBackupSetting {
/// <p>Specifies an object containing resource type and backup options. The only supported resource type is Amazon EC2 instances with Windows Volume Shadow Copy Service (VSS). For a CloudFormation example, see the <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/integrate-cloudformation-with-aws-backup.html">sample CloudFormation template to enable Windows VSS</a> in the <i>Backup User Guide</i>.</p>
/// <p>Valid values: <code>EC2</code>.</p>
pub fn resource_type(&self) -> std::option::Option<&str> {
self.resource_type.as_deref()
}
/// <p>Specifies the backup option for a selected resource. This option is only available for Windows VSS backup jobs.</p>
/// <p>Valid values: </p>
/// <p>Set to <code>"WindowsVSS":"enabled"</code> to enable the <code>WindowsVSS</code> backup option and create a Windows VSS backup. </p>
/// <p>Set to <code>"WindowsVSS":"disabled"</code> to create a regular backup. The <code>WindowsVSS</code> option is not enabled by default.</p>
/// <p>If you specify an invalid option, you get an <code>InvalidParameterValueException</code> exception.</p>
/// <p>For more information about Windows VSS backups, see <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/windows-backups.html">Creating a VSS-Enabled Windows Backup</a>.</p>
pub fn backup_options(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.backup_options.as_ref()
}
}
impl std::fmt::Debug for AdvancedBackupSetting {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AdvancedBackupSetting");
formatter.field("resource_type", &self.resource_type);
formatter.field("backup_options", &self.backup_options);
formatter.finish()
}
}
/// See [`AdvancedBackupSetting`](crate::model::AdvancedBackupSetting)
pub mod advanced_backup_setting {
/// A builder for [`AdvancedBackupSetting`](crate::model::AdvancedBackupSetting)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_type: std::option::Option<std::string::String>,
pub(crate) backup_options: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
/// <p>Specifies an object containing resource type and backup options. The only supported resource type is Amazon EC2 instances with Windows Volume Shadow Copy Service (VSS). For a CloudFormation example, see the <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/integrate-cloudformation-with-aws-backup.html">sample CloudFormation template to enable Windows VSS</a> in the <i>Backup User Guide</i>.</p>
/// <p>Valid values: <code>EC2</code>.</p>
pub fn resource_type(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_type = Some(input.into());
self
}
/// <p>Specifies an object containing resource type and backup options. The only supported resource type is Amazon EC2 instances with Windows Volume Shadow Copy Service (VSS). For a CloudFormation example, see the <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/integrate-cloudformation-with-aws-backup.html">sample CloudFormation template to enable Windows VSS</a> in the <i>Backup User Guide</i>.</p>
/// <p>Valid values: <code>EC2</code>.</p>
pub fn set_resource_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.resource_type = input;
self
}
/// Adds a key-value pair to `backup_options`.
///
/// To override the contents of this collection use [`set_backup_options`](Self::set_backup_options).
///
/// <p>Specifies the backup option for a selected resource. This option is only available for Windows VSS backup jobs.</p>
/// <p>Valid values: </p>
/// <p>Set to <code>"WindowsVSS":"enabled"</code> to enable the <code>WindowsVSS</code> backup option and create a Windows VSS backup. </p>
/// <p>Set to <code>"WindowsVSS":"disabled"</code> to create a regular backup. The <code>WindowsVSS</code> option is not enabled by default.</p>
/// <p>If you specify an invalid option, you get an <code>InvalidParameterValueException</code> exception.</p>
/// <p>For more information about Windows VSS backups, see <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/windows-backups.html">Creating a VSS-Enabled Windows Backup</a>.</p>
pub fn backup_options(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.backup_options.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.backup_options = Some(hash_map);
self
}
/// <p>Specifies the backup option for a selected resource. This option is only available for Windows VSS backup jobs.</p>
/// <p>Valid values: </p>
/// <p>Set to <code>"WindowsVSS":"enabled"</code> to enable the <code>WindowsVSS</code> backup option and create a Windows VSS backup. </p>
/// <p>Set to <code>"WindowsVSS":"disabled"</code> to create a regular backup. The <code>WindowsVSS</code> option is not enabled by default.</p>
/// <p>If you specify an invalid option, you get an <code>InvalidParameterValueException</code> exception.</p>
/// <p>For more information about Windows VSS backups, see <a href="https://docs.aws.amazon.com/aws-backup/latest/devguide/windows-backups.html">Creating a VSS-Enabled Windows Backup</a>.</p>
pub fn set_backup_options(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.backup_options = input;
self
}
/// Consumes the builder and constructs a [`AdvancedBackupSetting`](crate::model::AdvancedBackupSetting)
pub fn build(self) -> crate::model::AdvancedBackupSetting {
crate::model::AdvancedBackupSetting {
resource_type: self.resource_type,
backup_options: self.backup_options,
}
}
}
}
impl AdvancedBackupSetting {
/// Creates a new builder-style object to manufacture [`AdvancedBackupSetting`](crate::model::AdvancedBackupSetting)
pub fn builder() -> crate::model::advanced_backup_setting::Builder {
crate::model::advanced_backup_setting::Builder::default()
}
}
/// <p>Contains an optional backup plan display name and an array of <code>BackupRule</code> objects, each of which specifies a backup rule. Each rule in a backup plan is a separate scheduled task. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct BackupPlanInput {
/// <p>The display name of a backup plan. Must contain 1 to 50 alphanumeric or '-_.' characters.</p>
pub backup_plan_name: std::option::Option<std::string::String>,
/// <p>An array of <code>BackupRule</code> objects, each of which specifies a scheduled task that is used to back up a selection of resources.</p>
pub rules: std::option::Option<std::vec::Vec<crate::model::BackupRuleInput>>,
/// <p>Specifies a list of <code>BackupOptions</code> for each resource type. These settings are only available for Windows Volume Shadow Copy Service (VSS) backup jobs.</p>
pub advanced_backup_settings:
std::option::Option<std::vec::Vec<crate::model::AdvancedBackupSetting>>,
}
impl BackupPlanInput {
/// <p>The display name of a backup plan. Must contain 1 to 50 alphanumeric or '-_.' characters.</p>
pub fn backup_plan_name(&self) -> std::option::Option<&str> {
self.backup_plan_name.as_deref()
}
/// <p>An array of <code>BackupRule</code> objects, each of which specifies a scheduled task that is used to back up a selection of resources.</p>
pub fn rules(&self) -> std::option::Option<&[crate::model::BackupRuleInput]> {
self.rules.as_deref()
}
/// <p>Specifies a list of <code>BackupOptions</code> for each resource type. These settings are only available for Windows Volume Shadow Copy Service (VSS) backup jobs.</p>
pub fn advanced_backup_settings(
&self,
) -> std::option::Option<&[crate::model::AdvancedBackupSetting]> {
self.advanced_backup_settings.as_deref()
}
}
impl std::fmt::Debug for BackupPlanInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("BackupPlanInput");
formatter.field("backup_plan_name", &self.backup_plan_name);
formatter.field("rules", &self.rules);
formatter.field("advanced_backup_settings", &self.advanced_backup_settings);
formatter.finish()
}
}
/// See [`BackupPlanInput`](crate::model::BackupPlanInput)
pub mod backup_plan_input {
/// A builder for [`BackupPlanInput`](crate::model::BackupPlanInput)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) backup_plan_name: std::option::Option<std::string::String>,
pub(crate) rules: std::option::Option<std::vec::Vec<crate::model::BackupRuleInput>>,
pub(crate) advanced_backup_settings:
std::option::Option<std::vec::Vec<crate::model::AdvancedBackupSetting>>,
}
impl Builder {
/// <p>The display name of a backup plan. Must contain 1 to 50 alphanumeric or '-_.' characters.</p>
pub fn backup_plan_name(mut self, input: impl Into<std::string::String>) -> Self {
self.backup_plan_name = Some(input.into());
self
}
/// <p>The display name of a backup plan. Must contain 1 to 50 alphanumeric or '-_.' characters.</p>
pub fn set_backup_plan_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.backup_plan_name = input;
self
}
/// Appends an item to `rules`.
///
/// To override the contents of this collection use [`set_rules`](Self::set_rules).
///
/// <p>An array of <code>BackupRule</code> objects, each of which specifies a scheduled task that is used to back up a selection of resources.</p>
pub fn rules(mut self, input: crate::model::BackupRuleInput) -> Self {
let mut v = self.rules.unwrap_or_default();
v.push(input);
self.rules = Some(v);
self
}
/// <p>An array of <code>BackupRule</code> objects, each of which specifies a scheduled task that is used to back up a selection of resources.</p>
pub fn set_rules(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::BackupRuleInput>>,
) -> Self {
self.rules = input;
self
}
/// Appends an item to `advanced_backup_settings`.
///
/// To override the contents of this collection use [`set_advanced_backup_settings`](Self::set_advanced_backup_settings).
///
/// <p>Specifies a list of <code>BackupOptions</code> for each resource type. These settings are only available for Windows Volume Shadow Copy Service (VSS) backup jobs.</p>
pub fn advanced_backup_settings(
mut self,
input: crate::model::AdvancedBackupSetting,
) -> Self {
let mut v = self.advanced_backup_settings.unwrap_or_default();
v.push(input);
self.advanced_backup_settings = Some(v);
self
}
/// <p>Specifies a list of <code>BackupOptions</code> for each resource type. These settings are only available for Windows Volume Shadow Copy Service (VSS) backup jobs.</p>
pub fn set_advanced_backup_settings(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::AdvancedBackupSetting>>,
) -> Self {
self.advanced_backup_settings = input;
self
}
/// Consumes the builder and constructs a [`BackupPlanInput`](crate::model::BackupPlanInput)
pub fn build(self) -> crate::model::BackupPlanInput {
crate::model::BackupPlanInput {
backup_plan_name: self.backup_plan_name,
rules: self.rules,
advanced_backup_settings: self.advanced_backup_settings,
}
}
}
}
impl BackupPlanInput {
/// Creates a new builder-style object to manufacture [`BackupPlanInput`](crate::model::BackupPlanInput)
pub fn builder() -> crate::model::backup_plan_input::Builder {
crate::model::backup_plan_input::Builder::default()
}
}
/// <p>Specifies a scheduled task used to back up a selection of resources.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct BackupRuleInput {
/// <p>A display name for a backup rule. Must contain 1 to 50 alphanumeric or '-_.' characters.</p>
pub rule_name: std::option::Option<std::string::String>,
/// <p>The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created. They consist of lowercase letters, numbers, and hyphens.</p>
pub target_backup_vault_name: std::option::Option<std::string::String>,
/// <p>A CRON expression in UTC specifying when Backup initiates a backup job.</p>
pub schedule_expression: std::option::Option<std::string::String>,
/// <p>A value in minutes after a backup is scheduled before a job will be canceled if it doesn't start successfully. This value is optional.</p>
pub start_window_minutes: std::option::Option<i64>,
/// <p>A value in minutes after a backup job is successfully started before it must be completed or it will be canceled by Backup. This value is optional.</p>
pub completion_window_minutes: std::option::Option<i64>,
/// <p>The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. Backup will transition and expire backups automatically according to the lifecycle that you define. </p>
/// <p>Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold. </p>
/// <p>Only Amazon EFS file system backups can be transitioned to cold storage.</p>
pub lifecycle: std::option::Option<crate::model::Lifecycle>,
/// <p>To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a key-value pair.</p>
pub recovery_point_tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
/// <p>An array of <code>CopyAction</code> objects, which contains the details of the copy operation.</p>
pub copy_actions: std::option::Option<std::vec::Vec<crate::model::CopyAction>>,
/// <p>Specifies whether Backup creates continuous backups. True causes Backup to create continuous backups capable of point-in-time restore (PITR). False (or not specified) causes Backup to create snapshot backups.</p>
pub enable_continuous_backup: std::option::Option<bool>,
}
impl BackupRuleInput {
/// <p>A display name for a backup rule. Must contain 1 to 50 alphanumeric or '-_.' characters.</p>
pub fn rule_name(&self) -> std::option::Option<&str> {
self.rule_name.as_deref()
}
/// <p>The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created. They consist of lowercase letters, numbers, and hyphens.</p>
pub fn target_backup_vault_name(&self) -> std::option::Option<&str> {
self.target_backup_vault_name.as_deref()
}
/// <p>A CRON expression in UTC specifying when Backup initiates a backup job.</p>
pub fn schedule_expression(&self) -> std::option::Option<&str> {
self.schedule_expression.as_deref()
}
/// <p>A value in minutes after a backup is scheduled before a job will be canceled if it doesn't start successfully. This value is optional.</p>
pub fn start_window_minutes(&self) -> std::option::Option<i64> {
self.start_window_minutes
}
/// <p>A value in minutes after a backup job is successfully started before it must be completed or it will be canceled by Backup. This value is optional.</p>
pub fn completion_window_minutes(&self) -> std::option::Option<i64> {
self.completion_window_minutes
}
/// <p>The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. Backup will transition and expire backups automatically according to the lifecycle that you define. </p>
/// <p>Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold. </p>
/// <p>Only Amazon EFS file system backups can be transitioned to cold storage.</p>
pub fn lifecycle(&self) -> std::option::Option<&crate::model::Lifecycle> {
self.lifecycle.as_ref()
}
/// <p>To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a key-value pair.</p>
pub fn recovery_point_tags(
&self,