aws_sdk_sagemaker/operation/search_training_plan_offerings/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::search_training_plan_offerings::_search_training_plan_offerings_output::SearchTrainingPlanOfferingsOutputBuilder;
3
4pub use crate::operation::search_training_plan_offerings::_search_training_plan_offerings_input::SearchTrainingPlanOfferingsInputBuilder;
5
6impl crate::operation::search_training_plan_offerings::builders::SearchTrainingPlanOfferingsInputBuilder {
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::search_training_plan_offerings::SearchTrainingPlanOfferingsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::search_training_plan_offerings::SearchTrainingPlanOfferingsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.search_training_plan_offerings();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SearchTrainingPlanOfferings`.
24///
25/// <p>Searches for available training plan offerings based on specified criteria.</p>
26/// <ul>
27/// <li>
28/// <p>Users search for available plan offerings based on their requirements (e.g., instance type, count, start time, duration).</p></li>
29/// <li>
30/// <p>And then, they create a plan that best matches their needs using the ID of the plan offering they want to use.</p></li>
31/// </ul>
32/// <p>For more information about how to reserve GPU capacity for your SageMaker training jobs or SageMaker HyperPod clusters using Amazon SageMaker Training Plan , see <code> <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingPlan.html">CreateTrainingPlan</a> </code>.</p>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct SearchTrainingPlanOfferingsFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::search_training_plan_offerings::builders::SearchTrainingPlanOfferingsInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::search_training_plan_offerings::SearchTrainingPlanOfferingsOutput,
42        crate::operation::search_training_plan_offerings::SearchTrainingPlanOfferingsError,
43    > for SearchTrainingPlanOfferingsFluentBuilder
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::search_training_plan_offerings::SearchTrainingPlanOfferingsOutput,
51            crate::operation::search_training_plan_offerings::SearchTrainingPlanOfferingsError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl SearchTrainingPlanOfferingsFluentBuilder {
58    /// Creates a new `SearchTrainingPlanOfferingsFluentBuilder`.
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 SearchTrainingPlanOfferings as a reference.
67    pub fn as_input(&self) -> &crate::operation::search_training_plan_offerings::builders::SearchTrainingPlanOfferingsInputBuilder {
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::search_training_plan_offerings::SearchTrainingPlanOfferingsOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::search_training_plan_offerings::SearchTrainingPlanOfferingsError,
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::search_training_plan_offerings::SearchTrainingPlanOfferings::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::search_training_plan_offerings::SearchTrainingPlanOfferings::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::search_training_plan_offerings::SearchTrainingPlanOfferingsOutput,
104        crate::operation::search_training_plan_offerings::SearchTrainingPlanOfferingsError,
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 type of instance you want to search for in the available training plan offerings. This field allows you to filter the search results based on the specific compute resources you require for your SageMaker training jobs or SageMaker HyperPod clusters. When searching for training plan offerings, specifying the instance type helps you find Reserved Instances that match your computational needs.</p>
119    pub fn instance_type(mut self, input: crate::types::ReservedCapacityInstanceType) -> Self {
120        self.inner = self.inner.instance_type(input);
121        self
122    }
123    /// <p>The type of instance you want to search for in the available training plan offerings. This field allows you to filter the search results based on the specific compute resources you require for your SageMaker training jobs or SageMaker HyperPod clusters. When searching for training plan offerings, specifying the instance type helps you find Reserved Instances that match your computational needs.</p>
124    pub fn set_instance_type(mut self, input: ::std::option::Option<crate::types::ReservedCapacityInstanceType>) -> Self {
125        self.inner = self.inner.set_instance_type(input);
126        self
127    }
128    /// <p>The type of instance you want to search for in the available training plan offerings. This field allows you to filter the search results based on the specific compute resources you require for your SageMaker training jobs or SageMaker HyperPod clusters. When searching for training plan offerings, specifying the instance type helps you find Reserved Instances that match your computational needs.</p>
129    pub fn get_instance_type(&self) -> &::std::option::Option<crate::types::ReservedCapacityInstanceType> {
130        self.inner.get_instance_type()
131    }
132    /// <p>The number of instances you want to reserve in the training plan offerings. This allows you to specify the quantity of compute resources needed for your SageMaker training jobs or SageMaker HyperPod clusters, helping you find reserved capacity offerings that match your requirements.</p>
133    pub fn instance_count(mut self, input: i32) -> Self {
134        self.inner = self.inner.instance_count(input);
135        self
136    }
137    /// <p>The number of instances you want to reserve in the training plan offerings. This allows you to specify the quantity of compute resources needed for your SageMaker training jobs or SageMaker HyperPod clusters, helping you find reserved capacity offerings that match your requirements.</p>
138    pub fn set_instance_count(mut self, input: ::std::option::Option<i32>) -> Self {
139        self.inner = self.inner.set_instance_count(input);
140        self
141    }
142    /// <p>The number of instances you want to reserve in the training plan offerings. This allows you to specify the quantity of compute resources needed for your SageMaker training jobs or SageMaker HyperPod clusters, helping you find reserved capacity offerings that match your requirements.</p>
143    pub fn get_instance_count(&self) -> &::std::option::Option<i32> {
144        self.inner.get_instance_count()
145    }
146    /// <p>The type of UltraServer to search for, such as ml.u-p6e-gb200x72.</p>
147    pub fn ultra_server_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.ultra_server_type(input.into());
149        self
150    }
151    /// <p>The type of UltraServer to search for, such as ml.u-p6e-gb200x72.</p>
152    pub fn set_ultra_server_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_ultra_server_type(input);
154        self
155    }
156    /// <p>The type of UltraServer to search for, such as ml.u-p6e-gb200x72.</p>
157    pub fn get_ultra_server_type(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_ultra_server_type()
159    }
160    /// <p>The number of UltraServers to search for.</p>
161    pub fn ultra_server_count(mut self, input: i32) -> Self {
162        self.inner = self.inner.ultra_server_count(input);
163        self
164    }
165    /// <p>The number of UltraServers to search for.</p>
166    pub fn set_ultra_server_count(mut self, input: ::std::option::Option<i32>) -> Self {
167        self.inner = self.inner.set_ultra_server_count(input);
168        self
169    }
170    /// <p>The number of UltraServers to search for.</p>
171    pub fn get_ultra_server_count(&self) -> &::std::option::Option<i32> {
172        self.inner.get_ultra_server_count()
173    }
174    /// <p>A filter to search for training plan offerings with a start time after a specified date.</p>
175    pub fn start_time_after(mut self, input: ::aws_smithy_types::DateTime) -> Self {
176        self.inner = self.inner.start_time_after(input);
177        self
178    }
179    /// <p>A filter to search for training plan offerings with a start time after a specified date.</p>
180    pub fn set_start_time_after(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
181        self.inner = self.inner.set_start_time_after(input);
182        self
183    }
184    /// <p>A filter to search for training plan offerings with a start time after a specified date.</p>
185    pub fn get_start_time_after(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
186        self.inner.get_start_time_after()
187    }
188    /// <p>A filter to search for reserved capacity offerings with an end time before a specified date.</p>
189    pub fn end_time_before(mut self, input: ::aws_smithy_types::DateTime) -> Self {
190        self.inner = self.inner.end_time_before(input);
191        self
192    }
193    /// <p>A filter to search for reserved capacity offerings with an end time before a specified date.</p>
194    pub fn set_end_time_before(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
195        self.inner = self.inner.set_end_time_before(input);
196        self
197    }
198    /// <p>A filter to search for reserved capacity offerings with an end time before a specified date.</p>
199    pub fn get_end_time_before(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
200        self.inner.get_end_time_before()
201    }
202    /// <p>The desired duration in hours for the training plan offerings.</p>
203    pub fn duration_hours(mut self, input: i64) -> Self {
204        self.inner = self.inner.duration_hours(input);
205        self
206    }
207    /// <p>The desired duration in hours for the training plan offerings.</p>
208    pub fn set_duration_hours(mut self, input: ::std::option::Option<i64>) -> Self {
209        self.inner = self.inner.set_duration_hours(input);
210        self
211    }
212    /// <p>The desired duration in hours for the training plan offerings.</p>
213    pub fn get_duration_hours(&self) -> &::std::option::Option<i64> {
214        self.inner.get_duration_hours()
215    }
216    ///
217    /// Appends an item to `TargetResources`.
218    ///
219    /// To override the contents of this collection use [`set_target_resources`](Self::set_target_resources).
220    ///
221    /// <p>The target resources (e.g., SageMaker Training Jobs, SageMaker HyperPod, SageMaker Endpoints) to search for in the offerings.</p>
222    /// <p>Training plans are specific to their target resource.</p>
223    /// <ul>
224    /// <li>
225    /// <p>A training plan designed for SageMaker training jobs can only be used to schedule and run training jobs.</p></li>
226    /// <li>
227    /// <p>A training plan for HyperPod clusters can be used exclusively to provide compute resources to a cluster's instance group.</p></li>
228    /// <li>
229    /// <p>A training plan for SageMaker endpoints can be used exclusively to provide compute resources to SageMaker endpoints for model deployment.</p></li>
230    /// </ul>
231    pub fn target_resources(mut self, input: crate::types::SageMakerResourceName) -> Self {
232        self.inner = self.inner.target_resources(input);
233        self
234    }
235    /// <p>The target resources (e.g., SageMaker Training Jobs, SageMaker HyperPod, SageMaker Endpoints) to search for in the offerings.</p>
236    /// <p>Training plans are specific to their target resource.</p>
237    /// <ul>
238    /// <li>
239    /// <p>A training plan designed for SageMaker training jobs can only be used to schedule and run training jobs.</p></li>
240    /// <li>
241    /// <p>A training plan for HyperPod clusters can be used exclusively to provide compute resources to a cluster's instance group.</p></li>
242    /// <li>
243    /// <p>A training plan for SageMaker endpoints can be used exclusively to provide compute resources to SageMaker endpoints for model deployment.</p></li>
244    /// </ul>
245    pub fn set_target_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SageMakerResourceName>>) -> Self {
246        self.inner = self.inner.set_target_resources(input);
247        self
248    }
249    /// <p>The target resources (e.g., SageMaker Training Jobs, SageMaker HyperPod, SageMaker Endpoints) to search for in the offerings.</p>
250    /// <p>Training plans are specific to their target resource.</p>
251    /// <ul>
252    /// <li>
253    /// <p>A training plan designed for SageMaker training jobs can only be used to schedule and run training jobs.</p></li>
254    /// <li>
255    /// <p>A training plan for HyperPod clusters can be used exclusively to provide compute resources to a cluster's instance group.</p></li>
256    /// <li>
257    /// <p>A training plan for SageMaker endpoints can be used exclusively to provide compute resources to SageMaker endpoints for model deployment.</p></li>
258    /// </ul>
259    pub fn get_target_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SageMakerResourceName>> {
260        self.inner.get_target_resources()
261    }
262}