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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateUsageLimitInput {
/// <p>The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource to create the usage limit for.</p>
pub resource_arn: ::std::option::Option<::std::string::String>,
/// <p>The type of Amazon Redshift Serverless usage to create a usage limit for.</p>
pub usage_type: ::std::option::Option<crate::types::UsageLimitUsageType>,
/// <p>The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.</p>
pub amount: ::std::option::Option<i64>,
/// <p>The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.</p>
pub period: ::std::option::Option<crate::types::UsageLimitPeriod>,
/// <p>The action that Amazon Redshift Serverless takes when the limit is reached. The default is log.</p>
pub breach_action: ::std::option::Option<crate::types::UsageLimitBreachAction>,
}
impl CreateUsageLimitInput {
/// <p>The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource to create the usage limit for.</p>
pub fn resource_arn(&self) -> ::std::option::Option<&str> {
self.resource_arn.as_deref()
}
/// <p>The type of Amazon Redshift Serverless usage to create a usage limit for.</p>
pub fn usage_type(&self) -> ::std::option::Option<&crate::types::UsageLimitUsageType> {
self.usage_type.as_ref()
}
/// <p>The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.</p>
pub fn amount(&self) -> ::std::option::Option<i64> {
self.amount
}
/// <p>The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.</p>
pub fn period(&self) -> ::std::option::Option<&crate::types::UsageLimitPeriod> {
self.period.as_ref()
}
/// <p>The action that Amazon Redshift Serverless takes when the limit is reached. The default is log.</p>
pub fn breach_action(&self) -> ::std::option::Option<&crate::types::UsageLimitBreachAction> {
self.breach_action.as_ref()
}
}
impl CreateUsageLimitInput {
/// Creates a new builder-style object to manufacture [`CreateUsageLimitInput`](crate::operation::create_usage_limit::CreateUsageLimitInput).
pub fn builder() -> crate::operation::create_usage_limit::builders::CreateUsageLimitInputBuilder {
crate::operation::create_usage_limit::builders::CreateUsageLimitInputBuilder::default()
}
}
/// A builder for [`CreateUsageLimitInput`](crate::operation::create_usage_limit::CreateUsageLimitInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateUsageLimitInputBuilder {
pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
pub(crate) usage_type: ::std::option::Option<crate::types::UsageLimitUsageType>,
pub(crate) amount: ::std::option::Option<i64>,
pub(crate) period: ::std::option::Option<crate::types::UsageLimitPeriod>,
pub(crate) breach_action: ::std::option::Option<crate::types::UsageLimitBreachAction>,
}
impl CreateUsageLimitInputBuilder {
/// <p>The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource to create the usage limit for.</p>
/// This field is required.
pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource to create the usage limit for.</p>
pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource to create the usage limit for.</p>
pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_arn
}
/// <p>The type of Amazon Redshift Serverless usage to create a usage limit for.</p>
/// This field is required.
pub fn usage_type(mut self, input: crate::types::UsageLimitUsageType) -> Self {
self.usage_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of Amazon Redshift Serverless usage to create a usage limit for.</p>
pub fn set_usage_type(mut self, input: ::std::option::Option<crate::types::UsageLimitUsageType>) -> Self {
self.usage_type = input;
self
}
/// <p>The type of Amazon Redshift Serverless usage to create a usage limit for.</p>
pub fn get_usage_type(&self) -> &::std::option::Option<crate::types::UsageLimitUsageType> {
&self.usage_type
}
/// <p>The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.</p>
/// This field is required.
pub fn amount(mut self, input: i64) -> Self {
self.amount = ::std::option::Option::Some(input);
self
}
/// <p>The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.</p>
pub fn set_amount(mut self, input: ::std::option::Option<i64>) -> Self {
self.amount = input;
self
}
/// <p>The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.</p>
pub fn get_amount(&self) -> &::std::option::Option<i64> {
&self.amount
}
/// <p>The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.</p>
pub fn period(mut self, input: crate::types::UsageLimitPeriod) -> Self {
self.period = ::std::option::Option::Some(input);
self
}
/// <p>The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.</p>
pub fn set_period(mut self, input: ::std::option::Option<crate::types::UsageLimitPeriod>) -> Self {
self.period = input;
self
}
/// <p>The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.</p>
pub fn get_period(&self) -> &::std::option::Option<crate::types::UsageLimitPeriod> {
&self.period
}
/// <p>The action that Amazon Redshift Serverless takes when the limit is reached. The default is log.</p>
pub fn breach_action(mut self, input: crate::types::UsageLimitBreachAction) -> Self {
self.breach_action = ::std::option::Option::Some(input);
self
}
/// <p>The action that Amazon Redshift Serverless takes when the limit is reached. The default is log.</p>
pub fn set_breach_action(mut self, input: ::std::option::Option<crate::types::UsageLimitBreachAction>) -> Self {
self.breach_action = input;
self
}
/// <p>The action that Amazon Redshift Serverless takes when the limit is reached. The default is log.</p>
pub fn get_breach_action(&self) -> &::std::option::Option<crate::types::UsageLimitBreachAction> {
&self.breach_action
}
/// Consumes the builder and constructs a [`CreateUsageLimitInput`](crate::operation::create_usage_limit::CreateUsageLimitInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_usage_limit::CreateUsageLimitInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_usage_limit::CreateUsageLimitInput {
resource_arn: self.resource_arn,
usage_type: self.usage_type,
amount: self.amount,
period: self.period,
breach_action: self.breach_action,
})
}
}