1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateJobInput {
/// <p>The name of the job. The name must be unique within your account and Amazon Web Services Region.</p>
pub job_name: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the job. The role must have the necessary permissions to access the resources required by the job configuration.</p>
pub role_arn: ::std::option::Option<::std::string::String>,
/// <p>The category of the job. The category determines the type of workload that the job runs.</p>
pub job_category: ::std::option::Option<crate::types::JobCategory>,
/// <p>The version of the configuration schema to use for the job configuration document. Use <code>ListJobSchemaVersions</code> to get available schema versions for a job category.</p>
pub job_config_schema_version: ::std::option::Option<::std::string::String>,
/// <p>The JSON configuration document for the job. The document must conform to the schema specified by <code>JobConfigSchemaVersion</code>. Use <code>DescribeJobSchemaVersion</code> to retrieve the schema for validation.</p>
pub job_config_document: ::std::option::Option<::std::string::String>,
/// <p>An array of key-value pairs to apply to the job as tags. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateJobInput {
/// <p>The name of the job. The name must be unique within your account and Amazon Web Services Region.</p>
pub fn job_name(&self) -> ::std::option::Option<&str> {
self.job_name.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the job. The role must have the necessary permissions to access the resources required by the job configuration.</p>
pub fn role_arn(&self) -> ::std::option::Option<&str> {
self.role_arn.as_deref()
}
/// <p>The category of the job. The category determines the type of workload that the job runs.</p>
pub fn job_category(&self) -> ::std::option::Option<&crate::types::JobCategory> {
self.job_category.as_ref()
}
/// <p>The version of the configuration schema to use for the job configuration document. Use <code>ListJobSchemaVersions</code> to get available schema versions for a job category.</p>
pub fn job_config_schema_version(&self) -> ::std::option::Option<&str> {
self.job_config_schema_version.as_deref()
}
/// <p>The JSON configuration document for the job. The document must conform to the schema specified by <code>JobConfigSchemaVersion</code>. Use <code>DescribeJobSchemaVersion</code> to retrieve the schema for validation.</p>
pub fn job_config_document(&self) -> ::std::option::Option<&str> {
self.job_config_document.as_deref()
}
/// <p>An array of key-value pairs to apply to the job as tags. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
}
impl CreateJobInput {
/// Creates a new builder-style object to manufacture [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
pub fn builder() -> crate::operation::create_job::builders::CreateJobInputBuilder {
crate::operation::create_job::builders::CreateJobInputBuilder::default()
}
}
/// A builder for [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateJobInputBuilder {
pub(crate) job_name: ::std::option::Option<::std::string::String>,
pub(crate) role_arn: ::std::option::Option<::std::string::String>,
pub(crate) job_category: ::std::option::Option<crate::types::JobCategory>,
pub(crate) job_config_schema_version: ::std::option::Option<::std::string::String>,
pub(crate) job_config_document: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateJobInputBuilder {
/// <p>The name of the job. The name must be unique within your account and Amazon Web Services Region.</p>
/// This field is required.
pub fn job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.job_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the job. The name must be unique within your account and Amazon Web Services Region.</p>
pub fn set_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.job_name = input;
self
}
/// <p>The name of the job. The name must be unique within your account and Amazon Web Services Region.</p>
pub fn get_job_name(&self) -> &::std::option::Option<::std::string::String> {
&self.job_name
}
/// <p>The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the job. The role must have the necessary permissions to access the resources required by the job configuration.</p>
/// This field is required.
pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.role_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the job. The role must have the necessary permissions to access the resources required by the job configuration.</p>
pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.role_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the job. The role must have the necessary permissions to access the resources required by the job configuration.</p>
pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.role_arn
}
/// <p>The category of the job. The category determines the type of workload that the job runs.</p>
/// This field is required.
pub fn job_category(mut self, input: crate::types::JobCategory) -> Self {
self.job_category = ::std::option::Option::Some(input);
self
}
/// <p>The category of the job. The category determines the type of workload that the job runs.</p>
pub fn set_job_category(mut self, input: ::std::option::Option<crate::types::JobCategory>) -> Self {
self.job_category = input;
self
}
/// <p>The category of the job. The category determines the type of workload that the job runs.</p>
pub fn get_job_category(&self) -> &::std::option::Option<crate::types::JobCategory> {
&self.job_category
}
/// <p>The version of the configuration schema to use for the job configuration document. Use <code>ListJobSchemaVersions</code> to get available schema versions for a job category.</p>
/// This field is required.
pub fn job_config_schema_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.job_config_schema_version = ::std::option::Option::Some(input.into());
self
}
/// <p>The version of the configuration schema to use for the job configuration document. Use <code>ListJobSchemaVersions</code> to get available schema versions for a job category.</p>
pub fn set_job_config_schema_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.job_config_schema_version = input;
self
}
/// <p>The version of the configuration schema to use for the job configuration document. Use <code>ListJobSchemaVersions</code> to get available schema versions for a job category.</p>
pub fn get_job_config_schema_version(&self) -> &::std::option::Option<::std::string::String> {
&self.job_config_schema_version
}
/// <p>The JSON configuration document for the job. The document must conform to the schema specified by <code>JobConfigSchemaVersion</code>. Use <code>DescribeJobSchemaVersion</code> to retrieve the schema for validation.</p>
/// This field is required.
pub fn job_config_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.job_config_document = ::std::option::Option::Some(input.into());
self
}
/// <p>The JSON configuration document for the job. The document must conform to the schema specified by <code>JobConfigSchemaVersion</code>. Use <code>DescribeJobSchemaVersion</code> to retrieve the schema for validation.</p>
pub fn set_job_config_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.job_config_document = input;
self
}
/// <p>The JSON configuration document for the job. The document must conform to the schema specified by <code>JobConfigSchemaVersion</code>. Use <code>DescribeJobSchemaVersion</code> to retrieve the schema for validation.</p>
pub fn get_job_config_document(&self) -> &::std::option::Option<::std::string::String> {
&self.job_config_document
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>An array of key-value pairs to apply to the job as tags. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
/// <p>An array of key-value pairs to apply to the job as tags. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
/// <p>An array of key-value pairs to apply to the job as tags. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
/// Consumes the builder and constructs a [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
pub fn build(self) -> ::std::result::Result<crate::operation::create_job::CreateJobInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_job::CreateJobInput {
job_name: self.job_name,
role_arn: self.role_arn,
job_category: self.job_category,
job_config_schema_version: self.job_config_schema_version,
job_config_document: self.job_config_document,
tags: self.tags,
})
}
}