aws_sdk_sagemaker/operation/update_endpoint/
_update_endpoint_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateEndpointInput {
6    /// <p>The name of the endpoint whose configuration you want to update.</p>
7    pub endpoint_name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the new endpoint configuration.</p>
9    pub endpoint_config_name: ::std::option::Option<::std::string::String>,
10    /// <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>
11    pub retain_all_variant_properties: ::std::option::Option<bool>,
12    /// <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>
13    pub exclude_retained_variant_properties: ::std::option::Option<::std::vec::Vec<crate::types::VariantProperty>>,
14    /// <p>The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations.</p>
15    pub deployment_config: ::std::option::Option<crate::types::DeploymentConfig>,
16    /// <p>Specifies whether to reuse the last deployment configuration. The default value is false (the configuration is not reused).</p>
17    pub retain_deployment_config: ::std::option::Option<bool>,
18}
19impl UpdateEndpointInput {
20    /// <p>The name of the endpoint whose configuration you want to update.</p>
21    pub fn endpoint_name(&self) -> ::std::option::Option<&str> {
22        self.endpoint_name.as_deref()
23    }
24    /// <p>The name of the new endpoint configuration.</p>
25    pub fn endpoint_config_name(&self) -> ::std::option::Option<&str> {
26        self.endpoint_config_name.as_deref()
27    }
28    /// <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>
29    pub fn retain_all_variant_properties(&self) -> ::std::option::Option<bool> {
30        self.retain_all_variant_properties
31    }
32    /// <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>
33    ///
34    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.exclude_retained_variant_properties.is_none()`.
35    pub fn exclude_retained_variant_properties(&self) -> &[crate::types::VariantProperty] {
36        self.exclude_retained_variant_properties.as_deref().unwrap_or_default()
37    }
38    /// <p>The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations.</p>
39    pub fn deployment_config(&self) -> ::std::option::Option<&crate::types::DeploymentConfig> {
40        self.deployment_config.as_ref()
41    }
42    /// <p>Specifies whether to reuse the last deployment configuration. The default value is false (the configuration is not reused).</p>
43    pub fn retain_deployment_config(&self) -> ::std::option::Option<bool> {
44        self.retain_deployment_config
45    }
46}
47impl UpdateEndpointInput {
48    /// Creates a new builder-style object to manufacture [`UpdateEndpointInput`](crate::operation::update_endpoint::UpdateEndpointInput).
49    pub fn builder() -> crate::operation::update_endpoint::builders::UpdateEndpointInputBuilder {
50        crate::operation::update_endpoint::builders::UpdateEndpointInputBuilder::default()
51    }
52}
53
54/// A builder for [`UpdateEndpointInput`](crate::operation::update_endpoint::UpdateEndpointInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct UpdateEndpointInputBuilder {
58    pub(crate) endpoint_name: ::std::option::Option<::std::string::String>,
59    pub(crate) endpoint_config_name: ::std::option::Option<::std::string::String>,
60    pub(crate) retain_all_variant_properties: ::std::option::Option<bool>,
61    pub(crate) exclude_retained_variant_properties: ::std::option::Option<::std::vec::Vec<crate::types::VariantProperty>>,
62    pub(crate) deployment_config: ::std::option::Option<crate::types::DeploymentConfig>,
63    pub(crate) retain_deployment_config: ::std::option::Option<bool>,
64}
65impl UpdateEndpointInputBuilder {
66    /// <p>The name of the endpoint whose configuration you want to update.</p>
67    /// This field is required.
68    pub fn endpoint_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.endpoint_name = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The name of the endpoint whose configuration you want to update.</p>
73    pub fn set_endpoint_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.endpoint_name = input;
75        self
76    }
77    /// <p>The name of the endpoint whose configuration you want to update.</p>
78    pub fn get_endpoint_name(&self) -> &::std::option::Option<::std::string::String> {
79        &self.endpoint_name
80    }
81    /// <p>The name of the new endpoint configuration.</p>
82    /// This field is required.
83    pub fn endpoint_config_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.endpoint_config_name = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The name of the new endpoint configuration.</p>
88    pub fn set_endpoint_config_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.endpoint_config_name = input;
90        self
91    }
92    /// <p>The name of the new endpoint configuration.</p>
93    pub fn get_endpoint_config_name(&self) -> &::std::option::Option<::std::string::String> {
94        &self.endpoint_config_name
95    }
96    /// <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>
97    pub fn retain_all_variant_properties(mut self, input: bool) -> Self {
98        self.retain_all_variant_properties = ::std::option::Option::Some(input);
99        self
100    }
101    /// <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>
102    pub fn set_retain_all_variant_properties(mut self, input: ::std::option::Option<bool>) -> Self {
103        self.retain_all_variant_properties = input;
104        self
105    }
106    /// <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>
107    pub fn get_retain_all_variant_properties(&self) -> &::std::option::Option<bool> {
108        &self.retain_all_variant_properties
109    }
110    /// Appends an item to `exclude_retained_variant_properties`.
111    ///
112    /// To override the contents of this collection use [`set_exclude_retained_variant_properties`](Self::set_exclude_retained_variant_properties).
113    ///
114    /// <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>
115    pub fn exclude_retained_variant_properties(mut self, input: crate::types::VariantProperty) -> Self {
116        let mut v = self.exclude_retained_variant_properties.unwrap_or_default();
117        v.push(input);
118        self.exclude_retained_variant_properties = ::std::option::Option::Some(v);
119        self
120    }
121    /// <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>
122    pub fn set_exclude_retained_variant_properties(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VariantProperty>>) -> Self {
123        self.exclude_retained_variant_properties = input;
124        self
125    }
126    /// <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>
127    pub fn get_exclude_retained_variant_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VariantProperty>> {
128        &self.exclude_retained_variant_properties
129    }
130    /// <p>The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations.</p>
131    pub fn deployment_config(mut self, input: crate::types::DeploymentConfig) -> Self {
132        self.deployment_config = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations.</p>
136    pub fn set_deployment_config(mut self, input: ::std::option::Option<crate::types::DeploymentConfig>) -> Self {
137        self.deployment_config = input;
138        self
139    }
140    /// <p>The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations.</p>
141    pub fn get_deployment_config(&self) -> &::std::option::Option<crate::types::DeploymentConfig> {
142        &self.deployment_config
143    }
144    /// <p>Specifies whether to reuse the last deployment configuration. The default value is false (the configuration is not reused).</p>
145    pub fn retain_deployment_config(mut self, input: bool) -> Self {
146        self.retain_deployment_config = ::std::option::Option::Some(input);
147        self
148    }
149    /// <p>Specifies whether to reuse the last deployment configuration. The default value is false (the configuration is not reused).</p>
150    pub fn set_retain_deployment_config(mut self, input: ::std::option::Option<bool>) -> Self {
151        self.retain_deployment_config = input;
152        self
153    }
154    /// <p>Specifies whether to reuse the last deployment configuration. The default value is false (the configuration is not reused).</p>
155    pub fn get_retain_deployment_config(&self) -> &::std::option::Option<bool> {
156        &self.retain_deployment_config
157    }
158    /// Consumes the builder and constructs a [`UpdateEndpointInput`](crate::operation::update_endpoint::UpdateEndpointInput).
159    pub fn build(
160        self,
161    ) -> ::std::result::Result<crate::operation::update_endpoint::UpdateEndpointInput, ::aws_smithy_types::error::operation::BuildError> {
162        ::std::result::Result::Ok(crate::operation::update_endpoint::UpdateEndpointInput {
163            endpoint_name: self.endpoint_name,
164            endpoint_config_name: self.endpoint_config_name,
165            retain_all_variant_properties: self.retain_all_variant_properties,
166            exclude_retained_variant_properties: self.exclude_retained_variant_properties,
167            deployment_config: self.deployment_config,
168            retain_deployment_config: self.retain_deployment_config,
169        })
170    }
171}