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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The <code>ulimit</code> settings to pass to the container.</p>
/// <p>Amazon ECS tasks hosted on Fargate use the default resource limit values set by the operating system with the exception of the <code>nofile</code> resource limit parameter which Fargate overrides. The <code>nofile</code> resource limit sets a restriction on the number of open files that a container can use. The default <code>nofile</code> soft limit is <code> 65535</code> and the default hard limit is <code>65535</code>.</p>
/// <p>You can specify the <code>ulimit</code> settings for a container in a task definition.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Ulimit {
/// <p>The <code>type</code> of the <code>ulimit</code>.</p>
pub name: crate::types::UlimitName,
/// <p>The soft limit for the <code>ulimit</code> type. The value can be specified in bytes, seconds, or as a count, depending on the <code>type</code> of the <code>ulimit</code>.</p>
pub soft_limit: i32,
/// <p>The hard limit for the <code>ulimit</code> type. The value can be specified in bytes, seconds, or as a count, depending on the <code>type</code> of the <code>ulimit</code>.</p>
pub hard_limit: i32,
}
impl Ulimit {
/// <p>The <code>type</code> of the <code>ulimit</code>.</p>
pub fn name(&self) -> &crate::types::UlimitName {
&self.name
}
/// <p>The soft limit for the <code>ulimit</code> type. The value can be specified in bytes, seconds, or as a count, depending on the <code>type</code> of the <code>ulimit</code>.</p>
pub fn soft_limit(&self) -> i32 {
self.soft_limit
}
/// <p>The hard limit for the <code>ulimit</code> type. The value can be specified in bytes, seconds, or as a count, depending on the <code>type</code> of the <code>ulimit</code>.</p>
pub fn hard_limit(&self) -> i32 {
self.hard_limit
}
}
impl Ulimit {
/// Creates a new builder-style object to manufacture [`Ulimit`](crate::types::Ulimit).
pub fn builder() -> crate::types::builders::UlimitBuilder {
crate::types::builders::UlimitBuilder::default()
}
}
/// A builder for [`Ulimit`](crate::types::Ulimit).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UlimitBuilder {
pub(crate) name: ::std::option::Option<crate::types::UlimitName>,
pub(crate) soft_limit: ::std::option::Option<i32>,
pub(crate) hard_limit: ::std::option::Option<i32>,
}
impl UlimitBuilder {
/// <p>The <code>type</code> of the <code>ulimit</code>.</p>
/// This field is required.
pub fn name(mut self, input: crate::types::UlimitName) -> Self {
self.name = ::std::option::Option::Some(input);
self
}
/// <p>The <code>type</code> of the <code>ulimit</code>.</p>
pub fn set_name(mut self, input: ::std::option::Option<crate::types::UlimitName>) -> Self {
self.name = input;
self
}
/// <p>The <code>type</code> of the <code>ulimit</code>.</p>
pub fn get_name(&self) -> &::std::option::Option<crate::types::UlimitName> {
&self.name
}
/// <p>The soft limit for the <code>ulimit</code> type. The value can be specified in bytes, seconds, or as a count, depending on the <code>type</code> of the <code>ulimit</code>.</p>
/// This field is required.
pub fn soft_limit(mut self, input: i32) -> Self {
self.soft_limit = ::std::option::Option::Some(input);
self
}
/// <p>The soft limit for the <code>ulimit</code> type. The value can be specified in bytes, seconds, or as a count, depending on the <code>type</code> of the <code>ulimit</code>.</p>
pub fn set_soft_limit(mut self, input: ::std::option::Option<i32>) -> Self {
self.soft_limit = input;
self
}
/// <p>The soft limit for the <code>ulimit</code> type. The value can be specified in bytes, seconds, or as a count, depending on the <code>type</code> of the <code>ulimit</code>.</p>
pub fn get_soft_limit(&self) -> &::std::option::Option<i32> {
&self.soft_limit
}
/// <p>The hard limit for the <code>ulimit</code> type. The value can be specified in bytes, seconds, or as a count, depending on the <code>type</code> of the <code>ulimit</code>.</p>
/// This field is required.
pub fn hard_limit(mut self, input: i32) -> Self {
self.hard_limit = ::std::option::Option::Some(input);
self
}
/// <p>The hard limit for the <code>ulimit</code> type. The value can be specified in bytes, seconds, or as a count, depending on the <code>type</code> of the <code>ulimit</code>.</p>
pub fn set_hard_limit(mut self, input: ::std::option::Option<i32>) -> Self {
self.hard_limit = input;
self
}
/// <p>The hard limit for the <code>ulimit</code> type. The value can be specified in bytes, seconds, or as a count, depending on the <code>type</code> of the <code>ulimit</code>.</p>
pub fn get_hard_limit(&self) -> &::std::option::Option<i32> {
&self.hard_limit
}
/// Consumes the builder and constructs a [`Ulimit`](crate::types::Ulimit).
/// This method will fail if any of the following fields are not set:
/// - [`name`](crate::types::builders::UlimitBuilder::name)
pub fn build(self) -> ::std::result::Result<crate::types::Ulimit, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Ulimit {
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building Ulimit",
)
})?,
soft_limit: self.soft_limit.unwrap_or_default(),
hard_limit: self.hard_limit.unwrap_or_default(),
})
}
}