aws-sdk-sagemaker 1.189.0

AWS SDK for Amazon SageMaker Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_hub_content_presigned_urls::_create_hub_content_presigned_urls_input::CreateHubContentPresignedUrlsInputBuilder;

pub use crate::operation::create_hub_content_presigned_urls::_create_hub_content_presigned_urls_output::CreateHubContentPresignedUrlsOutputBuilder;

impl crate::operation::create_hub_content_presigned_urls::builders::CreateHubContentPresignedUrlsInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_hub_content_presigned_urls::CreateHubContentPresignedUrlsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_hub_content_presigned_urls::CreateHubContentPresignedUrlsError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_hub_content_presigned_urls();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateHubContentPresignedUrls`.
///
/// <p>Creates presigned URLs for accessing hub content artifacts. This operation generates time-limited, secure URLs that allow direct download of model artifacts and associated files from Amazon SageMaker hub content, including gated models that require end-user license agreement acceptance.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateHubContentPresignedUrlsFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_hub_content_presigned_urls::builders::CreateHubContentPresignedUrlsInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_hub_content_presigned_urls::CreateHubContentPresignedUrlsOutput,
        crate::operation::create_hub_content_presigned_urls::CreateHubContentPresignedUrlsError,
    > for CreateHubContentPresignedUrlsFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_hub_content_presigned_urls::CreateHubContentPresignedUrlsOutput,
            crate::operation::create_hub_content_presigned_urls::CreateHubContentPresignedUrlsError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateHubContentPresignedUrlsFluentBuilder {
    /// Creates a new `CreateHubContentPresignedUrlsFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the CreateHubContentPresignedUrls as a reference.
    pub fn as_input(&self) -> &crate::operation::create_hub_content_presigned_urls::builders::CreateHubContentPresignedUrlsInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_hub_content_presigned_urls::CreateHubContentPresignedUrlsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_hub_content_presigned_urls::CreateHubContentPresignedUrlsError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_hub_content_presigned_urls::CreateHubContentPresignedUrls::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_hub_content_presigned_urls::CreateHubContentPresignedUrls::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::create_hub_content_presigned_urls::CreateHubContentPresignedUrlsOutput,
        crate::operation::create_hub_content_presigned_urls::CreateHubContentPresignedUrlsError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// Create a paginator for this request
    ///
    /// Paginators are used by calling [`send().await`](crate::operation::create_hub_content_presigned_urls::paginator::CreateHubContentPresignedUrlsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
    pub fn into_paginator(self) -> crate::operation::create_hub_content_presigned_urls::paginator::CreateHubContentPresignedUrlsPaginator {
        crate::operation::create_hub_content_presigned_urls::paginator::CreateHubContentPresignedUrlsPaginator::new(self.handle, self.inner)
    }
    /// <p>The name or Amazon Resource Name (ARN) of the hub that contains the content. For public content, use <code>SageMakerPublicHub</code>.</p>
    pub fn hub_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.hub_name(input.into());
        self
    }
    /// <p>The name or Amazon Resource Name (ARN) of the hub that contains the content. For public content, use <code>SageMakerPublicHub</code>.</p>
    pub fn set_hub_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_hub_name(input);
        self
    }
    /// <p>The name or Amazon Resource Name (ARN) of the hub that contains the content. For public content, use <code>SageMakerPublicHub</code>.</p>
    pub fn get_hub_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_hub_name()
    }
    /// <p>The type of hub content to access. Valid values include <code>Model</code>, <code>Notebook</code>, and <code>ModelReference</code>.</p>
    pub fn hub_content_type(mut self, input: crate::types::HubContentType) -> Self {
        self.inner = self.inner.hub_content_type(input);
        self
    }
    /// <p>The type of hub content to access. Valid values include <code>Model</code>, <code>Notebook</code>, and <code>ModelReference</code>.</p>
    pub fn set_hub_content_type(mut self, input: ::std::option::Option<crate::types::HubContentType>) -> Self {
        self.inner = self.inner.set_hub_content_type(input);
        self
    }
    /// <p>The type of hub content to access. Valid values include <code>Model</code>, <code>Notebook</code>, and <code>ModelReference</code>.</p>
    pub fn get_hub_content_type(&self) -> &::std::option::Option<crate::types::HubContentType> {
        self.inner.get_hub_content_type()
    }
    /// <p>The name of the hub content for which to generate presigned URLs. This identifies the specific model or content within the hub.</p>
    pub fn hub_content_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.hub_content_name(input.into());
        self
    }
    /// <p>The name of the hub content for which to generate presigned URLs. This identifies the specific model or content within the hub.</p>
    pub fn set_hub_content_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_hub_content_name(input);
        self
    }
    /// <p>The name of the hub content for which to generate presigned URLs. This identifies the specific model or content within the hub.</p>
    pub fn get_hub_content_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_hub_content_name()
    }
    /// <p>The version of the hub content. If not specified, the latest version is used.</p>
    pub fn hub_content_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.hub_content_version(input.into());
        self
    }
    /// <p>The version of the hub content. If not specified, the latest version is used.</p>
    pub fn set_hub_content_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_hub_content_version(input);
        self
    }
    /// <p>The version of the hub content. If not specified, the latest version is used.</p>
    pub fn get_hub_content_version(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_hub_content_version()
    }
    /// <p>Configuration settings for accessing the hub content, including end-user license agreement acceptance for gated models and expected S3 URL validation.</p>
    pub fn access_config(mut self, input: crate::types::PresignedUrlAccessConfig) -> Self {
        self.inner = self.inner.access_config(input);
        self
    }
    /// <p>Configuration settings for accessing the hub content, including end-user license agreement acceptance for gated models and expected S3 URL validation.</p>
    pub fn set_access_config(mut self, input: ::std::option::Option<crate::types::PresignedUrlAccessConfig>) -> Self {
        self.inner = self.inner.set_access_config(input);
        self
    }
    /// <p>Configuration settings for accessing the hub content, including end-user license agreement acceptance for gated models and expected S3 URL validation.</p>
    pub fn get_access_config(&self) -> &::std::option::Option<crate::types::PresignedUrlAccessConfig> {
        self.inner.get_access_config()
    }
    /// <p>The maximum number of presigned URLs to return in the response. Default value is 100. Large models may contain hundreds of files, requiring pagination to retrieve all URLs.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.inner = self.inner.max_results(input);
        self
    }
    /// <p>The maximum number of presigned URLs to return in the response. Default value is 100. Large models may contain hundreds of files, requiring pagination to retrieve all URLs.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_max_results(input);
        self
    }
    /// <p>The maximum number of presigned URLs to return in the response. Default value is 100. Large models may contain hundreds of files, requiring pagination to retrieve all URLs.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        self.inner.get_max_results()
    }
    /// <p>A token for pagination. Use this token to retrieve the next set of presigned URLs when the response is truncated.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.next_token(input.into());
        self
    }
    /// <p>A token for pagination. Use this token to retrieve the next set of presigned URLs when the response is truncated.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_next_token(input);
        self
    }
    /// <p>A token for pagination. Use this token to retrieve the next set of presigned URLs when the response is truncated.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_next_token()
    }
}