aws_sdk_transfer/operation/create_workflow/_create_workflow_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 CreateWorkflowInput {
6 /// <p>A textual description for the workflow.</p>
7 pub description: ::std::option::Option<::std::string::String>,
8 /// <p>Specifies the details for the steps that are in the specified workflow.</p>
9 /// <p>The <code>TYPE</code> specifies which of the following actions is being taken for this step.</p>
10 /// <ul>
11 /// <li>
12 /// <p><b> <code>COPY</code> </b> - Copy the file to another location.</p></li>
13 /// <li>
14 /// <p><b> <code>CUSTOM</code> </b> - Perform a custom step with an Lambda function target.</p></li>
15 /// <li>
16 /// <p><b> <code>DECRYPT</code> </b> - Decrypt a file that was encrypted before it was uploaded.</p></li>
17 /// <li>
18 /// <p><b> <code>DELETE</code> </b> - Delete the file.</p></li>
19 /// <li>
20 /// <p><b> <code>TAG</code> </b> - Add a tag to the file.</p></li>
21 /// </ul><note>
22 /// <p>Currently, copying and tagging are supported only on S3.</p>
23 /// </note>
24 /// <p>For file location, you specify either the Amazon S3 bucket and key, or the Amazon EFS file system ID and path.</p>
25 pub steps: ::std::option::Option<::std::vec::Vec<crate::types::WorkflowStep>>,
26 /// <p>Specifies the steps (actions) to take if errors are encountered during execution of the workflow.</p><note>
27 /// <p>For custom steps, the Lambda function needs to send <code>FAILURE</code> to the call back API to kick off the exception steps. Additionally, if the Lambda does not send <code>SUCCESS</code> before it times out, the exception steps are executed.</p>
28 /// </note>
29 pub on_exception_steps: ::std::option::Option<::std::vec::Vec<crate::types::WorkflowStep>>,
30 /// <p>Key-value pairs that can be used to group and search for workflows. Tags are metadata attached to workflows for any purpose.</p>
31 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
32}
33impl CreateWorkflowInput {
34 /// <p>A textual description for the workflow.</p>
35 pub fn description(&self) -> ::std::option::Option<&str> {
36 self.description.as_deref()
37 }
38 /// <p>Specifies the details for the steps that are in the specified workflow.</p>
39 /// <p>The <code>TYPE</code> specifies which of the following actions is being taken for this step.</p>
40 /// <ul>
41 /// <li>
42 /// <p><b> <code>COPY</code> </b> - Copy the file to another location.</p></li>
43 /// <li>
44 /// <p><b> <code>CUSTOM</code> </b> - Perform a custom step with an Lambda function target.</p></li>
45 /// <li>
46 /// <p><b> <code>DECRYPT</code> </b> - Decrypt a file that was encrypted before it was uploaded.</p></li>
47 /// <li>
48 /// <p><b> <code>DELETE</code> </b> - Delete the file.</p></li>
49 /// <li>
50 /// <p><b> <code>TAG</code> </b> - Add a tag to the file.</p></li>
51 /// </ul><note>
52 /// <p>Currently, copying and tagging are supported only on S3.</p>
53 /// </note>
54 /// <p>For file location, you specify either the Amazon S3 bucket and key, or the Amazon EFS file system ID and path.</p>
55 ///
56 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.steps.is_none()`.
57 pub fn steps(&self) -> &[crate::types::WorkflowStep] {
58 self.steps.as_deref().unwrap_or_default()
59 }
60 /// <p>Specifies the steps (actions) to take if errors are encountered during execution of the workflow.</p><note>
61 /// <p>For custom steps, the Lambda function needs to send <code>FAILURE</code> to the call back API to kick off the exception steps. Additionally, if the Lambda does not send <code>SUCCESS</code> before it times out, the exception steps are executed.</p>
62 /// </note>
63 ///
64 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.on_exception_steps.is_none()`.
65 pub fn on_exception_steps(&self) -> &[crate::types::WorkflowStep] {
66 self.on_exception_steps.as_deref().unwrap_or_default()
67 }
68 /// <p>Key-value pairs that can be used to group and search for workflows. Tags are metadata attached to workflows for any purpose.</p>
69 ///
70 /// 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()`.
71 pub fn tags(&self) -> &[crate::types::Tag] {
72 self.tags.as_deref().unwrap_or_default()
73 }
74}
75impl CreateWorkflowInput {
76 /// Creates a new builder-style object to manufacture [`CreateWorkflowInput`](crate::operation::create_workflow::CreateWorkflowInput).
77 pub fn builder() -> crate::operation::create_workflow::builders::CreateWorkflowInputBuilder {
78 crate::operation::create_workflow::builders::CreateWorkflowInputBuilder::default()
79 }
80}
81
82/// A builder for [`CreateWorkflowInput`](crate::operation::create_workflow::CreateWorkflowInput).
83#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
84#[non_exhaustive]
85pub struct CreateWorkflowInputBuilder {
86 pub(crate) description: ::std::option::Option<::std::string::String>,
87 pub(crate) steps: ::std::option::Option<::std::vec::Vec<crate::types::WorkflowStep>>,
88 pub(crate) on_exception_steps: ::std::option::Option<::std::vec::Vec<crate::types::WorkflowStep>>,
89 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
90}
91impl CreateWorkflowInputBuilder {
92 /// <p>A textual description for the workflow.</p>
93 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94 self.description = ::std::option::Option::Some(input.into());
95 self
96 }
97 /// <p>A textual description for the workflow.</p>
98 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99 self.description = input;
100 self
101 }
102 /// <p>A textual description for the workflow.</p>
103 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
104 &self.description
105 }
106 /// Appends an item to `steps`.
107 ///
108 /// To override the contents of this collection use [`set_steps`](Self::set_steps).
109 ///
110 /// <p>Specifies the details for the steps that are in the specified workflow.</p>
111 /// <p>The <code>TYPE</code> specifies which of the following actions is being taken for this step.</p>
112 /// <ul>
113 /// <li>
114 /// <p><b> <code>COPY</code> </b> - Copy the file to another location.</p></li>
115 /// <li>
116 /// <p><b> <code>CUSTOM</code> </b> - Perform a custom step with an Lambda function target.</p></li>
117 /// <li>
118 /// <p><b> <code>DECRYPT</code> </b> - Decrypt a file that was encrypted before it was uploaded.</p></li>
119 /// <li>
120 /// <p><b> <code>DELETE</code> </b> - Delete the file.</p></li>
121 /// <li>
122 /// <p><b> <code>TAG</code> </b> - Add a tag to the file.</p></li>
123 /// </ul><note>
124 /// <p>Currently, copying and tagging are supported only on S3.</p>
125 /// </note>
126 /// <p>For file location, you specify either the Amazon S3 bucket and key, or the Amazon EFS file system ID and path.</p>
127 pub fn steps(mut self, input: crate::types::WorkflowStep) -> Self {
128 let mut v = self.steps.unwrap_or_default();
129 v.push(input);
130 self.steps = ::std::option::Option::Some(v);
131 self
132 }
133 /// <p>Specifies the details for the steps that are in the specified workflow.</p>
134 /// <p>The <code>TYPE</code> specifies which of the following actions is being taken for this step.</p>
135 /// <ul>
136 /// <li>
137 /// <p><b> <code>COPY</code> </b> - Copy the file to another location.</p></li>
138 /// <li>
139 /// <p><b> <code>CUSTOM</code> </b> - Perform a custom step with an Lambda function target.</p></li>
140 /// <li>
141 /// <p><b> <code>DECRYPT</code> </b> - Decrypt a file that was encrypted before it was uploaded.</p></li>
142 /// <li>
143 /// <p><b> <code>DELETE</code> </b> - Delete the file.</p></li>
144 /// <li>
145 /// <p><b> <code>TAG</code> </b> - Add a tag to the file.</p></li>
146 /// </ul><note>
147 /// <p>Currently, copying and tagging are supported only on S3.</p>
148 /// </note>
149 /// <p>For file location, you specify either the Amazon S3 bucket and key, or the Amazon EFS file system ID and path.</p>
150 pub fn set_steps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::WorkflowStep>>) -> Self {
151 self.steps = input;
152 self
153 }
154 /// <p>Specifies the details for the steps that are in the specified workflow.</p>
155 /// <p>The <code>TYPE</code> specifies which of the following actions is being taken for this step.</p>
156 /// <ul>
157 /// <li>
158 /// <p><b> <code>COPY</code> </b> - Copy the file to another location.</p></li>
159 /// <li>
160 /// <p><b> <code>CUSTOM</code> </b> - Perform a custom step with an Lambda function target.</p></li>
161 /// <li>
162 /// <p><b> <code>DECRYPT</code> </b> - Decrypt a file that was encrypted before it was uploaded.</p></li>
163 /// <li>
164 /// <p><b> <code>DELETE</code> </b> - Delete the file.</p></li>
165 /// <li>
166 /// <p><b> <code>TAG</code> </b> - Add a tag to the file.</p></li>
167 /// </ul><note>
168 /// <p>Currently, copying and tagging are supported only on S3.</p>
169 /// </note>
170 /// <p>For file location, you specify either the Amazon S3 bucket and key, or the Amazon EFS file system ID and path.</p>
171 pub fn get_steps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::WorkflowStep>> {
172 &self.steps
173 }
174 /// Appends an item to `on_exception_steps`.
175 ///
176 /// To override the contents of this collection use [`set_on_exception_steps`](Self::set_on_exception_steps).
177 ///
178 /// <p>Specifies the steps (actions) to take if errors are encountered during execution of the workflow.</p><note>
179 /// <p>For custom steps, the Lambda function needs to send <code>FAILURE</code> to the call back API to kick off the exception steps. Additionally, if the Lambda does not send <code>SUCCESS</code> before it times out, the exception steps are executed.</p>
180 /// </note>
181 pub fn on_exception_steps(mut self, input: crate::types::WorkflowStep) -> Self {
182 let mut v = self.on_exception_steps.unwrap_or_default();
183 v.push(input);
184 self.on_exception_steps = ::std::option::Option::Some(v);
185 self
186 }
187 /// <p>Specifies the steps (actions) to take if errors are encountered during execution of the workflow.</p><note>
188 /// <p>For custom steps, the Lambda function needs to send <code>FAILURE</code> to the call back API to kick off the exception steps. Additionally, if the Lambda does not send <code>SUCCESS</code> before it times out, the exception steps are executed.</p>
189 /// </note>
190 pub fn set_on_exception_steps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::WorkflowStep>>) -> Self {
191 self.on_exception_steps = input;
192 self
193 }
194 /// <p>Specifies the steps (actions) to take if errors are encountered during execution of the workflow.</p><note>
195 /// <p>For custom steps, the Lambda function needs to send <code>FAILURE</code> to the call back API to kick off the exception steps. Additionally, if the Lambda does not send <code>SUCCESS</code> before it times out, the exception steps are executed.</p>
196 /// </note>
197 pub fn get_on_exception_steps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::WorkflowStep>> {
198 &self.on_exception_steps
199 }
200 /// Appends an item to `tags`.
201 ///
202 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
203 ///
204 /// <p>Key-value pairs that can be used to group and search for workflows. Tags are metadata attached to workflows for any purpose.</p>
205 pub fn tags(mut self, input: crate::types::Tag) -> Self {
206 let mut v = self.tags.unwrap_or_default();
207 v.push(input);
208 self.tags = ::std::option::Option::Some(v);
209 self
210 }
211 /// <p>Key-value pairs that can be used to group and search for workflows. Tags are metadata attached to workflows for any purpose.</p>
212 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
213 self.tags = input;
214 self
215 }
216 /// <p>Key-value pairs that can be used to group and search for workflows. Tags are metadata attached to workflows for any purpose.</p>
217 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
218 &self.tags
219 }
220 /// Consumes the builder and constructs a [`CreateWorkflowInput`](crate::operation::create_workflow::CreateWorkflowInput).
221 pub fn build(
222 self,
223 ) -> ::std::result::Result<crate::operation::create_workflow::CreateWorkflowInput, ::aws_smithy_types::error::operation::BuildError> {
224 ::std::result::Result::Ok(crate::operation::create_workflow::CreateWorkflowInput {
225 description: self.description,
226 steps: self.steps,
227 on_exception_steps: self.on_exception_steps,
228 tags: self.tags,
229 })
230 }
231}