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
// 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 StopInferenceExperimentInput {
/// <p>The name of the inference experiment to stop.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>Array of key-value pairs, with names of variants mapped to actions. The possible actions are the following:</p>
/// <ul>
/// <li>
/// <p><code>Promote</code> - Promote the shadow variant to a production variant</p></li>
/// <li>
/// <p><code>Remove</code> - Delete the variant</p></li>
/// <li>
/// <p><code>Retain</code> - Keep the variant as it is</p></li>
/// </ul>
pub model_variant_actions: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ModelVariantAction>>,
/// <p>An array of <code>ModelVariantConfig</code> objects. There is one for each variant that you want to deploy after the inference experiment stops. Each <code>ModelVariantConfig</code> describes the infrastructure configuration for deploying the corresponding variant.</p>
pub desired_model_variants: ::std::option::Option<::std::vec::Vec<crate::types::ModelVariantConfig>>,
/// <p>The desired state of the experiment after stopping. The possible states are the following:</p>
/// <ul>
/// <li>
/// <p><code>Completed</code>: The experiment completed successfully</p></li>
/// <li>
/// <p><code>Cancelled</code>: The experiment was canceled</p></li>
/// </ul>
pub desired_state: ::std::option::Option<crate::types::InferenceExperimentStopDesiredState>,
/// <p>The reason for stopping the experiment.</p>
pub reason: ::std::option::Option<::std::string::String>,
}
impl StopInferenceExperimentInput {
/// <p>The name of the inference experiment to stop.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>Array of key-value pairs, with names of variants mapped to actions. The possible actions are the following:</p>
/// <ul>
/// <li>
/// <p><code>Promote</code> - Promote the shadow variant to a production variant</p></li>
/// <li>
/// <p><code>Remove</code> - Delete the variant</p></li>
/// <li>
/// <p><code>Retain</code> - Keep the variant as it is</p></li>
/// </ul>
pub fn model_variant_actions(
&self,
) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ModelVariantAction>> {
self.model_variant_actions.as_ref()
}
/// <p>An array of <code>ModelVariantConfig</code> objects. There is one for each variant that you want to deploy after the inference experiment stops. Each <code>ModelVariantConfig</code> describes the infrastructure configuration for deploying the corresponding variant.</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 `.desired_model_variants.is_none()`.
pub fn desired_model_variants(&self) -> &[crate::types::ModelVariantConfig] {
self.desired_model_variants.as_deref().unwrap_or_default()
}
/// <p>The desired state of the experiment after stopping. The possible states are the following:</p>
/// <ul>
/// <li>
/// <p><code>Completed</code>: The experiment completed successfully</p></li>
/// <li>
/// <p><code>Cancelled</code>: The experiment was canceled</p></li>
/// </ul>
pub fn desired_state(&self) -> ::std::option::Option<&crate::types::InferenceExperimentStopDesiredState> {
self.desired_state.as_ref()
}
/// <p>The reason for stopping the experiment.</p>
pub fn reason(&self) -> ::std::option::Option<&str> {
self.reason.as_deref()
}
}
impl StopInferenceExperimentInput {
/// Creates a new builder-style object to manufacture [`StopInferenceExperimentInput`](crate::operation::stop_inference_experiment::StopInferenceExperimentInput).
pub fn builder() -> crate::operation::stop_inference_experiment::builders::StopInferenceExperimentInputBuilder {
crate::operation::stop_inference_experiment::builders::StopInferenceExperimentInputBuilder::default()
}
}
/// A builder for [`StopInferenceExperimentInput`](crate::operation::stop_inference_experiment::StopInferenceExperimentInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StopInferenceExperimentInputBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) model_variant_actions: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ModelVariantAction>>,
pub(crate) desired_model_variants: ::std::option::Option<::std::vec::Vec<crate::types::ModelVariantConfig>>,
pub(crate) desired_state: ::std::option::Option<crate::types::InferenceExperimentStopDesiredState>,
pub(crate) reason: ::std::option::Option<::std::string::String>,
}
impl StopInferenceExperimentInputBuilder {
/// <p>The name of the inference experiment to stop.</p>
/// This field is required.
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 inference experiment to stop.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the inference experiment to stop.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// Adds a key-value pair to `model_variant_actions`.
///
/// To override the contents of this collection use [`set_model_variant_actions`](Self::set_model_variant_actions).
///
/// <p>Array of key-value pairs, with names of variants mapped to actions. The possible actions are the following:</p>
/// <ul>
/// <li>
/// <p><code>Promote</code> - Promote the shadow variant to a production variant</p></li>
/// <li>
/// <p><code>Remove</code> - Delete the variant</p></li>
/// <li>
/// <p><code>Retain</code> - Keep the variant as it is</p></li>
/// </ul>
pub fn model_variant_actions(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ModelVariantAction) -> Self {
let mut hash_map = self.model_variant_actions.unwrap_or_default();
hash_map.insert(k.into(), v);
self.model_variant_actions = ::std::option::Option::Some(hash_map);
self
}
/// <p>Array of key-value pairs, with names of variants mapped to actions. The possible actions are the following:</p>
/// <ul>
/// <li>
/// <p><code>Promote</code> - Promote the shadow variant to a production variant</p></li>
/// <li>
/// <p><code>Remove</code> - Delete the variant</p></li>
/// <li>
/// <p><code>Retain</code> - Keep the variant as it is</p></li>
/// </ul>
pub fn set_model_variant_actions(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ModelVariantAction>>,
) -> Self {
self.model_variant_actions = input;
self
}
/// <p>Array of key-value pairs, with names of variants mapped to actions. The possible actions are the following:</p>
/// <ul>
/// <li>
/// <p><code>Promote</code> - Promote the shadow variant to a production variant</p></li>
/// <li>
/// <p><code>Remove</code> - Delete the variant</p></li>
/// <li>
/// <p><code>Retain</code> - Keep the variant as it is</p></li>
/// </ul>
pub fn get_model_variant_actions(
&self,
) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ModelVariantAction>> {
&self.model_variant_actions
}
/// Appends an item to `desired_model_variants`.
///
/// To override the contents of this collection use [`set_desired_model_variants`](Self::set_desired_model_variants).
///
/// <p>An array of <code>ModelVariantConfig</code> objects. There is one for each variant that you want to deploy after the inference experiment stops. Each <code>ModelVariantConfig</code> describes the infrastructure configuration for deploying the corresponding variant.</p>
pub fn desired_model_variants(mut self, input: crate::types::ModelVariantConfig) -> Self {
let mut v = self.desired_model_variants.unwrap_or_default();
v.push(input);
self.desired_model_variants = ::std::option::Option::Some(v);
self
}
/// <p>An array of <code>ModelVariantConfig</code> objects. There is one for each variant that you want to deploy after the inference experiment stops. Each <code>ModelVariantConfig</code> describes the infrastructure configuration for deploying the corresponding variant.</p>
pub fn set_desired_model_variants(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ModelVariantConfig>>) -> Self {
self.desired_model_variants = input;
self
}
/// <p>An array of <code>ModelVariantConfig</code> objects. There is one for each variant that you want to deploy after the inference experiment stops. Each <code>ModelVariantConfig</code> describes the infrastructure configuration for deploying the corresponding variant.</p>
pub fn get_desired_model_variants(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModelVariantConfig>> {
&self.desired_model_variants
}
/// <p>The desired state of the experiment after stopping. The possible states are the following:</p>
/// <ul>
/// <li>
/// <p><code>Completed</code>: The experiment completed successfully</p></li>
/// <li>
/// <p><code>Cancelled</code>: The experiment was canceled</p></li>
/// </ul>
pub fn desired_state(mut self, input: crate::types::InferenceExperimentStopDesiredState) -> Self {
self.desired_state = ::std::option::Option::Some(input);
self
}
/// <p>The desired state of the experiment after stopping. The possible states are the following:</p>
/// <ul>
/// <li>
/// <p><code>Completed</code>: The experiment completed successfully</p></li>
/// <li>
/// <p><code>Cancelled</code>: The experiment was canceled</p></li>
/// </ul>
pub fn set_desired_state(mut self, input: ::std::option::Option<crate::types::InferenceExperimentStopDesiredState>) -> Self {
self.desired_state = input;
self
}
/// <p>The desired state of the experiment after stopping. The possible states are the following:</p>
/// <ul>
/// <li>
/// <p><code>Completed</code>: The experiment completed successfully</p></li>
/// <li>
/// <p><code>Cancelled</code>: The experiment was canceled</p></li>
/// </ul>
pub fn get_desired_state(&self) -> &::std::option::Option<crate::types::InferenceExperimentStopDesiredState> {
&self.desired_state
}
/// <p>The reason for stopping the experiment.</p>
pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.reason = ::std::option::Option::Some(input.into());
self
}
/// <p>The reason for stopping the experiment.</p>
pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.reason = input;
self
}
/// <p>The reason for stopping the experiment.</p>
pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
&self.reason
}
/// Consumes the builder and constructs a [`StopInferenceExperimentInput`](crate::operation::stop_inference_experiment::StopInferenceExperimentInput).
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::stop_inference_experiment::StopInferenceExperimentInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::stop_inference_experiment::StopInferenceExperimentInput {
name: self.name,
model_variant_actions: self.model_variant_actions,
desired_model_variants: self.desired_model_variants,
desired_state: self.desired_state,
reason: self.reason,
})
}
}