-
Notifications
You must be signed in to change notification settings - Fork 244
/
model.rs
13941 lines (13784 loc) · 604 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>Represents the settings used to enable or disable Time to Live (TTL) for the specified
/// table.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct TimeToLiveSpecification {
/// <p>Indicates whether TTL is to be enabled (true) or disabled (false) on the table.</p>
pub enabled: std::option::Option<bool>,
/// <p>The name of the TTL attribute used to store the expiration time for items in the
/// table.</p>
pub attribute_name: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for TimeToLiveSpecification {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("TimeToLiveSpecification");
formatter.field("enabled", &self.enabled);
formatter.field("attribute_name", &self.attribute_name);
formatter.finish()
}
}
/// See [`TimeToLiveSpecification`](crate::model::TimeToLiveSpecification)
pub mod time_to_live_specification {
/// A builder for [`TimeToLiveSpecification`](crate::model::TimeToLiveSpecification)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) enabled: std::option::Option<bool>,
pub(crate) attribute_name: std::option::Option<std::string::String>,
}
impl Builder {
/// <p>Indicates whether TTL is to be enabled (true) or disabled (false) on the table.</p>
pub fn enabled(mut self, input: bool) -> Self {
self.enabled = Some(input);
self
}
pub fn set_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.enabled = input;
self
}
/// <p>The name of the TTL attribute used to store the expiration time for items in the
/// table.</p>
pub fn attribute_name(mut self, input: impl Into<std::string::String>) -> Self {
self.attribute_name = Some(input.into());
self
}
pub fn set_attribute_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.attribute_name = input;
self
}
/// Consumes the builder and constructs a [`TimeToLiveSpecification`](crate::model::TimeToLiveSpecification)
pub fn build(self) -> crate::model::TimeToLiveSpecification {
crate::model::TimeToLiveSpecification {
enabled: self.enabled,
attribute_name: self.attribute_name,
}
}
}
}
impl TimeToLiveSpecification {
/// Creates a new builder-style object to manufacture [`TimeToLiveSpecification`](crate::model::TimeToLiveSpecification)
pub fn builder() -> crate::model::time_to_live_specification::Builder {
crate::model::time_to_live_specification::Builder::default()
}
}
/// <p>Represents the auto scaling configuration for a global table.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct TableAutoScalingDescription {
/// <p>The name of the table.</p>
pub table_name: std::option::Option<std::string::String>,
/// <p>The current state of the table:</p>
/// <ul>
/// <li>
/// <p>
/// <code>CREATING</code> - The table is being created.</p>
/// </li>
/// <li>
/// <p>
/// <code>UPDATING</code> - The table is being updated.</p>
/// </li>
/// <li>
/// <p>
/// <code>DELETING</code> - The table is being deleted.</p>
/// </li>
/// <li>
/// <p>
/// <code>ACTIVE</code> - The table is ready for use.</p>
/// </li>
/// </ul>
pub table_status: std::option::Option<crate::model::TableStatus>,
/// <p>Represents replicas of the global table.</p>
pub replicas: std::option::Option<std::vec::Vec<crate::model::ReplicaAutoScalingDescription>>,
}
impl std::fmt::Debug for TableAutoScalingDescription {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("TableAutoScalingDescription");
formatter.field("table_name", &self.table_name);
formatter.field("table_status", &self.table_status);
formatter.field("replicas", &self.replicas);
formatter.finish()
}
}
/// See [`TableAutoScalingDescription`](crate::model::TableAutoScalingDescription)
pub mod table_auto_scaling_description {
/// A builder for [`TableAutoScalingDescription`](crate::model::TableAutoScalingDescription)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) table_name: std::option::Option<std::string::String>,
pub(crate) table_status: std::option::Option<crate::model::TableStatus>,
pub(crate) replicas:
std::option::Option<std::vec::Vec<crate::model::ReplicaAutoScalingDescription>>,
}
impl Builder {
/// <p>The name of the table.</p>
pub fn table_name(mut self, input: impl Into<std::string::String>) -> Self {
self.table_name = Some(input.into());
self
}
pub fn set_table_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.table_name = input;
self
}
/// <p>The current state of the table:</p>
/// <ul>
/// <li>
/// <p>
/// <code>CREATING</code> - The table is being created.</p>
/// </li>
/// <li>
/// <p>
/// <code>UPDATING</code> - The table is being updated.</p>
/// </li>
/// <li>
/// <p>
/// <code>DELETING</code> - The table is being deleted.</p>
/// </li>
/// <li>
/// <p>
/// <code>ACTIVE</code> - The table is ready for use.</p>
/// </li>
/// </ul>
pub fn table_status(mut self, input: crate::model::TableStatus) -> Self {
self.table_status = Some(input);
self
}
pub fn set_table_status(
mut self,
input: std::option::Option<crate::model::TableStatus>,
) -> Self {
self.table_status = input;
self
}
pub fn replicas(
mut self,
input: impl Into<crate::model::ReplicaAutoScalingDescription>,
) -> Self {
let mut v = self.replicas.unwrap_or_default();
v.push(input.into());
self.replicas = Some(v);
self
}
pub fn set_replicas(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ReplicaAutoScalingDescription>>,
) -> Self {
self.replicas = input;
self
}
/// Consumes the builder and constructs a [`TableAutoScalingDescription`](crate::model::TableAutoScalingDescription)
pub fn build(self) -> crate::model::TableAutoScalingDescription {
crate::model::TableAutoScalingDescription {
table_name: self.table_name,
table_status: self.table_status,
replicas: self.replicas,
}
}
}
}
impl TableAutoScalingDescription {
/// Creates a new builder-style object to manufacture [`TableAutoScalingDescription`](crate::model::TableAutoScalingDescription)
pub fn builder() -> crate::model::table_auto_scaling_description::Builder {
crate::model::table_auto_scaling_description::Builder::default()
}
}
/// <p>Represents the auto scaling settings of the replica.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ReplicaAutoScalingDescription {
/// <p>The Region where the replica exists.</p>
pub region_name: std::option::Option<std::string::String>,
/// <p>Replica-specific global secondary index auto scaling settings.</p>
pub global_secondary_indexes: std::option::Option<
std::vec::Vec<crate::model::ReplicaGlobalSecondaryIndexAutoScalingDescription>,
>,
/// <p>Represents the auto scaling settings for a global table or global secondary
/// index.</p>
pub replica_provisioned_read_capacity_auto_scaling_settings:
std::option::Option<crate::model::AutoScalingSettingsDescription>,
/// <p>Represents the auto scaling settings for a global table or global secondary
/// index.</p>
pub replica_provisioned_write_capacity_auto_scaling_settings:
std::option::Option<crate::model::AutoScalingSettingsDescription>,
/// <p>The current state of the replica:</p>
/// <ul>
/// <li>
/// <p>
/// <code>CREATING</code> - The replica is being created.</p>
/// </li>
/// <li>
/// <p>
/// <code>UPDATING</code> - The replica is being updated.</p>
/// </li>
/// <li>
/// <p>
/// <code>DELETING</code> - The replica is being deleted.</p>
/// </li>
/// <li>
/// <p>
/// <code>ACTIVE</code> - The replica is ready for use.</p>
/// </li>
/// </ul>
pub replica_status: std::option::Option<crate::model::ReplicaStatus>,
}
impl std::fmt::Debug for ReplicaAutoScalingDescription {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ReplicaAutoScalingDescription");
formatter.field("region_name", &self.region_name);
formatter.field("global_secondary_indexes", &self.global_secondary_indexes);
formatter.field(
"replica_provisioned_read_capacity_auto_scaling_settings",
&self.replica_provisioned_read_capacity_auto_scaling_settings,
);
formatter.field(
"replica_provisioned_write_capacity_auto_scaling_settings",
&self.replica_provisioned_write_capacity_auto_scaling_settings,
);
formatter.field("replica_status", &self.replica_status);
formatter.finish()
}
}
/// See [`ReplicaAutoScalingDescription`](crate::model::ReplicaAutoScalingDescription)
pub mod replica_auto_scaling_description {
/// A builder for [`ReplicaAutoScalingDescription`](crate::model::ReplicaAutoScalingDescription)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) region_name: std::option::Option<std::string::String>,
pub(crate) global_secondary_indexes: std::option::Option<
std::vec::Vec<crate::model::ReplicaGlobalSecondaryIndexAutoScalingDescription>,
>,
pub(crate) replica_provisioned_read_capacity_auto_scaling_settings:
std::option::Option<crate::model::AutoScalingSettingsDescription>,
pub(crate) replica_provisioned_write_capacity_auto_scaling_settings:
std::option::Option<crate::model::AutoScalingSettingsDescription>,
pub(crate) replica_status: std::option::Option<crate::model::ReplicaStatus>,
}
impl Builder {
/// <p>The Region where the replica exists.</p>
pub fn region_name(mut self, input: impl Into<std::string::String>) -> Self {
self.region_name = Some(input.into());
self
}
pub fn set_region_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.region_name = input;
self
}
pub fn global_secondary_indexes(
mut self,
input: impl Into<crate::model::ReplicaGlobalSecondaryIndexAutoScalingDescription>,
) -> Self {
let mut v = self.global_secondary_indexes.unwrap_or_default();
v.push(input.into());
self.global_secondary_indexes = Some(v);
self
}
pub fn set_global_secondary_indexes(
mut self,
input: std::option::Option<
std::vec::Vec<crate::model::ReplicaGlobalSecondaryIndexAutoScalingDescription>,
>,
) -> Self {
self.global_secondary_indexes = input;
self
}
/// <p>Represents the auto scaling settings for a global table or global secondary
/// index.</p>
pub fn replica_provisioned_read_capacity_auto_scaling_settings(
mut self,
input: crate::model::AutoScalingSettingsDescription,
) -> Self {
self.replica_provisioned_read_capacity_auto_scaling_settings = Some(input);
self
}
pub fn set_replica_provisioned_read_capacity_auto_scaling_settings(
mut self,
input: std::option::Option<crate::model::AutoScalingSettingsDescription>,
) -> Self {
self.replica_provisioned_read_capacity_auto_scaling_settings = input;
self
}
/// <p>Represents the auto scaling settings for a global table or global secondary
/// index.</p>
pub fn replica_provisioned_write_capacity_auto_scaling_settings(
mut self,
input: crate::model::AutoScalingSettingsDescription,
) -> Self {
self.replica_provisioned_write_capacity_auto_scaling_settings = Some(input);
self
}
pub fn set_replica_provisioned_write_capacity_auto_scaling_settings(
mut self,
input: std::option::Option<crate::model::AutoScalingSettingsDescription>,
) -> Self {
self.replica_provisioned_write_capacity_auto_scaling_settings = input;
self
}
/// <p>The current state of the replica:</p>
/// <ul>
/// <li>
/// <p>
/// <code>CREATING</code> - The replica is being created.</p>
/// </li>
/// <li>
/// <p>
/// <code>UPDATING</code> - The replica is being updated.</p>
/// </li>
/// <li>
/// <p>
/// <code>DELETING</code> - The replica is being deleted.</p>
/// </li>
/// <li>
/// <p>
/// <code>ACTIVE</code> - The replica is ready for use.</p>
/// </li>
/// </ul>
pub fn replica_status(mut self, input: crate::model::ReplicaStatus) -> Self {
self.replica_status = Some(input);
self
}
pub fn set_replica_status(
mut self,
input: std::option::Option<crate::model::ReplicaStatus>,
) -> Self {
self.replica_status = input;
self
}
/// Consumes the builder and constructs a [`ReplicaAutoScalingDescription`](crate::model::ReplicaAutoScalingDescription)
pub fn build(self) -> crate::model::ReplicaAutoScalingDescription {
crate::model::ReplicaAutoScalingDescription {
region_name: self.region_name,
global_secondary_indexes: self.global_secondary_indexes,
replica_provisioned_read_capacity_auto_scaling_settings: self
.replica_provisioned_read_capacity_auto_scaling_settings,
replica_provisioned_write_capacity_auto_scaling_settings: self
.replica_provisioned_write_capacity_auto_scaling_settings,
replica_status: self.replica_status,
}
}
}
}
impl ReplicaAutoScalingDescription {
/// Creates a new builder-style object to manufacture [`ReplicaAutoScalingDescription`](crate::model::ReplicaAutoScalingDescription)
pub fn builder() -> crate::model::replica_auto_scaling_description::Builder {
crate::model::replica_auto_scaling_description::Builder::default()
}
}
#[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 ReplicaStatus {
Active,
Creating,
CreationFailed,
Deleting,
InaccessibleEncryptionCredentials,
RegionDisabled,
Updating,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for ReplicaStatus {
fn from(s: &str) -> Self {
match s {
"ACTIVE" => ReplicaStatus::Active,
"CREATING" => ReplicaStatus::Creating,
"CREATION_FAILED" => ReplicaStatus::CreationFailed,
"DELETING" => ReplicaStatus::Deleting,
"INACCESSIBLE_ENCRYPTION_CREDENTIALS" => {
ReplicaStatus::InaccessibleEncryptionCredentials
}
"REGION_DISABLED" => ReplicaStatus::RegionDisabled,
"UPDATING" => ReplicaStatus::Updating,
other => ReplicaStatus::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ReplicaStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ReplicaStatus::from(s))
}
}
impl ReplicaStatus {
pub fn as_str(&self) -> &str {
match self {
ReplicaStatus::Active => "ACTIVE",
ReplicaStatus::Creating => "CREATING",
ReplicaStatus::CreationFailed => "CREATION_FAILED",
ReplicaStatus::Deleting => "DELETING",
ReplicaStatus::InaccessibleEncryptionCredentials => {
"INACCESSIBLE_ENCRYPTION_CREDENTIALS"
}
ReplicaStatus::RegionDisabled => "REGION_DISABLED",
ReplicaStatus::Updating => "UPDATING",
ReplicaStatus::Unknown(s) => s.as_ref(),
}
}
pub fn values() -> &'static [&'static str] {
&[
"ACTIVE",
"CREATING",
"CREATION_FAILED",
"DELETING",
"INACCESSIBLE_ENCRYPTION_CREDENTIALS",
"REGION_DISABLED",
"UPDATING",
]
}
}
impl AsRef<str> for ReplicaStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
/// <p>Represents the auto scaling settings for a global table or global secondary
/// index.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AutoScalingSettingsDescription {
/// <p>The minimum capacity units that a global table or global secondary index should be scaled down to.</p>
pub minimum_units: std::option::Option<i64>,
/// <p>The maximum capacity units that a global table or global secondary index should be scaled up to.</p>
pub maximum_units: std::option::Option<i64>,
/// <p>Disabled auto scaling for this global table or global secondary index.</p>
pub auto_scaling_disabled: std::option::Option<bool>,
/// <p>Role ARN used for configuring the auto scaling policy.</p>
pub auto_scaling_role_arn: std::option::Option<std::string::String>,
/// <p>Information about the scaling policies.</p>
pub scaling_policies:
std::option::Option<std::vec::Vec<crate::model::AutoScalingPolicyDescription>>,
}
impl std::fmt::Debug for AutoScalingSettingsDescription {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AutoScalingSettingsDescription");
formatter.field("minimum_units", &self.minimum_units);
formatter.field("maximum_units", &self.maximum_units);
formatter.field("auto_scaling_disabled", &self.auto_scaling_disabled);
formatter.field("auto_scaling_role_arn", &self.auto_scaling_role_arn);
formatter.field("scaling_policies", &self.scaling_policies);
formatter.finish()
}
}
/// See [`AutoScalingSettingsDescription`](crate::model::AutoScalingSettingsDescription)
pub mod auto_scaling_settings_description {
/// A builder for [`AutoScalingSettingsDescription`](crate::model::AutoScalingSettingsDescription)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) minimum_units: std::option::Option<i64>,
pub(crate) maximum_units: std::option::Option<i64>,
pub(crate) auto_scaling_disabled: std::option::Option<bool>,
pub(crate) auto_scaling_role_arn: std::option::Option<std::string::String>,
pub(crate) scaling_policies:
std::option::Option<std::vec::Vec<crate::model::AutoScalingPolicyDescription>>,
}
impl Builder {
/// <p>The minimum capacity units that a global table or global secondary index should be scaled down to.</p>
pub fn minimum_units(mut self, input: i64) -> Self {
self.minimum_units = Some(input);
self
}
pub fn set_minimum_units(mut self, input: std::option::Option<i64>) -> Self {
self.minimum_units = input;
self
}
/// <p>The maximum capacity units that a global table or global secondary index should be scaled up to.</p>
pub fn maximum_units(mut self, input: i64) -> Self {
self.maximum_units = Some(input);
self
}
pub fn set_maximum_units(mut self, input: std::option::Option<i64>) -> Self {
self.maximum_units = input;
self
}
/// <p>Disabled auto scaling for this global table or global secondary index.</p>
pub fn auto_scaling_disabled(mut self, input: bool) -> Self {
self.auto_scaling_disabled = Some(input);
self
}
pub fn set_auto_scaling_disabled(mut self, input: std::option::Option<bool>) -> Self {
self.auto_scaling_disabled = input;
self
}
/// <p>Role ARN used for configuring the auto scaling policy.</p>
pub fn auto_scaling_role_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.auto_scaling_role_arn = Some(input.into());
self
}
pub fn set_auto_scaling_role_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.auto_scaling_role_arn = input;
self
}
pub fn scaling_policies(
mut self,
input: impl Into<crate::model::AutoScalingPolicyDescription>,
) -> Self {
let mut v = self.scaling_policies.unwrap_or_default();
v.push(input.into());
self.scaling_policies = Some(v);
self
}
pub fn set_scaling_policies(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::AutoScalingPolicyDescription>>,
) -> Self {
self.scaling_policies = input;
self
}
/// Consumes the builder and constructs a [`AutoScalingSettingsDescription`](crate::model::AutoScalingSettingsDescription)
pub fn build(self) -> crate::model::AutoScalingSettingsDescription {
crate::model::AutoScalingSettingsDescription {
minimum_units: self.minimum_units,
maximum_units: self.maximum_units,
auto_scaling_disabled: self.auto_scaling_disabled,
auto_scaling_role_arn: self.auto_scaling_role_arn,
scaling_policies: self.scaling_policies,
}
}
}
}
impl AutoScalingSettingsDescription {
/// Creates a new builder-style object to manufacture [`AutoScalingSettingsDescription`](crate::model::AutoScalingSettingsDescription)
pub fn builder() -> crate::model::auto_scaling_settings_description::Builder {
crate::model::auto_scaling_settings_description::Builder::default()
}
}
/// <p>Represents the properties of the scaling policy.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AutoScalingPolicyDescription {
/// <p>The name of the scaling policy.</p>
pub policy_name: std::option::Option<std::string::String>,
/// <p>Represents a target tracking scaling policy configuration.</p>
pub target_tracking_scaling_policy_configuration: std::option::Option<
crate::model::AutoScalingTargetTrackingScalingPolicyConfigurationDescription,
>,
}
impl std::fmt::Debug for AutoScalingPolicyDescription {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("AutoScalingPolicyDescription");
formatter.field("policy_name", &self.policy_name);
formatter.field(
"target_tracking_scaling_policy_configuration",
&self.target_tracking_scaling_policy_configuration,
);
formatter.finish()
}
}
/// See [`AutoScalingPolicyDescription`](crate::model::AutoScalingPolicyDescription)
pub mod auto_scaling_policy_description {
/// A builder for [`AutoScalingPolicyDescription`](crate::model::AutoScalingPolicyDescription)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) policy_name: std::option::Option<std::string::String>,
pub(crate) target_tracking_scaling_policy_configuration: std::option::Option<
crate::model::AutoScalingTargetTrackingScalingPolicyConfigurationDescription,
>,
}
impl Builder {
/// <p>The name of the scaling policy.</p>
pub fn policy_name(mut self, input: impl Into<std::string::String>) -> Self {
self.policy_name = Some(input.into());
self
}
pub fn set_policy_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.policy_name = input;
self
}
/// <p>Represents a target tracking scaling policy configuration.</p>
pub fn target_tracking_scaling_policy_configuration(
mut self,
input: crate::model::AutoScalingTargetTrackingScalingPolicyConfigurationDescription,
) -> Self {
self.target_tracking_scaling_policy_configuration = Some(input);
self
}
pub fn set_target_tracking_scaling_policy_configuration(
mut self,
input: std::option::Option<
crate::model::AutoScalingTargetTrackingScalingPolicyConfigurationDescription,
>,
) -> Self {
self.target_tracking_scaling_policy_configuration = input;
self
}
/// Consumes the builder and constructs a [`AutoScalingPolicyDescription`](crate::model::AutoScalingPolicyDescription)
pub fn build(self) -> crate::model::AutoScalingPolicyDescription {
crate::model::AutoScalingPolicyDescription {
policy_name: self.policy_name,
target_tracking_scaling_policy_configuration: self
.target_tracking_scaling_policy_configuration,
}
}
}
}
impl AutoScalingPolicyDescription {
/// Creates a new builder-style object to manufacture [`AutoScalingPolicyDescription`](crate::model::AutoScalingPolicyDescription)
pub fn builder() -> crate::model::auto_scaling_policy_description::Builder {
crate::model::auto_scaling_policy_description::Builder::default()
}
}
/// <p>Represents the properties of a target tracking scaling policy.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
/// <p>Indicates whether scale in by the target tracking policy is disabled. If the value is true,
/// scale in is disabled and the target tracking policy won't remove capacity from the scalable resource.
/// Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource.
/// The default value is false.</p>
pub disable_scale_in: std::option::Option<bool>,
/// <p>The amount of time, in seconds, after a scale in activity completes before another scale
/// in activity can start. The cooldown period is used to block subsequent scale in requests
/// until it has expired. You should scale in conservatively to protect your application's
/// availability. However, if another alarm triggers a scale out policy during the cooldown
/// period after a scale-in, application auto scaling scales out your scalable target
/// immediately. </p>
pub scale_in_cooldown: std::option::Option<i32>,
/// <p>The amount of time, in seconds, after a scale out activity completes before another scale out
/// activity can start. While the cooldown period is in effect, the capacity that has been added
/// by the previous scale out event that initiated the cooldown is calculated as part of the
/// desired capacity for the next scale out. You should continuously (but not excessively)
/// scale out.</p>
pub scale_out_cooldown: std::option::Option<i32>,
/// <p>The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2).</p>
pub target_value: std::option::Option<f64>,
}
impl std::fmt::Debug for AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter =
f.debug_struct("AutoScalingTargetTrackingScalingPolicyConfigurationDescription");
formatter.field("disable_scale_in", &self.disable_scale_in);
formatter.field("scale_in_cooldown", &self.scale_in_cooldown);
formatter.field("scale_out_cooldown", &self.scale_out_cooldown);
formatter.field("target_value", &self.target_value);
formatter.finish()
}
}
/// See [`AutoScalingTargetTrackingScalingPolicyConfigurationDescription`](crate::model::AutoScalingTargetTrackingScalingPolicyConfigurationDescription)
pub mod auto_scaling_target_tracking_scaling_policy_configuration_description {
/// A builder for [`AutoScalingTargetTrackingScalingPolicyConfigurationDescription`](crate::model::AutoScalingTargetTrackingScalingPolicyConfigurationDescription)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) disable_scale_in: std::option::Option<bool>,
pub(crate) scale_in_cooldown: std::option::Option<i32>,
pub(crate) scale_out_cooldown: std::option::Option<i32>,
pub(crate) target_value: std::option::Option<f64>,
}
impl Builder {
/// <p>Indicates whether scale in by the target tracking policy is disabled. If the value is true,
/// scale in is disabled and the target tracking policy won't remove capacity from the scalable resource.
/// Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource.
/// The default value is false.</p>
pub fn disable_scale_in(mut self, input: bool) -> Self {
self.disable_scale_in = Some(input);
self
}
pub fn set_disable_scale_in(mut self, input: std::option::Option<bool>) -> Self {
self.disable_scale_in = input;
self
}
/// <p>The amount of time, in seconds, after a scale in activity completes before another scale
/// in activity can start. The cooldown period is used to block subsequent scale in requests
/// until it has expired. You should scale in conservatively to protect your application's
/// availability. However, if another alarm triggers a scale out policy during the cooldown
/// period after a scale-in, application auto scaling scales out your scalable target
/// immediately. </p>
pub fn scale_in_cooldown(mut self, input: i32) -> Self {
self.scale_in_cooldown = Some(input);
self
}
pub fn set_scale_in_cooldown(mut self, input: std::option::Option<i32>) -> Self {
self.scale_in_cooldown = input;
self
}
/// <p>The amount of time, in seconds, after a scale out activity completes before another scale out
/// activity can start. While the cooldown period is in effect, the capacity that has been added
/// by the previous scale out event that initiated the cooldown is calculated as part of the
/// desired capacity for the next scale out. You should continuously (but not excessively)
/// scale out.</p>
pub fn scale_out_cooldown(mut self, input: i32) -> Self {
self.scale_out_cooldown = Some(input);
self
}
pub fn set_scale_out_cooldown(mut self, input: std::option::Option<i32>) -> Self {
self.scale_out_cooldown = input;
self
}
/// <p>The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2).</p>
pub fn target_value(mut self, input: f64) -> Self {
self.target_value = Some(input);
self
}
pub fn set_target_value(mut self, input: std::option::Option<f64>) -> Self {
self.target_value = input;
self
}
/// Consumes the builder and constructs a [`AutoScalingTargetTrackingScalingPolicyConfigurationDescription`](crate::model::AutoScalingTargetTrackingScalingPolicyConfigurationDescription)
pub fn build(
self,
) -> crate::model::AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
crate::model::AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
disable_scale_in: self.disable_scale_in,
scale_in_cooldown: self.scale_in_cooldown,
scale_out_cooldown: self.scale_out_cooldown,
target_value: self.target_value,
}
}
}
}
impl AutoScalingTargetTrackingScalingPolicyConfigurationDescription {
/// Creates a new builder-style object to manufacture [`AutoScalingTargetTrackingScalingPolicyConfigurationDescription`](crate::model::AutoScalingTargetTrackingScalingPolicyConfigurationDescription)
pub fn builder(
) -> crate::model::auto_scaling_target_tracking_scaling_policy_configuration_description::Builder
{
crate::model::auto_scaling_target_tracking_scaling_policy_configuration_description::Builder::default()
}
}
/// <p>Represents the auto scaling configuration for a replica global secondary index.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ReplicaGlobalSecondaryIndexAutoScalingDescription {
/// <p>The name of the global secondary index.</p>
pub index_name: std::option::Option<std::string::String>,
/// <p>The current state of the replica global secondary index:</p>
/// <ul>
/// <li>
/// <p>
/// <code>CREATING</code> - The index is being created.</p>
/// </li>
/// <li>
/// <p>
/// <code>UPDATING</code> - The index is being updated.</p>
/// </li>
/// <li>
/// <p>
/// <code>DELETING</code> - The index is being deleted.</p>
/// </li>
/// <li>
/// <p>
/// <code>ACTIVE</code> - The index is ready for use.</p>
/// </li>
/// </ul>
pub index_status: std::option::Option<crate::model::IndexStatus>,
/// <p>Represents the auto scaling settings for a global table or global secondary
/// index.</p>
pub provisioned_read_capacity_auto_scaling_settings:
std::option::Option<crate::model::AutoScalingSettingsDescription>,
/// <p>Represents the auto scaling settings for a global table or global secondary
/// index.</p>
pub provisioned_write_capacity_auto_scaling_settings:
std::option::Option<crate::model::AutoScalingSettingsDescription>,
}
impl std::fmt::Debug for ReplicaGlobalSecondaryIndexAutoScalingDescription {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ReplicaGlobalSecondaryIndexAutoScalingDescription");
formatter.field("index_name", &self.index_name);
formatter.field("index_status", &self.index_status);
formatter.field(
"provisioned_read_capacity_auto_scaling_settings",
&self.provisioned_read_capacity_auto_scaling_settings,
);
formatter.field(
"provisioned_write_capacity_auto_scaling_settings",
&self.provisioned_write_capacity_auto_scaling_settings,
);
formatter.finish()
}
}
/// See [`ReplicaGlobalSecondaryIndexAutoScalingDescription`](crate::model::ReplicaGlobalSecondaryIndexAutoScalingDescription)
pub mod replica_global_secondary_index_auto_scaling_description {
/// A builder for [`ReplicaGlobalSecondaryIndexAutoScalingDescription`](crate::model::ReplicaGlobalSecondaryIndexAutoScalingDescription)
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) index_name: std::option::Option<std::string::String>,
pub(crate) index_status: std::option::Option<crate::model::IndexStatus>,
pub(crate) provisioned_read_capacity_auto_scaling_settings:
std::option::Option<crate::model::AutoScalingSettingsDescription>,
pub(crate) provisioned_write_capacity_auto_scaling_settings:
std::option::Option<crate::model::AutoScalingSettingsDescription>,
}
impl Builder {
/// <p>The name of the global secondary index.</p>
pub fn index_name(mut self, input: impl Into<std::string::String>) -> Self {
self.index_name = Some(input.into());
self
}
pub fn set_index_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.index_name = input;
self
}
/// <p>The current state of the replica global secondary index:</p>
/// <ul>
/// <li>
/// <p>
/// <code>CREATING</code> - The index is being created.</p>
/// </li>
/// <li>
/// <p>
/// <code>UPDATING</code> - The index is being updated.</p>
/// </li>
/// <li>
/// <p>
/// <code>DELETING</code> - The index is being deleted.</p>
/// </li>
/// <li>
/// <p>
/// <code>ACTIVE</code> - The index is ready for use.</p>
/// </li>
/// </ul>
pub fn index_status(mut self, input: crate::model::IndexStatus) -> Self {
self.index_status = Some(input);
self
}
pub fn set_index_status(
mut self,
input: std::option::Option<crate::model::IndexStatus>,
) -> Self {
self.index_status = input;
self
}
/// <p>Represents the auto scaling settings for a global table or global secondary
/// index.</p>
pub fn provisioned_read_capacity_auto_scaling_settings(
mut self,
input: crate::model::AutoScalingSettingsDescription,
) -> Self {
self.provisioned_read_capacity_auto_scaling_settings = Some(input);
self
}
pub fn set_provisioned_read_capacity_auto_scaling_settings(
mut self,
input: std::option::Option<crate::model::AutoScalingSettingsDescription>,
) -> Self {
self.provisioned_read_capacity_auto_scaling_settings = input;
self
}
/// <p>Represents the auto scaling settings for a global table or global secondary
/// index.</p>
pub fn provisioned_write_capacity_auto_scaling_settings(
mut self,
input: crate::model::AutoScalingSettingsDescription,
) -> Self {
self.provisioned_write_capacity_auto_scaling_settings = Some(input);
self
}
pub fn set_provisioned_write_capacity_auto_scaling_settings(
mut self,
input: std::option::Option<crate::model::AutoScalingSettingsDescription>,
) -> Self {
self.provisioned_write_capacity_auto_scaling_settings = input;
self
}
/// Consumes the builder and constructs a [`ReplicaGlobalSecondaryIndexAutoScalingDescription`](crate::model::ReplicaGlobalSecondaryIndexAutoScalingDescription)
pub fn build(self) -> crate::model::ReplicaGlobalSecondaryIndexAutoScalingDescription {
crate::model::ReplicaGlobalSecondaryIndexAutoScalingDescription {
index_name: self.index_name,
index_status: self.index_status,
provisioned_read_capacity_auto_scaling_settings: self
.provisioned_read_capacity_auto_scaling_settings,
provisioned_write_capacity_auto_scaling_settings: self
.provisioned_write_capacity_auto_scaling_settings,
}
}
}
}
impl ReplicaGlobalSecondaryIndexAutoScalingDescription {
/// Creates a new builder-style object to manufacture [`ReplicaGlobalSecondaryIndexAutoScalingDescription`](crate::model::ReplicaGlobalSecondaryIndexAutoScalingDescription)
pub fn builder(
) -> crate::model::replica_global_secondary_index_auto_scaling_description::Builder {
crate::model::replica_global_secondary_index_auto_scaling_description::Builder::default()
}
}
#[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 IndexStatus {
Active,
Creating,
Deleting,
Updating,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for IndexStatus {
fn from(s: &str) -> Self {
match s {
"ACTIVE" => IndexStatus::Active,
"CREATING" => IndexStatus::Creating,
"DELETING" => IndexStatus::Deleting,
"UPDATING" => IndexStatus::Updating,
other => IndexStatus::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for IndexStatus {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(IndexStatus::from(s))
}
}
impl IndexStatus {
pub fn as_str(&self) -> &str {
match self {
IndexStatus::Active => "ACTIVE",
IndexStatus::Creating => "CREATING",
IndexStatus::Deleting => "DELETING",
IndexStatus::Updating => "UPDATING",
IndexStatus::Unknown(s) => s.as_ref(),
}
}
pub fn values() -> &'static [&'static str] {
&["ACTIVE", "CREATING", "DELETING", "UPDATING"]
}
}
impl AsRef<str> for IndexStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
#[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 TableStatus {
Active,
Archived,
Archiving,
Creating,
Deleting,
InaccessibleEncryptionCredentials,
Updating,
/// Unknown contains new variants that have been added since this code was generated.
Unknown(String),
}
impl std::convert::From<&str> for TableStatus {
fn from(s: &str) -> Self {
match s {
"ACTIVE" => TableStatus::Active,
"ARCHIVED" => TableStatus::Archived,