aws_sdk_sagemaker/operation/create_experiment/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_experiment::_create_experiment_output::CreateExperimentOutputBuilder;
3
4pub use crate::operation::create_experiment::_create_experiment_input::CreateExperimentInputBuilder;
5
6impl crate::operation::create_experiment::builders::CreateExperimentInputBuilder {
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::create_experiment::CreateExperimentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_experiment::CreateExperimentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_experiment();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateExperiment`.
24///
25/// <p>Creates a SageMaker <i>experiment</i>. An experiment is a collection of <i>trials</i> that are observed, compared and evaluated as a group. A trial is a set of steps, called <i>trial components</i>, that produce a machine learning model.</p><note>
26/// <p>In the Studio UI, trials are referred to as <i>run groups</i> and trial components are referred to as <i>runs</i>.</p>
27/// </note>
28/// <p>The goal of an experiment is to determine the components that produce the best model. Multiple trials are performed, each one isolating and measuring the impact of a change to one or more inputs, while keeping the remaining inputs constant.</p>
29/// <p>When you use SageMaker Studio or the SageMaker Python SDK, all experiments, trials, and trial components are automatically tracked, logged, and indexed. When you use the Amazon Web Services SDK for Python (Boto), you must use the logging APIs provided by the SDK.</p>
30/// <p>You can add tags to experiments, trials, trial components and then use the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search for the tags.</p>
31/// <p>To add a description to an experiment, specify the optional <code>Description</code> parameter. To add a description later, or to change the description, call the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateExperiment.html">UpdateExperiment</a> API.</p>
32/// <p>To get a list of all your experiments, call the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ListExperiments.html">ListExperiments</a> API. To view an experiment's properties, call the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DescribeExperiment.html">DescribeExperiment</a> API. To get a list of all the trials associated with an experiment, call the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ListTrials.html">ListTrials</a> API. To create a trial call the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrial.html">CreateTrial</a> API.</p>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct CreateExperimentFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::create_experiment::builders::CreateExperimentInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::create_experiment::CreateExperimentOutput,
42        crate::operation::create_experiment::CreateExperimentError,
43    > for CreateExperimentFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::create_experiment::CreateExperimentOutput,
51            crate::operation::create_experiment::CreateExperimentError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl CreateExperimentFluentBuilder {
58    /// Creates a new `CreateExperimentFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the CreateExperiment as a reference.
67    pub fn as_input(&self) -> &crate::operation::create_experiment::builders::CreateExperimentInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::create_experiment::CreateExperimentOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::create_experiment::CreateExperimentError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::create_experiment::CreateExperiment::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::create_experiment::CreateExperiment::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::create_experiment::CreateExperimentOutput,
104        crate::operation::create_experiment::CreateExperimentError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <p>The name of the experiment. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
119    pub fn experiment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.experiment_name(input.into());
121        self
122    }
123    /// <p>The name of the experiment. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
124    pub fn set_experiment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_experiment_name(input);
126        self
127    }
128    /// <p>The name of the experiment. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
129    pub fn get_experiment_name(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_experiment_name()
131    }
132    /// <p>The name of the experiment as displayed. The name doesn't need to be unique. If you don't specify <code>DisplayName</code>, the value in <code>ExperimentName</code> is displayed.</p>
133    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.display_name(input.into());
135        self
136    }
137    /// <p>The name of the experiment as displayed. The name doesn't need to be unique. If you don't specify <code>DisplayName</code>, the value in <code>ExperimentName</code> is displayed.</p>
138    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_display_name(input);
140        self
141    }
142    /// <p>The name of the experiment as displayed. The name doesn't need to be unique. If you don't specify <code>DisplayName</code>, the value in <code>ExperimentName</code> is displayed.</p>
143    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_display_name()
145    }
146    /// <p>The description of the experiment.</p>
147    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.description(input.into());
149        self
150    }
151    /// <p>The description of the experiment.</p>
152    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_description(input);
154        self
155    }
156    /// <p>The description of the experiment.</p>
157    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_description()
159    }
160    ///
161    /// Appends an item to `Tags`.
162    ///
163    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
164    ///
165    /// <p>A list of tags to associate with the experiment. You can use <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search on the tags.</p>
166    pub fn tags(mut self, input: crate::types::Tag) -> Self {
167        self.inner = self.inner.tags(input);
168        self
169    }
170    /// <p>A list of tags to associate with the experiment. You can use <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search on the tags.</p>
171    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
172        self.inner = self.inner.set_tags(input);
173        self
174    }
175    /// <p>A list of tags to associate with the experiment. You can use <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search on the tags.</p>
176    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
177        self.inner.get_tags()
178    }
179}