aws_sdk_sagemaker/operation/update_endpoint/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_endpoint::_update_endpoint_output::UpdateEndpointOutputBuilder;
3
4pub use crate::operation::update_endpoint::_update_endpoint_input::UpdateEndpointInputBuilder;
5
6impl crate::operation::update_endpoint::builders::UpdateEndpointInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::update_endpoint::UpdateEndpointOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_endpoint::UpdateEndpointError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_endpoint();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateEndpoint`.
24///
25/// <p>Deploys the <code>EndpointConfig</code> specified in the request to a new fleet of instances. SageMaker shifts endpoint traffic to the new instances with the updated endpoint configuration and then deletes the old instances using the previous <code>EndpointConfig</code> (there is no availability loss). For more information about how to control the update and traffic shifting process, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/deployment-guardrails.html"> Update models in production</a>.</p>
26/// <p>When SageMaker receives the request, it sets the endpoint status to <code>Updating</code>. After updating the endpoint, it sets the status to <code>InService</code>. To check the status of an endpoint, use the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeEndpoint.html">DescribeEndpoint</a> API.</p><note>
27/// <p>You must not delete an <code>EndpointConfig</code> in use by an endpoint that is live or while the <code>UpdateEndpoint</code> or <code>CreateEndpoint</code> operations are being performed on the endpoint. To update an endpoint, you must create a new <code>EndpointConfig</code>.</p>
28/// <p>If you delete the <code>EndpointConfig</code> of an endpoint that is active or being created or updated you may lose visibility into the instance type the endpoint is using. The endpoint must be deleted in order to stop incurring charges.</p>
29/// </note>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct UpdateEndpointFluentBuilder {
32 handle: ::std::sync::Arc<crate::client::Handle>,
33 inner: crate::operation::update_endpoint::builders::UpdateEndpointInputBuilder,
34 config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37 crate::client::customize::internal::CustomizableSend<
38 crate::operation::update_endpoint::UpdateEndpointOutput,
39 crate::operation::update_endpoint::UpdateEndpointError,
40 > for UpdateEndpointFluentBuilder
41{
42 fn send(
43 self,
44 config_override: crate::config::Builder,
45 ) -> crate::client::customize::internal::BoxFuture<
46 crate::client::customize::internal::SendResult<
47 crate::operation::update_endpoint::UpdateEndpointOutput,
48 crate::operation::update_endpoint::UpdateEndpointError,
49 >,
50 > {
51 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52 }
53}
54impl UpdateEndpointFluentBuilder {
55 /// Creates a new `UpdateEndpointFluentBuilder`.
56 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57 Self {
58 handle,
59 inner: ::std::default::Default::default(),
60 config_override: ::std::option::Option::None,
61 }
62 }
63 /// Access the UpdateEndpoint as a reference.
64 pub fn as_input(&self) -> &crate::operation::update_endpoint::builders::UpdateEndpointInputBuilder {
65 &self.inner
66 }
67 /// Sends the request and returns the response.
68 ///
69 /// If an error occurs, an `SdkError` will be returned with additional details that
70 /// can be matched against.
71 ///
72 /// By default, any retryable failures will be retried twice. Retry behavior
73 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74 /// set when configuring the client.
75 pub async fn send(
76 self,
77 ) -> ::std::result::Result<
78 crate::operation::update_endpoint::UpdateEndpointOutput,
79 ::aws_smithy_runtime_api::client::result::SdkError<
80 crate::operation::update_endpoint::UpdateEndpointError,
81 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82 >,
83 > {
84 let input = self
85 .inner
86 .build()
87 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88 let runtime_plugins = crate::operation::update_endpoint::UpdateEndpoint::operation_runtime_plugins(
89 self.handle.runtime_plugins.clone(),
90 &self.handle.conf,
91 self.config_override,
92 );
93 crate::operation::update_endpoint::UpdateEndpoint::orchestrate(&runtime_plugins, input).await
94 }
95
96 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97 pub fn customize(
98 self,
99 ) -> crate::client::customize::CustomizableOperation<
100 crate::operation::update_endpoint::UpdateEndpointOutput,
101 crate::operation::update_endpoint::UpdateEndpointError,
102 Self,
103 > {
104 crate::client::customize::CustomizableOperation::new(self)
105 }
106 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107 self.set_config_override(::std::option::Option::Some(config_override.into()));
108 self
109 }
110
111 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112 self.config_override = config_override;
113 self
114 }
115 /// <p>The name of the endpoint whose configuration you want to update.</p>
116 pub fn endpoint_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117 self.inner = self.inner.endpoint_name(input.into());
118 self
119 }
120 /// <p>The name of the endpoint whose configuration you want to update.</p>
121 pub fn set_endpoint_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.inner = self.inner.set_endpoint_name(input);
123 self
124 }
125 /// <p>The name of the endpoint whose configuration you want to update.</p>
126 pub fn get_endpoint_name(&self) -> &::std::option::Option<::std::string::String> {
127 self.inner.get_endpoint_name()
128 }
129 /// <p>The name of the new endpoint configuration.</p>
130 pub fn endpoint_config_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.inner = self.inner.endpoint_config_name(input.into());
132 self
133 }
134 /// <p>The name of the new endpoint configuration.</p>
135 pub fn set_endpoint_config_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.inner = self.inner.set_endpoint_config_name(input);
137 self
138 }
139 /// <p>The name of the new endpoint configuration.</p>
140 pub fn get_endpoint_config_name(&self) -> &::std::option::Option<::std::string::String> {
141 self.inner.get_endpoint_config_name()
142 }
143 /// <p>When updating endpoint resources, enables or disables the retention of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VariantProperty.html">variant properties</a>, such as the instance count or the variant weight. To retain the variant properties of an endpoint when updating it, set <code>RetainAllVariantProperties</code> to <code>true</code>. To use the variant properties specified in a new <code>EndpointConfig</code> call when updating an endpoint, set <code>RetainAllVariantProperties</code> to <code>false</code>. The default is <code>false</code>.</p>
144 pub fn retain_all_variant_properties(mut self, input: bool) -> Self {
145 self.inner = self.inner.retain_all_variant_properties(input);
146 self
147 }
148 /// <p>When updating endpoint resources, enables or disables the retention of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VariantProperty.html">variant properties</a>, such as the instance count or the variant weight. To retain the variant properties of an endpoint when updating it, set <code>RetainAllVariantProperties</code> to <code>true</code>. To use the variant properties specified in a new <code>EndpointConfig</code> call when updating an endpoint, set <code>RetainAllVariantProperties</code> to <code>false</code>. The default is <code>false</code>.</p>
149 pub fn set_retain_all_variant_properties(mut self, input: ::std::option::Option<bool>) -> Self {
150 self.inner = self.inner.set_retain_all_variant_properties(input);
151 self
152 }
153 /// <p>When updating endpoint resources, enables or disables the retention of <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VariantProperty.html">variant properties</a>, such as the instance count or the variant weight. To retain the variant properties of an endpoint when updating it, set <code>RetainAllVariantProperties</code> to <code>true</code>. To use the variant properties specified in a new <code>EndpointConfig</code> call when updating an endpoint, set <code>RetainAllVariantProperties</code> to <code>false</code>. The default is <code>false</code>.</p>
154 pub fn get_retain_all_variant_properties(&self) -> &::std::option::Option<bool> {
155 self.inner.get_retain_all_variant_properties()
156 }
157 ///
158 /// Appends an item to `ExcludeRetainedVariantProperties`.
159 ///
160 /// To override the contents of this collection use [`set_exclude_retained_variant_properties`](Self::set_exclude_retained_variant_properties).
161 ///
162 /// <p>When you are updating endpoint resources with <code>RetainAllVariantProperties</code>, whose value is set to <code>true</code>, <code>ExcludeRetainedVariantProperties</code> specifies the list of type <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VariantProperty.html">VariantProperty</a> to override with the values provided by <code>EndpointConfig</code>. If you don't specify a value for <code>ExcludeRetainedVariantProperties</code>, no variant properties are overridden.</p>
163 pub fn exclude_retained_variant_properties(mut self, input: crate::types::VariantProperty) -> Self {
164 self.inner = self.inner.exclude_retained_variant_properties(input);
165 self
166 }
167 /// <p>When you are updating endpoint resources with <code>RetainAllVariantProperties</code>, whose value is set to <code>true</code>, <code>ExcludeRetainedVariantProperties</code> specifies the list of type <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VariantProperty.html">VariantProperty</a> to override with the values provided by <code>EndpointConfig</code>. If you don't specify a value for <code>ExcludeRetainedVariantProperties</code>, no variant properties are overridden.</p>
168 pub fn set_exclude_retained_variant_properties(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VariantProperty>>) -> Self {
169 self.inner = self.inner.set_exclude_retained_variant_properties(input);
170 self
171 }
172 /// <p>When you are updating endpoint resources with <code>RetainAllVariantProperties</code>, whose value is set to <code>true</code>, <code>ExcludeRetainedVariantProperties</code> specifies the list of type <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_VariantProperty.html">VariantProperty</a> to override with the values provided by <code>EndpointConfig</code>. If you don't specify a value for <code>ExcludeRetainedVariantProperties</code>, no variant properties are overridden.</p>
173 pub fn get_exclude_retained_variant_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VariantProperty>> {
174 self.inner.get_exclude_retained_variant_properties()
175 }
176 /// <p>The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations.</p>
177 pub fn deployment_config(mut self, input: crate::types::DeploymentConfig) -> Self {
178 self.inner = self.inner.deployment_config(input);
179 self
180 }
181 /// <p>The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations.</p>
182 pub fn set_deployment_config(mut self, input: ::std::option::Option<crate::types::DeploymentConfig>) -> Self {
183 self.inner = self.inner.set_deployment_config(input);
184 self
185 }
186 /// <p>The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations.</p>
187 pub fn get_deployment_config(&self) -> &::std::option::Option<crate::types::DeploymentConfig> {
188 self.inner.get_deployment_config()
189 }
190 /// <p>Specifies whether to reuse the last deployment configuration. The default value is false (the configuration is not reused).</p>
191 pub fn retain_deployment_config(mut self, input: bool) -> Self {
192 self.inner = self.inner.retain_deployment_config(input);
193 self
194 }
195 /// <p>Specifies whether to reuse the last deployment configuration. The default value is false (the configuration is not reused).</p>
196 pub fn set_retain_deployment_config(mut self, input: ::std::option::Option<bool>) -> Self {
197 self.inner = self.inner.set_retain_deployment_config(input);
198 self
199 }
200 /// <p>Specifies whether to reuse the last deployment configuration. The default value is false (the configuration is not reused).</p>
201 pub fn get_retain_deployment_config(&self) -> &::std::option::Option<bool> {
202 self.inner.get_retain_deployment_config()
203 }
204}