Skip to main content

aws_sdk_sagemaker/types/
_resource_limits.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies the maximum number of training jobs and parallel training jobs that a hyperparameter tuning job can launch.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ResourceLimits {
7    /// <p>The maximum number of training jobs that a hyperparameter tuning job can launch.</p>
8    pub max_number_of_training_jobs: ::std::option::Option<i32>,
9    /// <p>The maximum number of concurrent training jobs that a hyperparameter tuning job can launch.</p>
10    pub max_parallel_training_jobs: ::std::option::Option<i32>,
11    /// <p>The maximum time in seconds that a hyperparameter tuning job can run.</p>
12    pub max_runtime_in_seconds: ::std::option::Option<i32>,
13}
14impl ResourceLimits {
15    /// <p>The maximum number of training jobs that a hyperparameter tuning job can launch.</p>
16    pub fn max_number_of_training_jobs(&self) -> ::std::option::Option<i32> {
17        self.max_number_of_training_jobs
18    }
19    /// <p>The maximum number of concurrent training jobs that a hyperparameter tuning job can launch.</p>
20    pub fn max_parallel_training_jobs(&self) -> ::std::option::Option<i32> {
21        self.max_parallel_training_jobs
22    }
23    /// <p>The maximum time in seconds that a hyperparameter tuning job can run.</p>
24    pub fn max_runtime_in_seconds(&self) -> ::std::option::Option<i32> {
25        self.max_runtime_in_seconds
26    }
27}
28impl ResourceLimits {
29    /// Creates a new builder-style object to manufacture [`ResourceLimits`](crate::types::ResourceLimits).
30    pub fn builder() -> crate::types::builders::ResourceLimitsBuilder {
31        crate::types::builders::ResourceLimitsBuilder::default()
32    }
33}
34
35/// A builder for [`ResourceLimits`](crate::types::ResourceLimits).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct ResourceLimitsBuilder {
39    pub(crate) max_number_of_training_jobs: ::std::option::Option<i32>,
40    pub(crate) max_parallel_training_jobs: ::std::option::Option<i32>,
41    pub(crate) max_runtime_in_seconds: ::std::option::Option<i32>,
42}
43impl ResourceLimitsBuilder {
44    /// <p>The maximum number of training jobs that a hyperparameter tuning job can launch.</p>
45    pub fn max_number_of_training_jobs(mut self, input: i32) -> Self {
46        self.max_number_of_training_jobs = ::std::option::Option::Some(input);
47        self
48    }
49    /// <p>The maximum number of training jobs that a hyperparameter tuning job can launch.</p>
50    pub fn set_max_number_of_training_jobs(mut self, input: ::std::option::Option<i32>) -> Self {
51        self.max_number_of_training_jobs = input;
52        self
53    }
54    /// <p>The maximum number of training jobs that a hyperparameter tuning job can launch.</p>
55    pub fn get_max_number_of_training_jobs(&self) -> &::std::option::Option<i32> {
56        &self.max_number_of_training_jobs
57    }
58    /// <p>The maximum number of concurrent training jobs that a hyperparameter tuning job can launch.</p>
59    /// This field is required.
60    pub fn max_parallel_training_jobs(mut self, input: i32) -> Self {
61        self.max_parallel_training_jobs = ::std::option::Option::Some(input);
62        self
63    }
64    /// <p>The maximum number of concurrent training jobs that a hyperparameter tuning job can launch.</p>
65    pub fn set_max_parallel_training_jobs(mut self, input: ::std::option::Option<i32>) -> Self {
66        self.max_parallel_training_jobs = input;
67        self
68    }
69    /// <p>The maximum number of concurrent training jobs that a hyperparameter tuning job can launch.</p>
70    pub fn get_max_parallel_training_jobs(&self) -> &::std::option::Option<i32> {
71        &self.max_parallel_training_jobs
72    }
73    /// <p>The maximum time in seconds that a hyperparameter tuning job can run.</p>
74    pub fn max_runtime_in_seconds(mut self, input: i32) -> Self {
75        self.max_runtime_in_seconds = ::std::option::Option::Some(input);
76        self
77    }
78    /// <p>The maximum time in seconds that a hyperparameter tuning job can run.</p>
79    pub fn set_max_runtime_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
80        self.max_runtime_in_seconds = input;
81        self
82    }
83    /// <p>The maximum time in seconds that a hyperparameter tuning job can run.</p>
84    pub fn get_max_runtime_in_seconds(&self) -> &::std::option::Option<i32> {
85        &self.max_runtime_in_seconds
86    }
87    /// Consumes the builder and constructs a [`ResourceLimits`](crate::types::ResourceLimits).
88    pub fn build(self) -> crate::types::ResourceLimits {
89        crate::types::ResourceLimits {
90            max_number_of_training_jobs: self.max_number_of_training_jobs,
91            max_parallel_training_jobs: self.max_parallel_training_jobs,
92            max_runtime_in_seconds: self.max_runtime_in_seconds,
93        }
94    }
95}