aws_sdk_sagemaker/operation/update_hub_content/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_hub_content::_update_hub_content_output::UpdateHubContentOutputBuilder;
3
4pub use crate::operation::update_hub_content::_update_hub_content_input::UpdateHubContentInputBuilder;
5
6impl crate::operation::update_hub_content::builders::UpdateHubContentInputBuilder {
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_hub_content::UpdateHubContentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_hub_content::UpdateHubContentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_hub_content();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateHubContent`.
24///
25/// <p>Updates SageMaker hub content (either a <code>Model</code> or <code>Notebook</code> resource).</p>
26/// <p>You can update the metadata that describes the resource. In addition to the required request fields, specify at least one of the following fields to update:</p>
27/// <ul>
28/// <li>
29/// <p><code>HubContentDescription</code></p></li>
30/// <li>
31/// <p><code>HubContentDisplayName</code></p></li>
32/// <li>
33/// <p><code>HubContentMarkdown</code></p></li>
34/// <li>
35/// <p><code>HubContentSearchKeywords</code></p></li>
36/// <li>
37/// <p><code>SupportStatus</code></p></li>
38/// </ul>
39/// <p>For more information about hubs, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/jumpstart-curated-hubs.html">Private curated hubs for foundation model access control in JumpStart</a>.</p><note>
40/// <p>If you want to update a <code>ModelReference</code> resource in your hub, use the <code>UpdateHubContentResource</code> API instead.</p>
41/// </note>
42#[derive(::std::clone::Clone, ::std::fmt::Debug)]
43pub struct UpdateHubContentFluentBuilder {
44    handle: ::std::sync::Arc<crate::client::Handle>,
45    inner: crate::operation::update_hub_content::builders::UpdateHubContentInputBuilder,
46    config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49    crate::client::customize::internal::CustomizableSend<
50        crate::operation::update_hub_content::UpdateHubContentOutput,
51        crate::operation::update_hub_content::UpdateHubContentError,
52    > for UpdateHubContentFluentBuilder
53{
54    fn send(
55        self,
56        config_override: crate::config::Builder,
57    ) -> crate::client::customize::internal::BoxFuture<
58        crate::client::customize::internal::SendResult<
59            crate::operation::update_hub_content::UpdateHubContentOutput,
60            crate::operation::update_hub_content::UpdateHubContentError,
61        >,
62    > {
63        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64    }
65}
66impl UpdateHubContentFluentBuilder {
67    /// Creates a new `UpdateHubContentFluentBuilder`.
68    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
69        Self {
70            handle,
71            inner: ::std::default::Default::default(),
72            config_override: ::std::option::Option::None,
73        }
74    }
75    /// Access the UpdateHubContent as a reference.
76    pub fn as_input(&self) -> &crate::operation::update_hub_content::builders::UpdateHubContentInputBuilder {
77        &self.inner
78    }
79    /// Sends the request and returns the response.
80    ///
81    /// If an error occurs, an `SdkError` will be returned with additional details that
82    /// can be matched against.
83    ///
84    /// By default, any retryable failures will be retried twice. Retry behavior
85    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
86    /// set when configuring the client.
87    pub async fn send(
88        self,
89    ) -> ::std::result::Result<
90        crate::operation::update_hub_content::UpdateHubContentOutput,
91        ::aws_smithy_runtime_api::client::result::SdkError<
92            crate::operation::update_hub_content::UpdateHubContentError,
93            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
94        >,
95    > {
96        let input = self
97            .inner
98            .build()
99            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
100        let runtime_plugins = crate::operation::update_hub_content::UpdateHubContent::operation_runtime_plugins(
101            self.handle.runtime_plugins.clone(),
102            &self.handle.conf,
103            self.config_override,
104        );
105        crate::operation::update_hub_content::UpdateHubContent::orchestrate(&runtime_plugins, input).await
106    }
107
108    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
109    pub fn customize(
110        self,
111    ) -> crate::client::customize::CustomizableOperation<
112        crate::operation::update_hub_content::UpdateHubContentOutput,
113        crate::operation::update_hub_content::UpdateHubContentError,
114        Self,
115    > {
116        crate::client::customize::CustomizableOperation::new(self)
117    }
118    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
119        self.set_config_override(::std::option::Option::Some(config_override.into()));
120        self
121    }
122
123    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
124        self.config_override = config_override;
125        self
126    }
127    /// <p>The name of the SageMaker hub that contains the hub content you want to update. You can optionally use the hub ARN instead.</p>
128    pub fn hub_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.hub_name(input.into());
130        self
131    }
132    /// <p>The name of the SageMaker hub that contains the hub content you want to update. You can optionally use the hub ARN instead.</p>
133    pub fn set_hub_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_hub_name(input);
135        self
136    }
137    /// <p>The name of the SageMaker hub that contains the hub content you want to update. You can optionally use the hub ARN instead.</p>
138    pub fn get_hub_name(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_hub_name()
140    }
141    /// <p>The name of the hub content resource that you want to update.</p>
142    pub fn hub_content_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.hub_content_name(input.into());
144        self
145    }
146    /// <p>The name of the hub content resource that you want to update.</p>
147    pub fn set_hub_content_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_hub_content_name(input);
149        self
150    }
151    /// <p>The name of the hub content resource that you want to update.</p>
152    pub fn get_hub_content_name(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_hub_content_name()
154    }
155    /// <p>The content type of the resource that you want to update. Only specify a <code>Model</code> or <code>Notebook</code> resource for this API. To update a <code>ModelReference</code>, use the <code>UpdateHubContentReference</code> API instead.</p>
156    pub fn hub_content_type(mut self, input: crate::types::HubContentType) -> Self {
157        self.inner = self.inner.hub_content_type(input);
158        self
159    }
160    /// <p>The content type of the resource that you want to update. Only specify a <code>Model</code> or <code>Notebook</code> resource for this API. To update a <code>ModelReference</code>, use the <code>UpdateHubContentReference</code> API instead.</p>
161    pub fn set_hub_content_type(mut self, input: ::std::option::Option<crate::types::HubContentType>) -> Self {
162        self.inner = self.inner.set_hub_content_type(input);
163        self
164    }
165    /// <p>The content type of the resource that you want to update. Only specify a <code>Model</code> or <code>Notebook</code> resource for this API. To update a <code>ModelReference</code>, use the <code>UpdateHubContentReference</code> API instead.</p>
166    pub fn get_hub_content_type(&self) -> &::std::option::Option<crate::types::HubContentType> {
167        self.inner.get_hub_content_type()
168    }
169    /// <p>The hub content version that you want to update. For example, if you have two versions of a resource in your hub, you can update the second version.</p>
170    pub fn hub_content_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.inner = self.inner.hub_content_version(input.into());
172        self
173    }
174    /// <p>The hub content version that you want to update. For example, if you have two versions of a resource in your hub, you can update the second version.</p>
175    pub fn set_hub_content_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.inner = self.inner.set_hub_content_version(input);
177        self
178    }
179    /// <p>The hub content version that you want to update. For example, if you have two versions of a resource in your hub, you can update the second version.</p>
180    pub fn get_hub_content_version(&self) -> &::std::option::Option<::std::string::String> {
181        self.inner.get_hub_content_version()
182    }
183    /// <p>The display name of the hub content.</p>
184    pub fn hub_content_display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.inner = self.inner.hub_content_display_name(input.into());
186        self
187    }
188    /// <p>The display name of the hub content.</p>
189    pub fn set_hub_content_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.inner = self.inner.set_hub_content_display_name(input);
191        self
192    }
193    /// <p>The display name of the hub content.</p>
194    pub fn get_hub_content_display_name(&self) -> &::std::option::Option<::std::string::String> {
195        self.inner.get_hub_content_display_name()
196    }
197    /// <p>The description of the hub content.</p>
198    pub fn hub_content_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.inner = self.inner.hub_content_description(input.into());
200        self
201    }
202    /// <p>The description of the hub content.</p>
203    pub fn set_hub_content_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.inner = self.inner.set_hub_content_description(input);
205        self
206    }
207    /// <p>The description of the hub content.</p>
208    pub fn get_hub_content_description(&self) -> &::std::option::Option<::std::string::String> {
209        self.inner.get_hub_content_description()
210    }
211    /// <p>A string that provides a description of the hub content. This string can include links, tables, and standard markdown formatting.</p>
212    pub fn hub_content_markdown(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.hub_content_markdown(input.into());
214        self
215    }
216    /// <p>A string that provides a description of the hub content. This string can include links, tables, and standard markdown formatting.</p>
217    pub fn set_hub_content_markdown(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.inner = self.inner.set_hub_content_markdown(input);
219        self
220    }
221    /// <p>A string that provides a description of the hub content. This string can include links, tables, and standard markdown formatting.</p>
222    pub fn get_hub_content_markdown(&self) -> &::std::option::Option<::std::string::String> {
223        self.inner.get_hub_content_markdown()
224    }
225    ///
226    /// Appends an item to `HubContentSearchKeywords`.
227    ///
228    /// To override the contents of this collection use [`set_hub_content_search_keywords`](Self::set_hub_content_search_keywords).
229    ///
230    /// <p>The searchable keywords of the hub content.</p>
231    pub fn hub_content_search_keywords(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232        self.inner = self.inner.hub_content_search_keywords(input.into());
233        self
234    }
235    /// <p>The searchable keywords of the hub content.</p>
236    pub fn set_hub_content_search_keywords(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
237        self.inner = self.inner.set_hub_content_search_keywords(input);
238        self
239    }
240    /// <p>The searchable keywords of the hub content.</p>
241    pub fn get_hub_content_search_keywords(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
242        self.inner.get_hub_content_search_keywords()
243    }
244    /// <p>Indicates the current status of the hub content resource.</p>
245    pub fn support_status(mut self, input: crate::types::HubContentSupportStatus) -> Self {
246        self.inner = self.inner.support_status(input);
247        self
248    }
249    /// <p>Indicates the current status of the hub content resource.</p>
250    pub fn set_support_status(mut self, input: ::std::option::Option<crate::types::HubContentSupportStatus>) -> Self {
251        self.inner = self.inner.set_support_status(input);
252        self
253    }
254    /// <p>Indicates the current status of the hub content resource.</p>
255    pub fn get_support_status(&self) -> &::std::option::Option<crate::types::HubContentSupportStatus> {
256        self.inner.get_support_status()
257    }
258}