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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The properties of a model as returned by the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Model {
/// <p>The name of the model.</p>
pub model_name: ::std::option::Option<::std::string::String>,
/// <p>Describes the container, as part of model definition.</p>
pub primary_container: ::std::option::Option<crate::types::ContainerDefinition>,
/// <p>The containers in the inference pipeline.</p>
pub containers: ::std::option::Option<::std::vec::Vec<crate::types::ContainerDefinition>>,
/// <p>Specifies details about how containers in a multi-container endpoint are run.</p>
pub inference_execution_config: ::std::option::Option<crate::types::InferenceExecutionConfig>,
/// <p>The Amazon Resource Name (ARN) of the IAM role that you specified for the model.</p>
pub execution_role_arn: ::std::option::Option<::std::string::String>,
/// <p>Specifies an Amazon Virtual Private Cloud (VPC) that your SageMaker jobs, hosted models, and compute resources have access to. You can control access to and from your resources by configuring a VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/infrastructure-give-access.html">Give SageMaker Access to Resources in your Amazon VPC</a>.</p>
pub vpc_config: ::std::option::Option<crate::types::VpcConfig>,
/// <p>A timestamp that indicates when the model was created.</p>
pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The Amazon Resource Name (ARN) of the model.</p>
pub model_arn: ::std::option::Option<::std::string::String>,
/// <p>Isolates the model container. No inbound or outbound network calls can be made to or from the model container.</p>
pub enable_network_isolation: ::std::option::Option<bool>,
/// <p>A list of key-value pairs associated with the model. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference Guide</i>.</p>
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
/// <p>A set of recommended deployment configurations for the model.</p>
pub deployment_recommendation: ::std::option::Option<crate::types::DeploymentRecommendation>,
}
impl Model {
/// <p>The name of the model.</p>
pub fn model_name(&self) -> ::std::option::Option<&str> {
self.model_name.as_deref()
}
/// <p>Describes the container, as part of model definition.</p>
pub fn primary_container(&self) -> ::std::option::Option<&crate::types::ContainerDefinition> {
self.primary_container.as_ref()
}
/// <p>The containers in the inference pipeline.</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 `.containers.is_none()`.
pub fn containers(&self) -> &[crate::types::ContainerDefinition] {
self.containers.as_deref().unwrap_or_default()
}
/// <p>Specifies details about how containers in a multi-container endpoint are run.</p>
pub fn inference_execution_config(&self) -> ::std::option::Option<&crate::types::InferenceExecutionConfig> {
self.inference_execution_config.as_ref()
}
/// <p>The Amazon Resource Name (ARN) of the IAM role that you specified for the model.</p>
pub fn execution_role_arn(&self) -> ::std::option::Option<&str> {
self.execution_role_arn.as_deref()
}
/// <p>Specifies an Amazon Virtual Private Cloud (VPC) that your SageMaker jobs, hosted models, and compute resources have access to. You can control access to and from your resources by configuring a VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/infrastructure-give-access.html">Give SageMaker Access to Resources in your Amazon VPC</a>.</p>
pub fn vpc_config(&self) -> ::std::option::Option<&crate::types::VpcConfig> {
self.vpc_config.as_ref()
}
/// <p>A timestamp that indicates when the model was created.</p>
pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.creation_time.as_ref()
}
/// <p>The Amazon Resource Name (ARN) of the model.</p>
pub fn model_arn(&self) -> ::std::option::Option<&str> {
self.model_arn.as_deref()
}
/// <p>Isolates the model container. No inbound or outbound network calls can be made to or from the model container.</p>
pub fn enable_network_isolation(&self) -> ::std::option::Option<bool> {
self.enable_network_isolation
}
/// <p>A list of key-value pairs associated with the model. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference Guide</i>.</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 `.tags.is_none()`.
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
/// <p>A set of recommended deployment configurations for the model.</p>
pub fn deployment_recommendation(&self) -> ::std::option::Option<&crate::types::DeploymentRecommendation> {
self.deployment_recommendation.as_ref()
}
}
impl Model {
/// Creates a new builder-style object to manufacture [`Model`](crate::types::Model).
pub fn builder() -> crate::types::builders::ModelBuilder {
crate::types::builders::ModelBuilder::default()
}
}
/// A builder for [`Model`](crate::types::Model).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ModelBuilder {
pub(crate) model_name: ::std::option::Option<::std::string::String>,
pub(crate) primary_container: ::std::option::Option<crate::types::ContainerDefinition>,
pub(crate) containers: ::std::option::Option<::std::vec::Vec<crate::types::ContainerDefinition>>,
pub(crate) inference_execution_config: ::std::option::Option<crate::types::InferenceExecutionConfig>,
pub(crate) execution_role_arn: ::std::option::Option<::std::string::String>,
pub(crate) vpc_config: ::std::option::Option<crate::types::VpcConfig>,
pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) model_arn: ::std::option::Option<::std::string::String>,
pub(crate) enable_network_isolation: ::std::option::Option<bool>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub(crate) deployment_recommendation: ::std::option::Option<crate::types::DeploymentRecommendation>,
}
impl ModelBuilder {
/// <p>The name of the model.</p>
pub fn model_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.model_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the model.</p>
pub fn set_model_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.model_name = input;
self
}
/// <p>The name of the model.</p>
pub fn get_model_name(&self) -> &::std::option::Option<::std::string::String> {
&self.model_name
}
/// <p>Describes the container, as part of model definition.</p>
pub fn primary_container(mut self, input: crate::types::ContainerDefinition) -> Self {
self.primary_container = ::std::option::Option::Some(input);
self
}
/// <p>Describes the container, as part of model definition.</p>
pub fn set_primary_container(mut self, input: ::std::option::Option<crate::types::ContainerDefinition>) -> Self {
self.primary_container = input;
self
}
/// <p>Describes the container, as part of model definition.</p>
pub fn get_primary_container(&self) -> &::std::option::Option<crate::types::ContainerDefinition> {
&self.primary_container
}
/// Appends an item to `containers`.
///
/// To override the contents of this collection use [`set_containers`](Self::set_containers).
///
/// <p>The containers in the inference pipeline.</p>
pub fn containers(mut self, input: crate::types::ContainerDefinition) -> Self {
let mut v = self.containers.unwrap_or_default();
v.push(input);
self.containers = ::std::option::Option::Some(v);
self
}
/// <p>The containers in the inference pipeline.</p>
pub fn set_containers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ContainerDefinition>>) -> Self {
self.containers = input;
self
}
/// <p>The containers in the inference pipeline.</p>
pub fn get_containers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ContainerDefinition>> {
&self.containers
}
/// <p>Specifies details about how containers in a multi-container endpoint are run.</p>
pub fn inference_execution_config(mut self, input: crate::types::InferenceExecutionConfig) -> Self {
self.inference_execution_config = ::std::option::Option::Some(input);
self
}
/// <p>Specifies details about how containers in a multi-container endpoint are run.</p>
pub fn set_inference_execution_config(mut self, input: ::std::option::Option<crate::types::InferenceExecutionConfig>) -> Self {
self.inference_execution_config = input;
self
}
/// <p>Specifies details about how containers in a multi-container endpoint are run.</p>
pub fn get_inference_execution_config(&self) -> &::std::option::Option<crate::types::InferenceExecutionConfig> {
&self.inference_execution_config
}
/// <p>The Amazon Resource Name (ARN) of the IAM role that you specified for the model.</p>
pub fn execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.execution_role_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the IAM role that you specified for the model.</p>
pub fn set_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.execution_role_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the IAM role that you specified for the model.</p>
pub fn get_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.execution_role_arn
}
/// <p>Specifies an Amazon Virtual Private Cloud (VPC) that your SageMaker jobs, hosted models, and compute resources have access to. You can control access to and from your resources by configuring a VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/infrastructure-give-access.html">Give SageMaker Access to Resources in your Amazon VPC</a>.</p>
pub fn vpc_config(mut self, input: crate::types::VpcConfig) -> Self {
self.vpc_config = ::std::option::Option::Some(input);
self
}
/// <p>Specifies an Amazon Virtual Private Cloud (VPC) that your SageMaker jobs, hosted models, and compute resources have access to. You can control access to and from your resources by configuring a VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/infrastructure-give-access.html">Give SageMaker Access to Resources in your Amazon VPC</a>.</p>
pub fn set_vpc_config(mut self, input: ::std::option::Option<crate::types::VpcConfig>) -> Self {
self.vpc_config = input;
self
}
/// <p>Specifies an Amazon Virtual Private Cloud (VPC) that your SageMaker jobs, hosted models, and compute resources have access to. You can control access to and from your resources by configuring a VPC. For more information, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/infrastructure-give-access.html">Give SageMaker Access to Resources in your Amazon VPC</a>.</p>
pub fn get_vpc_config(&self) -> &::std::option::Option<crate::types::VpcConfig> {
&self.vpc_config
}
/// <p>A timestamp that indicates when the model was created.</p>
pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.creation_time = ::std::option::Option::Some(input);
self
}
/// <p>A timestamp that indicates when the model was created.</p>
pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.creation_time = input;
self
}
/// <p>A timestamp that indicates when the model was created.</p>
pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.creation_time
}
/// <p>The Amazon Resource Name (ARN) of the model.</p>
pub fn model_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.model_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the model.</p>
pub fn set_model_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.model_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the model.</p>
pub fn get_model_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.model_arn
}
/// <p>Isolates the model container. No inbound or outbound network calls can be made to or from the model container.</p>
pub fn enable_network_isolation(mut self, input: bool) -> Self {
self.enable_network_isolation = ::std::option::Option::Some(input);
self
}
/// <p>Isolates the model container. No inbound or outbound network calls can be made to or from the model container.</p>
pub fn set_enable_network_isolation(mut self, input: ::std::option::Option<bool>) -> Self {
self.enable_network_isolation = input;
self
}
/// <p>Isolates the model container. No inbound or outbound network calls can be made to or from the model container.</p>
pub fn get_enable_network_isolation(&self) -> &::std::option::Option<bool> {
&self.enable_network_isolation
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>A list of key-value pairs associated with the model. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference Guide</i>.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
/// <p>A list of key-value pairs associated with the model. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference Guide</i>.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
/// <p>A list of key-value pairs associated with the model. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a> in the <i>Amazon Web Services General Reference Guide</i>.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
/// <p>A set of recommended deployment configurations for the model.</p>
pub fn deployment_recommendation(mut self, input: crate::types::DeploymentRecommendation) -> Self {
self.deployment_recommendation = ::std::option::Option::Some(input);
self
}
/// <p>A set of recommended deployment configurations for the model.</p>
pub fn set_deployment_recommendation(mut self, input: ::std::option::Option<crate::types::DeploymentRecommendation>) -> Self {
self.deployment_recommendation = input;
self
}
/// <p>A set of recommended deployment configurations for the model.</p>
pub fn get_deployment_recommendation(&self) -> &::std::option::Option<crate::types::DeploymentRecommendation> {
&self.deployment_recommendation
}
/// Consumes the builder and constructs a [`Model`](crate::types::Model).
pub fn build(self) -> crate::types::Model {
crate::types::Model {
model_name: self.model_name,
primary_container: self.primary_container,
containers: self.containers,
inference_execution_config: self.inference_execution_config,
execution_role_arn: self.execution_role_arn,
vpc_config: self.vpc_config,
creation_time: self.creation_time,
model_arn: self.model_arn,
enable_network_isolation: self.enable_network_isolation,
tags: self.tags,
deployment_recommendation: self.deployment_recommendation,
}
}
}