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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Specifies how many protections of a given type you can create.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Limit {
/// <p>The type of protection.</p>
pub r#type: ::std::option::Option<::std::string::String>,
/// <p>The maximum number of protections that can be created for the specified <code>Type</code>.</p>
pub max: i64,
}
impl Limit {
/// <p>The type of protection.</p>
pub fn r#type(&self) -> ::std::option::Option<&str> {
self.r#type.as_deref()
}
/// <p>The maximum number of protections that can be created for the specified <code>Type</code>.</p>
pub fn max(&self) -> i64 {
self.max
}
}
impl Limit {
/// Creates a new builder-style object to manufacture [`Limit`](crate::types::Limit).
pub fn builder() -> crate::types::builders::LimitBuilder {
crate::types::builders::LimitBuilder::default()
}
}
/// A builder for [`Limit`](crate::types::Limit).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct LimitBuilder {
pub(crate) r#type: ::std::option::Option<::std::string::String>,
pub(crate) max: ::std::option::Option<i64>,
}
impl LimitBuilder {
/// <p>The type of protection.</p>
pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.r#type = ::std::option::Option::Some(input.into());
self
}
/// <p>The type of protection.</p>
pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.r#type = input;
self
}
/// <p>The type of protection.</p>
pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
&self.r#type
}
/// <p>The maximum number of protections that can be created for the specified <code>Type</code>.</p>
pub fn max(mut self, input: i64) -> Self {
self.max = ::std::option::Option::Some(input);
self
}
/// <p>The maximum number of protections that can be created for the specified <code>Type</code>.</p>
pub fn set_max(mut self, input: ::std::option::Option<i64>) -> Self {
self.max = input;
self
}
/// <p>The maximum number of protections that can be created for the specified <code>Type</code>.</p>
pub fn get_max(&self) -> &::std::option::Option<i64> {
&self.max
}
/// Consumes the builder and constructs a [`Limit`](crate::types::Limit).
pub fn build(self) -> crate::types::Limit {
crate::types::Limit {
r#type: self.r#type,
max: self.max.unwrap_or_default(),
}
}
}