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>The package registration type of the model package input.</p>
140    pub fn model_package_registration_type(mut self, input: crate::types::ModelPackageRegistrationType) -> Self {
141        self.inner = self.inner.model_package_registration_type(input);
142        self
143    }
144    /// <p>The package registration type of the model package input.</p>
145    pub fn set_model_package_registration_type(mut self, input: ::std::option::Option<crate::types::ModelPackageRegistrationType>) -> Self {
146        self.inner = self.inner.set_model_package_registration_type(input);
147        self
148    }
149    /// <p>The package registration type of the model package input.</p>
150    pub fn get_model_package_registration_type(&self) -> &::std::option::Option<crate::types::ModelPackageRegistrationType> {
151        self.inner.get_model_package_registration_type()
152    }
153    /// <p>A description for the approval status of the model.</p>
154    pub fn approval_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.approval_description(input.into());
156        self
157    }
158    /// <p>A description for the approval status of the model.</p>
159    pub fn set_approval_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_approval_description(input);
161        self
162    }
163    /// <p>A description for the approval status of the model.</p>
164    pub fn get_approval_description(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_approval_description()
166    }
167    ///
168    /// Adds a key-value pair to `CustomerMetadataProperties`.
169    ///
170    /// To override the contents of this collection use [`set_customer_metadata_properties`](Self::set_customer_metadata_properties).
171    ///
172    /// <p>The metadata properties associated with the model package versions.</p>
173    pub fn customer_metadata_properties(
174        mut self,
175        k: impl ::std::convert::Into<::std::string::String>,
176        v: impl ::std::convert::Into<::std::string::String>,
177    ) -> Self {
178        self.inner = self.inner.customer_metadata_properties(k.into(), v.into());
179        self
180    }
181    /// <p>The metadata properties associated with the model package versions.</p>
182    pub fn set_customer_metadata_properties(
183        mut self,
184        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
185    ) -> Self {
186        self.inner = self.inner.set_customer_metadata_properties(input);
187        self
188    }
189    /// <p>The metadata properties associated with the model package versions.</p>
190    pub fn get_customer_metadata_properties(
191        &self,
192    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
193        self.inner.get_customer_metadata_properties()
194    }
195    ///
196    /// Appends an item to `CustomerMetadataPropertiesToRemove`.
197    ///
198    /// To override the contents of this collection use [`set_customer_metadata_properties_to_remove`](Self::set_customer_metadata_properties_to_remove).
199    ///
200    /// <p>The metadata properties associated with the model package versions to remove.</p>
201    pub fn customer_metadata_properties_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.inner = self.inner.customer_metadata_properties_to_remove(input.into());
203        self
204    }
205    /// <p>The metadata properties associated with the model package versions to remove.</p>
206    pub fn set_customer_metadata_properties_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
207        self.inner = self.inner.set_customer_metadata_properties_to_remove(input);
208        self
209    }
210    /// <p>The metadata properties associated with the model package versions to remove.</p>
211    pub fn get_customer_metadata_properties_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
212        self.inner.get_customer_metadata_properties_to_remove()
213    }
214    ///
215    /// Appends an item to `AdditionalInferenceSpecificationsToAdd`.
216    ///
217    /// To override the contents of this collection use [`set_additional_inference_specifications_to_add`](Self::set_additional_inference_specifications_to_add).
218    ///
219    /// <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>
220    pub fn additional_inference_specifications_to_add(mut self, input: crate::types::AdditionalInferenceSpecificationDefinition) -> Self {
221        self.inner = self.inner.additional_inference_specifications_to_add(input);
222        self
223    }
224    /// <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>
225    pub fn set_additional_inference_specifications_to_add(
226        mut self,
227        input: ::std::option::Option<::std::vec::Vec<crate::types::AdditionalInferenceSpecificationDefinition>>,
228    ) -> Self {
229        self.inner = self.inner.set_additional_inference_specifications_to_add(input);
230        self
231    }
232    /// <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>
233    pub fn get_additional_inference_specifications_to_add(
234        &self,
235    ) -> &::std::option::Option<::std::vec::Vec<crate::types::AdditionalInferenceSpecificationDefinition>> {
236        self.inner.get_additional_inference_specifications_to_add()
237    }
238    /// <p>Specifies details about inference jobs that you can run with models based on this model package, including the following information:</p>
239    /// <ul>
240    /// <li>
241    /// <p>The Amazon ECR paths of containers that contain the inference code and model artifacts.</p></li>
242    /// <li>
243    /// <p>The instance types that the model package supports for transform jobs and real-time endpoints used for inference.</p></li>
244    /// <li>
245    /// <p>The input and output content formats that the model package supports for inference.</p></li>
246    /// </ul>
247    pub fn inference_specification(mut self, input: crate::types::InferenceSpecification) -> Self {
248        self.inner = self.inner.inference_specification(input);
249        self
250    }
251    /// <p>Specifies details about inference jobs that you can run with models based on this model package, including the following information:</p>
252    /// <ul>
253    /// <li>
254    /// <p>The Amazon ECR paths of containers that contain the inference code and model artifacts.</p></li>
255    /// <li>
256    /// <p>The instance types that the model package supports for transform jobs and real-time endpoints used for inference.</p></li>
257    /// <li>
258    /// <p>The input and output content formats that the model package supports for inference.</p></li>
259    /// </ul>
260    pub fn set_inference_specification(mut self, input: ::std::option::Option<crate::types::InferenceSpecification>) -> Self {
261        self.inner = self.inner.set_inference_specification(input);
262        self
263    }
264    /// <p>Specifies details about inference jobs that you can run with models based on this model package, including the following information:</p>
265    /// <ul>
266    /// <li>
267    /// <p>The Amazon ECR paths of containers that contain the inference code and model artifacts.</p></li>
268    /// <li>
269    /// <p>The instance types that the model package supports for transform jobs and real-time endpoints used for inference.</p></li>
270    /// <li>
271    /// <p>The input and output content formats that the model package supports for inference.</p></li>
272    /// </ul>
273    pub fn get_inference_specification(&self) -> &::std::option::Option<crate::types::InferenceSpecification> {
274        self.inner.get_inference_specification()
275    }
276    /// <p>The URI of the source for the model package.</p>
277    pub fn source_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
278        self.inner = self.inner.source_uri(input.into());
279        self
280    }
281    /// <p>The URI of the source for the model package.</p>
282    pub fn set_source_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
283        self.inner = self.inner.set_source_uri(input);
284        self
285    }
286    /// <p>The URI of the source for the model package.</p>
287    pub fn get_source_uri(&self) -> &::std::option::Option<::std::string::String> {
288        self.inner.get_source_uri()
289    }
290    /// <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>
291    pub fn model_card(mut self, input: crate::types::ModelPackageModelCard) -> Self {
292        self.inner = self.inner.model_card(input);
293        self
294    }
295    /// <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>
296    pub fn set_model_card(mut self, input: ::std::option::Option<crate::types::ModelPackageModelCard>) -> Self {
297        self.inner = self.inner.set_model_card(input);
298        self
299    }
300    /// <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>
301    pub fn get_model_card(&self) -> &::std::option::Option<crate::types::ModelPackageModelCard> {
302        self.inner.get_model_card()
303    }
304    /// <p>A structure describing the current state of the model in its life cycle.</p>
305    pub fn model_life_cycle(mut self, input: crate::types::ModelLifeCycle) -> Self {
306        self.inner = self.inner.model_life_cycle(input);
307        self
308    }
309    /// <p>A structure describing the current state of the model in its life cycle.</p>
310    pub fn set_model_life_cycle(mut self, input: ::std::option::Option<crate::types::ModelLifeCycle>) -> Self {
311        self.inner = self.inner.set_model_life_cycle(input);
312        self
313    }
314    /// <p>A structure describing the current state of the model in its life cycle.</p>
315    pub fn get_model_life_cycle(&self) -> &::std::option::Option<crate::types::ModelLifeCycle> {
316        self.inner.get_model_life_cycle()
317    }
318    /// <p>A unique token that guarantees that the call to this API is idempotent.</p>
319    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
320        self.inner = self.inner.client_token(input.into());
321        self
322    }
323    /// <p>A unique token that guarantees that the call to this API is idempotent.</p>
324    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
325        self.inner = self.inner.set_client_token(input);
326        self
327    }
328    /// <p>A unique token that guarantees that the call to this API is idempotent.</p>
329    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
330        self.inner.get_client_token()
331    }
332}