aws_sdk_sagemaker/operation/update_model_package/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_model_package::_update_model_package_output::UpdateModelPackageOutputBuilder;
3
4pub use crate::operation::update_model_package::_update_model_package_input::UpdateModelPackageInputBuilder;
5
6impl crate::operation::update_model_package::builders::UpdateModelPackageInputBuilder {
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_model_package::UpdateModelPackageOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_model_package::UpdateModelPackageError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_model_package();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateModelPackage`.
24///
25/// <p>Updates a versioned model.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateModelPackageFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_model_package::builders::UpdateModelPackageInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_model_package::UpdateModelPackageOutput,
35        crate::operation::update_model_package::UpdateModelPackageError,
36    > for UpdateModelPackageFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_model_package::UpdateModelPackageOutput,
44            crate::operation::update_model_package::UpdateModelPackageError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateModelPackageFluentBuilder {
51    /// Creates a new `UpdateModelPackageFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdateModelPackage as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_model_package::builders::UpdateModelPackageInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_model_package::UpdateModelPackageOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_model_package::UpdateModelPackageError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_model_package::UpdateModelPackage::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_model_package::UpdateModelPackage::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_model_package::UpdateModelPackageOutput,
97        crate::operation::update_model_package::UpdateModelPackageError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The Amazon Resource Name (ARN) of the model package.</p>
112    pub fn model_package_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.model_package_arn(input.into());
114        self
115    }
116    /// <p>The Amazon Resource Name (ARN) of the model package.</p>
117    pub fn set_model_package_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_model_package_arn(input);
119        self
120    }
121    /// <p>The Amazon Resource Name (ARN) of the model package.</p>
122    pub fn get_model_package_arn(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_model_package_arn()
124    }
125    /// <p>The approval status of the model.</p>
126    pub fn model_approval_status(mut self, input: crate::types::ModelApprovalStatus) -> Self {
127        self.inner = self.inner.model_approval_status(input);
128        self
129    }
130    /// <p>The approval status of the model.</p>
131    pub fn set_model_approval_status(mut self, input: ::std::option::Option<crate::types::ModelApprovalStatus>) -> Self {
132        self.inner = self.inner.set_model_approval_status(input);
133        self
134    }
135    /// <p>The approval status of the model.</p>
136    pub fn get_model_approval_status(&self) -> &::std::option::Option<crate::types::ModelApprovalStatus> {
137        self.inner.get_model_approval_status()
138    }
139    /// <p>A description for the approval status of the model.</p>
140    pub fn approval_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.approval_description(input.into());
142        self
143    }
144    /// <p>A description for the approval status of the model.</p>
145    pub fn set_approval_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_approval_description(input);
147        self
148    }
149    /// <p>A description for the approval status of the model.</p>
150    pub fn get_approval_description(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_approval_description()
152    }
153    ///
154    /// Adds a key-value pair to `CustomerMetadataProperties`.
155    ///
156    /// To override the contents of this collection use [`set_customer_metadata_properties`](Self::set_customer_metadata_properties).
157    ///
158    /// <p>The metadata properties associated with the model package versions.</p>
159    pub fn customer_metadata_properties(
160        mut self,
161        k: impl ::std::convert::Into<::std::string::String>,
162        v: impl ::std::convert::Into<::std::string::String>,
163    ) -> Self {
164        self.inner = self.inner.customer_metadata_properties(k.into(), v.into());
165        self
166    }
167    /// <p>The metadata properties associated with the model package versions.</p>
168    pub fn set_customer_metadata_properties(
169        mut self,
170        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
171    ) -> Self {
172        self.inner = self.inner.set_customer_metadata_properties(input);
173        self
174    }
175    /// <p>The metadata properties associated with the model package versions.</p>
176    pub fn get_customer_metadata_properties(
177        &self,
178    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
179        self.inner.get_customer_metadata_properties()
180    }
181    ///
182    /// Appends an item to `CustomerMetadataPropertiesToRemove`.
183    ///
184    /// To override the contents of this collection use [`set_customer_metadata_properties_to_remove`](Self::set_customer_metadata_properties_to_remove).
185    ///
186    /// <p>The metadata properties associated with the model package versions to remove.</p>
187    pub fn customer_metadata_properties_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.inner = self.inner.customer_metadata_properties_to_remove(input.into());
189        self
190    }
191    /// <p>The metadata properties associated with the model package versions to remove.</p>
192    pub fn set_customer_metadata_properties_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
193        self.inner = self.inner.set_customer_metadata_properties_to_remove(input);
194        self
195    }
196    /// <p>The metadata properties associated with the model package versions to remove.</p>
197    pub fn get_customer_metadata_properties_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
198        self.inner.get_customer_metadata_properties_to_remove()
199    }
200    ///
201    /// Appends an item to `AdditionalInferenceSpecificationsToAdd`.
202    ///
203    /// To override the contents of this collection use [`set_additional_inference_specifications_to_add`](Self::set_additional_inference_specifications_to_add).
204    ///
205    /// <p>An array of additional Inference Specification objects to be added to the existing array additional Inference Specification. Total number of additional Inference Specifications can not exceed 15. Each additional Inference Specification specifies artifacts based on this model package that can be used on inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts.</p>
206    pub fn additional_inference_specifications_to_add(mut self, input: crate::types::AdditionalInferenceSpecificationDefinition) -> Self {
207        self.inner = self.inner.additional_inference_specifications_to_add(input);
208        self
209    }
210    /// <p>An array of additional Inference Specification objects to be added to the existing array additional Inference Specification. Total number of additional Inference Specifications can not exceed 15. Each additional Inference Specification specifies artifacts based on this model package that can be used on inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts.</p>
211    pub fn set_additional_inference_specifications_to_add(
212        mut self,
213        input: ::std::option::Option<::std::vec::Vec<crate::types::AdditionalInferenceSpecificationDefinition>>,
214    ) -> Self {
215        self.inner = self.inner.set_additional_inference_specifications_to_add(input);
216        self
217    }
218    /// <p>An array of additional Inference Specification objects to be added to the existing array additional Inference Specification. Total number of additional Inference Specifications can not exceed 15. Each additional Inference Specification specifies artifacts based on this model package that can be used on inference endpoints. Generally used with SageMaker Neo to store the compiled artifacts.</p>
219    pub fn get_additional_inference_specifications_to_add(
220        &self,
221    ) -> &::std::option::Option<::std::vec::Vec<crate::types::AdditionalInferenceSpecificationDefinition>> {
222        self.inner.get_additional_inference_specifications_to_add()
223    }
224    /// <p>Specifies details about inference jobs that you can run with models based on this model package, including the following information:</p>
225    /// <ul>
226    /// <li>
227    /// <p>The Amazon ECR paths of containers that contain the inference code and model artifacts.</p></li>
228    /// <li>
229    /// <p>The instance types that the model package supports for transform jobs and real-time endpoints used for inference.</p></li>
230    /// <li>
231    /// <p>The input and output content formats that the model package supports for inference.</p></li>
232    /// </ul>
233    pub fn inference_specification(mut self, input: crate::types::InferenceSpecification) -> Self {
234        self.inner = self.inner.inference_specification(input);
235        self
236    }
237    /// <p>Specifies details about inference jobs that you can run with models based on this model package, including the following information:</p>
238    /// <ul>
239    /// <li>
240    /// <p>The Amazon ECR paths of containers that contain the inference code and model artifacts.</p></li>
241    /// <li>
242    /// <p>The instance types that the model package supports for transform jobs and real-time endpoints used for inference.</p></li>
243    /// <li>
244    /// <p>The input and output content formats that the model package supports for inference.</p></li>
245    /// </ul>
246    pub fn set_inference_specification(mut self, input: ::std::option::Option<crate::types::InferenceSpecification>) -> Self {
247        self.inner = self.inner.set_inference_specification(input);
248        self
249    }
250    /// <p>Specifies details about inference jobs that you can run with models based on this model package, including the following information:</p>
251    /// <ul>
252    /// <li>
253    /// <p>The Amazon ECR paths of containers that contain the inference code and model artifacts.</p></li>
254    /// <li>
255    /// <p>The instance types that the model package supports for transform jobs and real-time endpoints used for inference.</p></li>
256    /// <li>
257    /// <p>The input and output content formats that the model package supports for inference.</p></li>
258    /// </ul>
259    pub fn get_inference_specification(&self) -> &::std::option::Option<crate::types::InferenceSpecification> {
260        self.inner.get_inference_specification()
261    }
262    /// <p>The URI of the source for the model package.</p>
263    pub fn source_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
264        self.inner = self.inner.source_uri(input.into());
265        self
266    }
267    /// <p>The URI of the source for the model package.</p>
268    pub fn set_source_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
269        self.inner = self.inner.set_source_uri(input);
270        self
271    }
272    /// <p>The URI of the source for the model package.</p>
273    pub fn get_source_uri(&self) -> &::std::option::Option<::std::string::String> {
274        self.inner.get_source_uri()
275    }
276    /// <p>The model card associated with the model package. Since <code>ModelPackageModelCard</code> is tied to a model package, it is a specific usage of a model card and its schema is simplified compared to the schema of <code>ModelCard</code>. The <code>ModelPackageModelCard</code> schema does not include <code>model_package_details</code>, and <code>model_overview</code> is composed of the <code>model_creator</code> and <code>model_artifact</code> properties. For more information about the model package model card schema, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html#model-card-schema">Model package model card schema</a>. For more information about the model card associated with the model package, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html">View the Details of a Model Version</a>.</p>
277    pub fn model_card(mut self, input: crate::types::ModelPackageModelCard) -> Self {
278        self.inner = self.inner.model_card(input);
279        self
280    }
281    /// <p>The model card associated with the model package. Since <code>ModelPackageModelCard</code> is tied to a model package, it is a specific usage of a model card and its schema is simplified compared to the schema of <code>ModelCard</code>. The <code>ModelPackageModelCard</code> schema does not include <code>model_package_details</code>, and <code>model_overview</code> is composed of the <code>model_creator</code> and <code>model_artifact</code> properties. For more information about the model package model card schema, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html#model-card-schema">Model package model card schema</a>. For more information about the model card associated with the model package, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html">View the Details of a Model Version</a>.</p>
282    pub fn set_model_card(mut self, input: ::std::option::Option<crate::types::ModelPackageModelCard>) -> Self {
283        self.inner = self.inner.set_model_card(input);
284        self
285    }
286    /// <p>The model card associated with the model package. Since <code>ModelPackageModelCard</code> is tied to a model package, it is a specific usage of a model card and its schema is simplified compared to the schema of <code>ModelCard</code>. The <code>ModelPackageModelCard</code> schema does not include <code>model_package_details</code>, and <code>model_overview</code> is composed of the <code>model_creator</code> and <code>model_artifact</code> properties. For more information about the model package model card schema, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html#model-card-schema">Model package model card schema</a>. For more information about the model card associated with the model package, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-details.html">View the Details of a Model Version</a>.</p>
287    pub fn get_model_card(&self) -> &::std::option::Option<crate::types::ModelPackageModelCard> {
288        self.inner.get_model_card()
289    }
290    /// <p>A structure describing the current state of the model in its life cycle.</p>
291    pub fn model_life_cycle(mut self, input: crate::types::ModelLifeCycle) -> Self {
292        self.inner = self.inner.model_life_cycle(input);
293        self
294    }
295    /// <p>A structure describing the current state of the model in its life cycle.</p>
296    pub fn set_model_life_cycle(mut self, input: ::std::option::Option<crate::types::ModelLifeCycle>) -> Self {
297        self.inner = self.inner.set_model_life_cycle(input);
298        self
299    }
300    /// <p>A structure describing the current state of the model in its life cycle.</p>
301    pub fn get_model_life_cycle(&self) -> &::std::option::Option<crate::types::ModelLifeCycle> {
302        self.inner.get_model_life_cycle()
303    }
304    /// <p>A unique token that guarantees that the call to this API is idempotent.</p>
305    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
306        self.inner = self.inner.client_token(input.into());
307        self
308    }
309    /// <p>A unique token that guarantees that the call to this API is idempotent.</p>
310    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
311        self.inner = self.inner.set_client_token(input);
312        self
313    }
314    /// <p>A unique token that guarantees that the call to this API is idempotent.</p>
315    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
316        self.inner.get_client_token()
317    }
318}