aws_sdk_s3control/operation/create_job/_create_job_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateJobInput {
6 /// <p>The Amazon Web Services account ID that creates the job.</p>
7 pub account_id: ::std::option::Option<::std::string::String>,
8 /// <p>Indicates whether confirmation is required before Amazon S3 runs the job. Confirmation is only required for jobs created through the Amazon S3 console.</p>
9 pub confirmation_required: ::std::option::Option<bool>,
10 /// <p>The action that you want this job to perform on every object listed in the manifest. For more information about the available actions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-operations.html">Operations</a> in the <i>Amazon S3 User Guide</i>.</p>
11 pub operation: ::std::option::Option<crate::types::JobOperation>,
12 /// <p>Configuration parameters for the optional job-completion report.</p>
13 pub report: ::std::option::Option<crate::types::JobReport>,
14 /// <p>An idempotency token to ensure that you don't accidentally submit the same request twice. You can use any string up to the maximum length.</p>
15 pub client_request_token: ::std::option::Option<::std::string::String>,
16 /// <p>Configuration parameters for the manifest.</p>
17 pub manifest: ::std::option::Option<crate::types::JobManifest>,
18 /// <p>A description for this job. You can use any string within the permitted length. Descriptions don't need to be unique and can be used for multiple jobs.</p>
19 pub description: ::std::option::Option<::std::string::String>,
20 /// <p>The numerical priority for this job. Higher numbers indicate higher priority.</p>
21 pub priority: ::std::option::Option<i32>,
22 /// <p>The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) role that Batch Operations will use to run this job's action on every object in the manifest.</p>
23 pub role_arn: ::std::option::Option<::std::string::String>,
24 /// <p>A set of tags to associate with the S3 Batch Operations job. This is an optional parameter.</p>
25 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::S3Tag>>,
26 /// <p>The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both.</p>
27 pub manifest_generator: ::std::option::Option<crate::types::JobManifestGenerator>,
28}
29impl CreateJobInput {
30 /// <p>The Amazon Web Services account ID that creates the job.</p>
31 pub fn account_id(&self) -> ::std::option::Option<&str> {
32 self.account_id.as_deref()
33 }
34 /// <p>Indicates whether confirmation is required before Amazon S3 runs the job. Confirmation is only required for jobs created through the Amazon S3 console.</p>
35 pub fn confirmation_required(&self) -> ::std::option::Option<bool> {
36 self.confirmation_required
37 }
38 /// <p>The action that you want this job to perform on every object listed in the manifest. For more information about the available actions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-operations.html">Operations</a> in the <i>Amazon S3 User Guide</i>.</p>
39 pub fn operation(&self) -> ::std::option::Option<&crate::types::JobOperation> {
40 self.operation.as_ref()
41 }
42 /// <p>Configuration parameters for the optional job-completion report.</p>
43 pub fn report(&self) -> ::std::option::Option<&crate::types::JobReport> {
44 self.report.as_ref()
45 }
46 /// <p>An idempotency token to ensure that you don't accidentally submit the same request twice. You can use any string up to the maximum length.</p>
47 pub fn client_request_token(&self) -> ::std::option::Option<&str> {
48 self.client_request_token.as_deref()
49 }
50 /// <p>Configuration parameters for the manifest.</p>
51 pub fn manifest(&self) -> ::std::option::Option<&crate::types::JobManifest> {
52 self.manifest.as_ref()
53 }
54 /// <p>A description for this job. You can use any string within the permitted length. Descriptions don't need to be unique and can be used for multiple jobs.</p>
55 pub fn description(&self) -> ::std::option::Option<&str> {
56 self.description.as_deref()
57 }
58 /// <p>The numerical priority for this job. Higher numbers indicate higher priority.</p>
59 pub fn priority(&self) -> ::std::option::Option<i32> {
60 self.priority
61 }
62 /// <p>The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) role that Batch Operations will use to run this job's action on every object in the manifest.</p>
63 pub fn role_arn(&self) -> ::std::option::Option<&str> {
64 self.role_arn.as_deref()
65 }
66 /// <p>A set of tags to associate with the S3 Batch Operations job. This is an optional parameter.</p>
67 ///
68 /// 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()`.
69 pub fn tags(&self) -> &[crate::types::S3Tag] {
70 self.tags.as_deref().unwrap_or_default()
71 }
72 /// <p>The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both.</p>
73 pub fn manifest_generator(&self) -> ::std::option::Option<&crate::types::JobManifestGenerator> {
74 self.manifest_generator.as_ref()
75 }
76}
77impl CreateJobInput {
78 /// Creates a new builder-style object to manufacture [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
79 pub fn builder() -> crate::operation::create_job::builders::CreateJobInputBuilder {
80 crate::operation::create_job::builders::CreateJobInputBuilder::default()
81 }
82}
83
84/// A builder for [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
85#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
86#[non_exhaustive]
87pub struct CreateJobInputBuilder {
88 pub(crate) account_id: ::std::option::Option<::std::string::String>,
89 pub(crate) confirmation_required: ::std::option::Option<bool>,
90 pub(crate) operation: ::std::option::Option<crate::types::JobOperation>,
91 pub(crate) report: ::std::option::Option<crate::types::JobReport>,
92 pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
93 pub(crate) manifest: ::std::option::Option<crate::types::JobManifest>,
94 pub(crate) description: ::std::option::Option<::std::string::String>,
95 pub(crate) priority: ::std::option::Option<i32>,
96 pub(crate) role_arn: ::std::option::Option<::std::string::String>,
97 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::S3Tag>>,
98 pub(crate) manifest_generator: ::std::option::Option<crate::types::JobManifestGenerator>,
99}
100impl CreateJobInputBuilder {
101 /// <p>The Amazon Web Services account ID that creates the job.</p>
102 /// This field is required.
103 pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.account_id = ::std::option::Option::Some(input.into());
105 self
106 }
107 /// <p>The Amazon Web Services account ID that creates the job.</p>
108 pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.account_id = input;
110 self
111 }
112 /// <p>The Amazon Web Services account ID that creates the job.</p>
113 pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
114 &self.account_id
115 }
116 /// <p>Indicates whether confirmation is required before Amazon S3 runs the job. Confirmation is only required for jobs created through the Amazon S3 console.</p>
117 pub fn confirmation_required(mut self, input: bool) -> Self {
118 self.confirmation_required = ::std::option::Option::Some(input);
119 self
120 }
121 /// <p>Indicates whether confirmation is required before Amazon S3 runs the job. Confirmation is only required for jobs created through the Amazon S3 console.</p>
122 pub fn set_confirmation_required(mut self, input: ::std::option::Option<bool>) -> Self {
123 self.confirmation_required = input;
124 self
125 }
126 /// <p>Indicates whether confirmation is required before Amazon S3 runs the job. Confirmation is only required for jobs created through the Amazon S3 console.</p>
127 pub fn get_confirmation_required(&self) -> &::std::option::Option<bool> {
128 &self.confirmation_required
129 }
130 /// <p>The action that you want this job to perform on every object listed in the manifest. For more information about the available actions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-operations.html">Operations</a> in the <i>Amazon S3 User Guide</i>.</p>
131 /// This field is required.
132 pub fn operation(mut self, input: crate::types::JobOperation) -> Self {
133 self.operation = ::std::option::Option::Some(input);
134 self
135 }
136 /// <p>The action that you want this job to perform on every object listed in the manifest. For more information about the available actions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-operations.html">Operations</a> in the <i>Amazon S3 User Guide</i>.</p>
137 pub fn set_operation(mut self, input: ::std::option::Option<crate::types::JobOperation>) -> Self {
138 self.operation = input;
139 self
140 }
141 /// <p>The action that you want this job to perform on every object listed in the manifest. For more information about the available actions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-operations.html">Operations</a> in the <i>Amazon S3 User Guide</i>.</p>
142 pub fn get_operation(&self) -> &::std::option::Option<crate::types::JobOperation> {
143 &self.operation
144 }
145 /// <p>Configuration parameters for the optional job-completion report.</p>
146 /// This field is required.
147 pub fn report(mut self, input: crate::types::JobReport) -> Self {
148 self.report = ::std::option::Option::Some(input);
149 self
150 }
151 /// <p>Configuration parameters for the optional job-completion report.</p>
152 pub fn set_report(mut self, input: ::std::option::Option<crate::types::JobReport>) -> Self {
153 self.report = input;
154 self
155 }
156 /// <p>Configuration parameters for the optional job-completion report.</p>
157 pub fn get_report(&self) -> &::std::option::Option<crate::types::JobReport> {
158 &self.report
159 }
160 /// <p>An idempotency token to ensure that you don't accidentally submit the same request twice. You can use any string up to the maximum length.</p>
161 /// This field is required.
162 pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163 self.client_request_token = ::std::option::Option::Some(input.into());
164 self
165 }
166 /// <p>An idempotency token to ensure that you don't accidentally submit the same request twice. You can use any string up to the maximum length.</p>
167 pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168 self.client_request_token = input;
169 self
170 }
171 /// <p>An idempotency token to ensure that you don't accidentally submit the same request twice. You can use any string up to the maximum length.</p>
172 pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
173 &self.client_request_token
174 }
175 /// <p>Configuration parameters for the manifest.</p>
176 pub fn manifest(mut self, input: crate::types::JobManifest) -> Self {
177 self.manifest = ::std::option::Option::Some(input);
178 self
179 }
180 /// <p>Configuration parameters for the manifest.</p>
181 pub fn set_manifest(mut self, input: ::std::option::Option<crate::types::JobManifest>) -> Self {
182 self.manifest = input;
183 self
184 }
185 /// <p>Configuration parameters for the manifest.</p>
186 pub fn get_manifest(&self) -> &::std::option::Option<crate::types::JobManifest> {
187 &self.manifest
188 }
189 /// <p>A description for this job. You can use any string within the permitted length. Descriptions don't need to be unique and can be used for multiple jobs.</p>
190 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191 self.description = ::std::option::Option::Some(input.into());
192 self
193 }
194 /// <p>A description for this job. You can use any string within the permitted length. Descriptions don't need to be unique and can be used for multiple jobs.</p>
195 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196 self.description = input;
197 self
198 }
199 /// <p>A description for this job. You can use any string within the permitted length. Descriptions don't need to be unique and can be used for multiple jobs.</p>
200 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
201 &self.description
202 }
203 /// <p>The numerical priority for this job. Higher numbers indicate higher priority.</p>
204 /// This field is required.
205 pub fn priority(mut self, input: i32) -> Self {
206 self.priority = ::std::option::Option::Some(input);
207 self
208 }
209 /// <p>The numerical priority for this job. Higher numbers indicate higher priority.</p>
210 pub fn set_priority(mut self, input: ::std::option::Option<i32>) -> Self {
211 self.priority = input;
212 self
213 }
214 /// <p>The numerical priority for this job. Higher numbers indicate higher priority.</p>
215 pub fn get_priority(&self) -> &::std::option::Option<i32> {
216 &self.priority
217 }
218 /// <p>The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) role that Batch Operations will use to run this job's action on every object in the manifest.</p>
219 /// This field is required.
220 pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
221 self.role_arn = ::std::option::Option::Some(input.into());
222 self
223 }
224 /// <p>The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) role that Batch Operations will use to run this job's action on every object in the manifest.</p>
225 pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
226 self.role_arn = input;
227 self
228 }
229 /// <p>The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) role that Batch Operations will use to run this job's action on every object in the manifest.</p>
230 pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
231 &self.role_arn
232 }
233 /// Appends an item to `tags`.
234 ///
235 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
236 ///
237 /// <p>A set of tags to associate with the S3 Batch Operations job. This is an optional parameter.</p>
238 pub fn tags(mut self, input: crate::types::S3Tag) -> Self {
239 let mut v = self.tags.unwrap_or_default();
240 v.push(input);
241 self.tags = ::std::option::Option::Some(v);
242 self
243 }
244 /// <p>A set of tags to associate with the S3 Batch Operations job. This is an optional parameter.</p>
245 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::S3Tag>>) -> Self {
246 self.tags = input;
247 self
248 }
249 /// <p>A set of tags to associate with the S3 Batch Operations job. This is an optional parameter.</p>
250 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::S3Tag>> {
251 &self.tags
252 }
253 /// <p>The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both.</p>
254 pub fn manifest_generator(mut self, input: crate::types::JobManifestGenerator) -> Self {
255 self.manifest_generator = ::std::option::Option::Some(input);
256 self
257 }
258 /// <p>The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both.</p>
259 pub fn set_manifest_generator(mut self, input: ::std::option::Option<crate::types::JobManifestGenerator>) -> Self {
260 self.manifest_generator = input;
261 self
262 }
263 /// <p>The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both.</p>
264 pub fn get_manifest_generator(&self) -> &::std::option::Option<crate::types::JobManifestGenerator> {
265 &self.manifest_generator
266 }
267 /// Consumes the builder and constructs a [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
268 pub fn build(self) -> ::std::result::Result<crate::operation::create_job::CreateJobInput, ::aws_smithy_types::error::operation::BuildError> {
269 ::std::result::Result::Ok(crate::operation::create_job::CreateJobInput {
270 account_id: self.account_id,
271 confirmation_required: self.confirmation_required,
272 operation: self.operation,
273 report: self.report,
274 client_request_token: self.client_request_token,
275 manifest: self.manifest,
276 description: self.description,
277 priority: self.priority,
278 role_arn: self.role_arn,
279 tags: self.tags,
280 manifest_generator: self.manifest_generator,
281 })
282 }
283}