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
// 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 CreateServiceEnvironmentInput {
/// <p>The name for the service environment. It can be up to 128 characters long and can contain letters, numbers, hyphens (-), and underscores (_).</p>
pub service_environment_name: ::std::option::Option<::std::string::String>,
/// <p>The type of service environment. For SageMaker Training jobs, specify <code>SAGEMAKER_TRAINING</code>.</p>
pub service_environment_type: ::std::option::Option<crate::types::ServiceEnvironmentType>,
/// <p>The state of the service environment. Valid values are <code>ENABLED</code> and <code>DISABLED</code>. The default value is <code>ENABLED</code>.</p>
pub state: ::std::option::Option<crate::types::ServiceEnvironmentState>,
/// <p>The capacity limits for the service environment. The number of instances a job consumes is the total number of instances requested in the submit training job request resource configuration.</p>
pub capacity_limits: ::std::option::Option<::std::vec::Vec<crate::types::CapacityLimit>>,
/// <p>The tags that you apply to the service environment to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a>.</p>
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateServiceEnvironmentInput {
/// <p>The name for the service environment. It can be up to 128 characters long and can contain letters, numbers, hyphens (-), and underscores (_).</p>
pub fn service_environment_name(&self) -> ::std::option::Option<&str> {
self.service_environment_name.as_deref()
}
/// <p>The type of service environment. For SageMaker Training jobs, specify <code>SAGEMAKER_TRAINING</code>.</p>
pub fn service_environment_type(&self) -> ::std::option::Option<&crate::types::ServiceEnvironmentType> {
self.service_environment_type.as_ref()
}
/// <p>The state of the service environment. Valid values are <code>ENABLED</code> and <code>DISABLED</code>. The default value is <code>ENABLED</code>.</p>
pub fn state(&self) -> ::std::option::Option<&crate::types::ServiceEnvironmentState> {
self.state.as_ref()
}
/// <p>The capacity limits for the service environment. The number of instances a job consumes is the total number of instances requested in the submit training job request resource configuration.</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 `.capacity_limits.is_none()`.
pub fn capacity_limits(&self) -> &[crate::types::CapacityLimit] {
self.capacity_limits.as_deref().unwrap_or_default()
}
/// <p>The tags that you apply to the service environment to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a>.</p>
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
}
impl CreateServiceEnvironmentInput {
/// Creates a new builder-style object to manufacture [`CreateServiceEnvironmentInput`](crate::operation::create_service_environment::CreateServiceEnvironmentInput).
pub fn builder() -> crate::operation::create_service_environment::builders::CreateServiceEnvironmentInputBuilder {
crate::operation::create_service_environment::builders::CreateServiceEnvironmentInputBuilder::default()
}
}
/// A builder for [`CreateServiceEnvironmentInput`](crate::operation::create_service_environment::CreateServiceEnvironmentInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateServiceEnvironmentInputBuilder {
pub(crate) service_environment_name: ::std::option::Option<::std::string::String>,
pub(crate) service_environment_type: ::std::option::Option<crate::types::ServiceEnvironmentType>,
pub(crate) state: ::std::option::Option<crate::types::ServiceEnvironmentState>,
pub(crate) capacity_limits: ::std::option::Option<::std::vec::Vec<crate::types::CapacityLimit>>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateServiceEnvironmentInputBuilder {
/// <p>The name for the service environment. It can be up to 128 characters long and can contain letters, numbers, hyphens (-), and underscores (_).</p>
/// This field is required.
pub fn service_environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.service_environment_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name for the service environment. It can be up to 128 characters long and can contain letters, numbers, hyphens (-), and underscores (_).</p>
pub fn set_service_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.service_environment_name = input;
self
}
/// <p>The name for the service environment. It can be up to 128 characters long and can contain letters, numbers, hyphens (-), and underscores (_).</p>
pub fn get_service_environment_name(&self) -> &::std::option::Option<::std::string::String> {
&self.service_environment_name
}
/// <p>The type of service environment. For SageMaker Training jobs, specify <code>SAGEMAKER_TRAINING</code>.</p>
/// This field is required.
pub fn service_environment_type(mut self, input: crate::types::ServiceEnvironmentType) -> Self {
self.service_environment_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of service environment. For SageMaker Training jobs, specify <code>SAGEMAKER_TRAINING</code>.</p>
pub fn set_service_environment_type(mut self, input: ::std::option::Option<crate::types::ServiceEnvironmentType>) -> Self {
self.service_environment_type = input;
self
}
/// <p>The type of service environment. For SageMaker Training jobs, specify <code>SAGEMAKER_TRAINING</code>.</p>
pub fn get_service_environment_type(&self) -> &::std::option::Option<crate::types::ServiceEnvironmentType> {
&self.service_environment_type
}
/// <p>The state of the service environment. Valid values are <code>ENABLED</code> and <code>DISABLED</code>. The default value is <code>ENABLED</code>.</p>
pub fn state(mut self, input: crate::types::ServiceEnvironmentState) -> Self {
self.state = ::std::option::Option::Some(input);
self
}
/// <p>The state of the service environment. Valid values are <code>ENABLED</code> and <code>DISABLED</code>. The default value is <code>ENABLED</code>.</p>
pub fn set_state(mut self, input: ::std::option::Option<crate::types::ServiceEnvironmentState>) -> Self {
self.state = input;
self
}
/// <p>The state of the service environment. Valid values are <code>ENABLED</code> and <code>DISABLED</code>. The default value is <code>ENABLED</code>.</p>
pub fn get_state(&self) -> &::std::option::Option<crate::types::ServiceEnvironmentState> {
&self.state
}
/// Appends an item to `capacity_limits`.
///
/// To override the contents of this collection use [`set_capacity_limits`](Self::set_capacity_limits).
///
/// <p>The capacity limits for the service environment. The number of instances a job consumes is the total number of instances requested in the submit training job request resource configuration.</p>
pub fn capacity_limits(mut self, input: crate::types::CapacityLimit) -> Self {
let mut v = self.capacity_limits.unwrap_or_default();
v.push(input);
self.capacity_limits = ::std::option::Option::Some(v);
self
}
/// <p>The capacity limits for the service environment. The number of instances a job consumes is the total number of instances requested in the submit training job request resource configuration.</p>
pub fn set_capacity_limits(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CapacityLimit>>) -> Self {
self.capacity_limits = input;
self
}
/// <p>The capacity limits for the service environment. The number of instances a job consumes is the total number of instances requested in the submit training job request resource configuration.</p>
pub fn get_capacity_limits(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CapacityLimit>> {
&self.capacity_limits
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags that you apply to the service environment to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a>.</p>
pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = ::std::option::Option::Some(hash_map);
self
}
/// <p>The tags that you apply to the service environment to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a>.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.tags = input;
self
}
/// <p>The tags that you apply to the service environment to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see <a href="https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html">Tagging your Batch resources</a>.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.tags
}
/// Consumes the builder and constructs a [`CreateServiceEnvironmentInput`](crate::operation::create_service_environment::CreateServiceEnvironmentInput).
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::create_service_environment::CreateServiceEnvironmentInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::create_service_environment::CreateServiceEnvironmentInput {
service_environment_name: self.service_environment_name,
service_environment_type: self.service_environment_type,
state: self.state,
capacity_limits: self.capacity_limits,
tags: self.tags,
})
}
}