aws_sdk_sagemaker/operation/update_model_card/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_model_card::_update_model_card_output::UpdateModelCardOutputBuilder;
3
4pub use crate::operation::update_model_card::_update_model_card_input::UpdateModelCardInputBuilder;
5
6impl crate::operation::update_model_card::builders::UpdateModelCardInputBuilder {
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_card::UpdateModelCardOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_model_card::UpdateModelCardError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_model_card();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateModelCard`.
24///
25/// <p>Update an Amazon SageMaker Model Card.</p><important>
26/// <p>You cannot update both model card content and model card status in a single call.</p>
27/// </important>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct UpdateModelCardFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::update_model_card::builders::UpdateModelCardInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::update_model_card::UpdateModelCardOutput,
37        crate::operation::update_model_card::UpdateModelCardError,
38    > for UpdateModelCardFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::update_model_card::UpdateModelCardOutput,
46            crate::operation::update_model_card::UpdateModelCardError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl UpdateModelCardFluentBuilder {
53    /// Creates a new `UpdateModelCardFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the UpdateModelCard as a reference.
62    pub fn as_input(&self) -> &crate::operation::update_model_card::builders::UpdateModelCardInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::update_model_card::UpdateModelCardOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::update_model_card::UpdateModelCardError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::update_model_card::UpdateModelCard::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::update_model_card::UpdateModelCard::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::update_model_card::UpdateModelCardOutput,
99        crate::operation::update_model_card::UpdateModelCardError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The name or Amazon Resource Name (ARN) of the model card to update.</p>
114    pub fn model_card_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.model_card_name(input.into());
116        self
117    }
118    /// <p>The name or Amazon Resource Name (ARN) of the model card to update.</p>
119    pub fn set_model_card_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_model_card_name(input);
121        self
122    }
123    /// <p>The name or Amazon Resource Name (ARN) of the model card to update.</p>
124    pub fn get_model_card_name(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_model_card_name()
126    }
127    /// <p>The updated model card content. Content must be in <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-cards.html#model-cards-json-schema">model card JSON schema</a> and provided as a string.</p>
128    /// <p>When updating model card content, be sure to include the full content and not just updated content.</p>
129    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.content(input.into());
131        self
132    }
133    /// <p>The updated model card content. Content must be in <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-cards.html#model-cards-json-schema">model card JSON schema</a> and provided as a string.</p>
134    /// <p>When updating model card content, be sure to include the full content and not just updated content.</p>
135    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_content(input);
137        self
138    }
139    /// <p>The updated model card content. Content must be in <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/model-cards.html#model-cards-json-schema">model card JSON schema</a> and provided as a string.</p>
140    /// <p>When updating model card content, be sure to include the full content and not just updated content.</p>
141    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
142        self.inner.get_content()
143    }
144    /// <p>The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.</p>
145    /// <ul>
146    /// <li>
147    /// <p><code>Draft</code>: The model card is a work in progress.</p></li>
148    /// <li>
149    /// <p><code>PendingReview</code>: The model card is pending review.</p></li>
150    /// <li>
151    /// <p><code>Approved</code>: The model card is approved.</p></li>
152    /// <li>
153    /// <p><code>Archived</code>: The model card is archived. No more updates should be made to the model card, but it can still be exported.</p></li>
154    /// </ul>
155    pub fn model_card_status(mut self, input: crate::types::ModelCardStatus) -> Self {
156        self.inner = self.inner.model_card_status(input);
157        self
158    }
159    /// <p>The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.</p>
160    /// <ul>
161    /// <li>
162    /// <p><code>Draft</code>: The model card is a work in progress.</p></li>
163    /// <li>
164    /// <p><code>PendingReview</code>: The model card is pending review.</p></li>
165    /// <li>
166    /// <p><code>Approved</code>: The model card is approved.</p></li>
167    /// <li>
168    /// <p><code>Archived</code>: The model card is archived. No more updates should be made to the model card, but it can still be exported.</p></li>
169    /// </ul>
170    pub fn set_model_card_status(mut self, input: ::std::option::Option<crate::types::ModelCardStatus>) -> Self {
171        self.inner = self.inner.set_model_card_status(input);
172        self
173    }
174    /// <p>The approval status of the model card within your organization. Different organizations might have different criteria for model card review and approval.</p>
175    /// <ul>
176    /// <li>
177    /// <p><code>Draft</code>: The model card is a work in progress.</p></li>
178    /// <li>
179    /// <p><code>PendingReview</code>: The model card is pending review.</p></li>
180    /// <li>
181    /// <p><code>Approved</code>: The model card is approved.</p></li>
182    /// <li>
183    /// <p><code>Archived</code>: The model card is archived. No more updates should be made to the model card, but it can still be exported.</p></li>
184    /// </ul>
185    pub fn get_model_card_status(&self) -> &::std::option::Option<crate::types::ModelCardStatus> {
186        self.inner.get_model_card_status()
187    }
188}