aws-sdk-sagemaker 1.198.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_ai_workload_config::_create_ai_workload_config_input::CreateAiWorkloadConfigInputBuilder;

pub use crate::operation::create_ai_workload_config::_create_ai_workload_config_output::CreateAiWorkloadConfigOutputBuilder;

impl crate::operation::create_ai_workload_config::builders::CreateAiWorkloadConfigInputBuilder {
    /// 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_ai_workload_config::CreateAiWorkloadConfigOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_ai_workload_config::CreateAIWorkloadConfigError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_ai_workload_config();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateAIWorkloadConfig`.
///
/// <p>Creates a reusable AI workload configuration that defines datasets, data sources, and benchmark tool settings for consistent performance testing of generative AI inference deployments on Amazon SageMaker AI.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateAIWorkloadConfigFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_ai_workload_config::builders::CreateAiWorkloadConfigInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_ai_workload_config::CreateAiWorkloadConfigOutput,
        crate::operation::create_ai_workload_config::CreateAIWorkloadConfigError,
    > for CreateAIWorkloadConfigFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_ai_workload_config::CreateAiWorkloadConfigOutput,
            crate::operation::create_ai_workload_config::CreateAIWorkloadConfigError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateAIWorkloadConfigFluentBuilder {
    /// Creates a new `CreateAIWorkloadConfigFluentBuilder`.
    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 CreateAIWorkloadConfig as a reference.
    pub fn as_input(&self) -> &crate::operation::create_ai_workload_config::builders::CreateAiWorkloadConfigInputBuilder {
        &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_ai_workload_config::CreateAiWorkloadConfigOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_ai_workload_config::CreateAIWorkloadConfigError,
            ::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_ai_workload_config::CreateAIWorkloadConfig::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_ai_workload_config::CreateAIWorkloadConfig::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_ai_workload_config::CreateAiWorkloadConfigOutput,
        crate::operation::create_ai_workload_config::CreateAIWorkloadConfigError,
        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
    }
    /// <p>The name of the AI workload configuration. The name must be unique within your Amazon Web Services account in the current Amazon Web Services Region.</p>
    pub fn ai_workload_config_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.ai_workload_config_name(input.into());
        self
    }
    /// <p>The name of the AI workload configuration. The name must be unique within your Amazon Web Services account in the current Amazon Web Services Region.</p>
    pub fn set_ai_workload_config_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_ai_workload_config_name(input);
        self
    }
    /// <p>The name of the AI workload configuration. The name must be unique within your Amazon Web Services account in the current Amazon Web Services Region.</p>
    pub fn get_ai_workload_config_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_ai_workload_config_name()
    }
    /// <p>The dataset configuration for the workload. Specify input data channels with their data sources for benchmark workloads.</p>
    pub fn dataset_config(mut self, input: crate::types::AiDatasetConfig) -> Self {
        self.inner = self.inner.dataset_config(input);
        self
    }
    /// <p>The dataset configuration for the workload. Specify input data channels with their data sources for benchmark workloads.</p>
    pub fn set_dataset_config(mut self, input: ::std::option::Option<crate::types::AiDatasetConfig>) -> Self {
        self.inner = self.inner.set_dataset_config(input);
        self
    }
    /// <p>The dataset configuration for the workload. Specify input data channels with their data sources for benchmark workloads.</p>
    pub fn get_dataset_config(&self) -> &::std::option::Option<crate::types::AiDatasetConfig> {
        self.inner.get_dataset_config()
    }
    /// <p>The benchmark tool configuration and workload specification. Provide the specification as an inline YAML or JSON string.</p>
    pub fn ai_workload_configs(mut self, input: crate::types::AiWorkloadConfigs) -> Self {
        self.inner = self.inner.ai_workload_configs(input);
        self
    }
    /// <p>The benchmark tool configuration and workload specification. Provide the specification as an inline YAML or JSON string.</p>
    pub fn set_ai_workload_configs(mut self, input: ::std::option::Option<crate::types::AiWorkloadConfigs>) -> Self {
        self.inner = self.inner.set_ai_workload_configs(input);
        self
    }
    /// <p>The benchmark tool configuration and workload specification. Provide the specification as an inline YAML or JSON string.</p>
    pub fn get_ai_workload_configs(&self) -> &::std::option::Option<crate::types::AiWorkloadConfigs> {
        self.inner.get_ai_workload_configs()
    }
    ///
    /// Appends an item to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The metadata that you apply to Amazon Web Services resources to help you categorize and organize them. Each tag consists of a key and a value, both of which you define. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a> in the Amazon Web Services General Reference.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        self.inner = self.inner.tags(input);
        self
    }
    /// <p>The metadata that you apply to Amazon Web Services resources to help you categorize and organize them. Each tag consists of a key and a value, both of which you define. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a> in the Amazon Web Services General Reference.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>The metadata that you apply to Amazon Web Services resources to help you categorize and organize them. Each tag consists of a key and a value, both of which you define. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a> in the Amazon Web Services General Reference.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        self.inner.get_tags()
    }
}