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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Describes the resources available for a container instance.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Resource {
/// <p>The name of the resource, such as <code>CPU</code>, <code>MEMORY</code>, <code>PORTS</code>, <code>PORTS_UDP</code>, or a user-defined resource.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The type of the resource. Valid values: <code>INTEGER</code>, <code>DOUBLE</code>, <code>LONG</code>, or <code>STRINGSET</code>.</p>
pub r#type: ::std::option::Option<::std::string::String>,
/// <p>When the <code>doubleValue</code> type is set, the value of the resource must be a double precision floating-point type.</p>
pub double_value: f64,
/// <p>When the <code>longValue</code> type is set, the value of the resource must be an extended precision floating-point type.</p>
pub long_value: i64,
/// <p>When the <code>integerValue</code> type is set, the value of the resource must be an integer.</p>
pub integer_value: i32,
/// <p>When the <code>stringSetValue</code> type is set, the value of the resource must be a string type.</p>
pub string_set_value: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Resource {
/// <p>The name of the resource, such as <code>CPU</code>, <code>MEMORY</code>, <code>PORTS</code>, <code>PORTS_UDP</code>, or a user-defined resource.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The type of the resource. Valid values: <code>INTEGER</code>, <code>DOUBLE</code>, <code>LONG</code>, or <code>STRINGSET</code>.</p>
pub fn r#type(&self) -> ::std::option::Option<&str> {
self.r#type.as_deref()
}
/// <p>When the <code>doubleValue</code> type is set, the value of the resource must be a double precision floating-point type.</p>
pub fn double_value(&self) -> f64 {
self.double_value
}
/// <p>When the <code>longValue</code> type is set, the value of the resource must be an extended precision floating-point type.</p>
pub fn long_value(&self) -> i64 {
self.long_value
}
/// <p>When the <code>integerValue</code> type is set, the value of the resource must be an integer.</p>
pub fn integer_value(&self) -> i32 {
self.integer_value
}
/// <p>When the <code>stringSetValue</code> type is set, the value of the resource must be a string type.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.string_set_value.is_none()`.
pub fn string_set_value(&self) -> &[::std::string::String] {
self.string_set_value.as_deref().unwrap_or_default()
}
}
impl Resource {
/// Creates a new builder-style object to manufacture [`Resource`](crate::types::Resource).
pub fn builder() -> crate::types::builders::ResourceBuilder {
crate::types::builders::ResourceBuilder::default()
}
}
/// A builder for [`Resource`](crate::types::Resource).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ResourceBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<::std::string::String>,
pub(crate) double_value: ::std::option::Option<f64>,
pub(crate) long_value: ::std::option::Option<i64>,
pub(crate) integer_value: ::std::option::Option<i32>,
pub(crate) string_set_value: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl ResourceBuilder {
/// <p>The name of the resource, such as <code>CPU</code>, <code>MEMORY</code>, <code>PORTS</code>, <code>PORTS_UDP</code>, or a user-defined resource.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the resource, such as <code>CPU</code>, <code>MEMORY</code>, <code>PORTS</code>, <code>PORTS_UDP</code>, or a user-defined resource.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the resource, such as <code>CPU</code>, <code>MEMORY</code>, <code>PORTS</code>, <code>PORTS_UDP</code>, or a user-defined resource.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The type of the resource. Valid values: <code>INTEGER</code>, <code>DOUBLE</code>, <code>LONG</code>, or <code>STRINGSET</code>.</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 the resource. Valid values: <code>INTEGER</code>, <code>DOUBLE</code>, <code>LONG</code>, or <code>STRINGSET</code>.</p>
pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.r#type = input;
self
}
/// <p>The type of the resource. Valid values: <code>INTEGER</code>, <code>DOUBLE</code>, <code>LONG</code>, or <code>STRINGSET</code>.</p>
pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
&self.r#type
}
/// <p>When the <code>doubleValue</code> type is set, the value of the resource must be a double precision floating-point type.</p>
pub fn double_value(mut self, input: f64) -> Self {
self.double_value = ::std::option::Option::Some(input);
self
}
/// <p>When the <code>doubleValue</code> type is set, the value of the resource must be a double precision floating-point type.</p>
pub fn set_double_value(mut self, input: ::std::option::Option<f64>) -> Self {
self.double_value = input;
self
}
/// <p>When the <code>doubleValue</code> type is set, the value of the resource must be a double precision floating-point type.</p>
pub fn get_double_value(&self) -> &::std::option::Option<f64> {
&self.double_value
}
/// <p>When the <code>longValue</code> type is set, the value of the resource must be an extended precision floating-point type.</p>
pub fn long_value(mut self, input: i64) -> Self {
self.long_value = ::std::option::Option::Some(input);
self
}
/// <p>When the <code>longValue</code> type is set, the value of the resource must be an extended precision floating-point type.</p>
pub fn set_long_value(mut self, input: ::std::option::Option<i64>) -> Self {
self.long_value = input;
self
}
/// <p>When the <code>longValue</code> type is set, the value of the resource must be an extended precision floating-point type.</p>
pub fn get_long_value(&self) -> &::std::option::Option<i64> {
&self.long_value
}
/// <p>When the <code>integerValue</code> type is set, the value of the resource must be an integer.</p>
pub fn integer_value(mut self, input: i32) -> Self {
self.integer_value = ::std::option::Option::Some(input);
self
}
/// <p>When the <code>integerValue</code> type is set, the value of the resource must be an integer.</p>
pub fn set_integer_value(mut self, input: ::std::option::Option<i32>) -> Self {
self.integer_value = input;
self
}
/// <p>When the <code>integerValue</code> type is set, the value of the resource must be an integer.</p>
pub fn get_integer_value(&self) -> &::std::option::Option<i32> {
&self.integer_value
}
/// Appends an item to `string_set_value`.
///
/// To override the contents of this collection use [`set_string_set_value`](Self::set_string_set_value).
///
/// <p>When the <code>stringSetValue</code> type is set, the value of the resource must be a string type.</p>
pub fn string_set_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.string_set_value.unwrap_or_default();
v.push(input.into());
self.string_set_value = ::std::option::Option::Some(v);
self
}
/// <p>When the <code>stringSetValue</code> type is set, the value of the resource must be a string type.</p>
pub fn set_string_set_value(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.string_set_value = input;
self
}
/// <p>When the <code>stringSetValue</code> type is set, the value of the resource must be a string type.</p>
pub fn get_string_set_value(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.string_set_value
}
/// Consumes the builder and constructs a [`Resource`](crate::types::Resource).
pub fn build(self) -> crate::types::Resource {
crate::types::Resource {
name: self.name,
r#type: self.r#type,
double_value: self.double_value.unwrap_or_default(),
long_value: self.long_value.unwrap_or_default(),
integer_value: self.integer_value.unwrap_or_default(),
string_set_value: self.string_set_value,
}
}
}