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.
/// <p>A class for modeling different type of tasks. Task implementation varies based on the <code>TaskType</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Task {
/// <p>The source fields to which a particular task is applied.</p>
pub source_fields: ::std::vec::Vec<::std::string::String>,
/// <p>The operation to be performed on the provided source fields.</p>
pub connector_operator: ::std::option::Option<crate::types::ConnectorOperator>,
/// <p>A field in a destination connector, or a field value against which Amazon AppFlow validates a source field.</p>
pub destination_field: ::std::option::Option<::std::string::String>,
/// <p>Specifies the particular task implementation that Amazon AppFlow performs.</p>
pub task_type: crate::types::TaskType,
/// <p>A map used to store task-related information. The execution service looks for particular information based on the <code>TaskType</code>.</p>
pub task_properties: ::std::option::Option<::std::collections::HashMap<crate::types::OperatorPropertiesKeys, ::std::string::String>>,
}
impl Task {
/// <p>The source fields to which a particular task is applied.</p>
pub fn source_fields(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.source_fields.deref()
}
/// <p>The operation to be performed on the provided source fields.</p>
pub fn connector_operator(&self) -> ::std::option::Option<&crate::types::ConnectorOperator> {
self.connector_operator.as_ref()
}
/// <p>A field in a destination connector, or a field value against which Amazon AppFlow validates a source field.</p>
pub fn destination_field(&self) -> ::std::option::Option<&str> {
self.destination_field.as_deref()
}
/// <p>Specifies the particular task implementation that Amazon AppFlow performs.</p>
pub fn task_type(&self) -> &crate::types::TaskType {
&self.task_type
}
/// <p>A map used to store task-related information. The execution service looks for particular information based on the <code>TaskType</code>.</p>
pub fn task_properties(
&self,
) -> ::std::option::Option<&::std::collections::HashMap<crate::types::OperatorPropertiesKeys, ::std::string::String>> {
self.task_properties.as_ref()
}
}
impl Task {
/// Creates a new builder-style object to manufacture [`Task`](crate::types::Task).
pub fn builder() -> crate::types::builders::TaskBuilder {
crate::types::builders::TaskBuilder::default()
}
}
/// A builder for [`Task`](crate::types::Task).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TaskBuilder {
pub(crate) source_fields: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) connector_operator: ::std::option::Option<crate::types::ConnectorOperator>,
pub(crate) destination_field: ::std::option::Option<::std::string::String>,
pub(crate) task_type: ::std::option::Option<crate::types::TaskType>,
pub(crate) task_properties: ::std::option::Option<::std::collections::HashMap<crate::types::OperatorPropertiesKeys, ::std::string::String>>,
}
impl TaskBuilder {
/// Appends an item to `source_fields`.
///
/// To override the contents of this collection use [`set_source_fields`](Self::set_source_fields).
///
/// <p>The source fields to which a particular task is applied.</p>
pub fn source_fields(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.source_fields.unwrap_or_default();
v.push(input.into());
self.source_fields = ::std::option::Option::Some(v);
self
}
/// <p>The source fields to which a particular task is applied.</p>
pub fn set_source_fields(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.source_fields = input;
self
}
/// <p>The source fields to which a particular task is applied.</p>
pub fn get_source_fields(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.source_fields
}
/// <p>The operation to be performed on the provided source fields.</p>
pub fn connector_operator(mut self, input: crate::types::ConnectorOperator) -> Self {
self.connector_operator = ::std::option::Option::Some(input);
self
}
/// <p>The operation to be performed on the provided source fields.</p>
pub fn set_connector_operator(mut self, input: ::std::option::Option<crate::types::ConnectorOperator>) -> Self {
self.connector_operator = input;
self
}
/// <p>The operation to be performed on the provided source fields.</p>
pub fn get_connector_operator(&self) -> &::std::option::Option<crate::types::ConnectorOperator> {
&self.connector_operator
}
/// <p>A field in a destination connector, or a field value against which Amazon AppFlow validates a source field.</p>
pub fn destination_field(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.destination_field = ::std::option::Option::Some(input.into());
self
}
/// <p>A field in a destination connector, or a field value against which Amazon AppFlow validates a source field.</p>
pub fn set_destination_field(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.destination_field = input;
self
}
/// <p>A field in a destination connector, or a field value against which Amazon AppFlow validates a source field.</p>
pub fn get_destination_field(&self) -> &::std::option::Option<::std::string::String> {
&self.destination_field
}
/// <p>Specifies the particular task implementation that Amazon AppFlow performs.</p>
/// This field is required.
pub fn task_type(mut self, input: crate::types::TaskType) -> Self {
self.task_type = ::std::option::Option::Some(input);
self
}
/// <p>Specifies the particular task implementation that Amazon AppFlow performs.</p>
pub fn set_task_type(mut self, input: ::std::option::Option<crate::types::TaskType>) -> Self {
self.task_type = input;
self
}
/// <p>Specifies the particular task implementation that Amazon AppFlow performs.</p>
pub fn get_task_type(&self) -> &::std::option::Option<crate::types::TaskType> {
&self.task_type
}
/// Adds a key-value pair to `task_properties`.
///
/// To override the contents of this collection use [`set_task_properties`](Self::set_task_properties).
///
/// <p>A map used to store task-related information. The execution service looks for particular information based on the <code>TaskType</code>.</p>
pub fn task_properties(mut self, k: crate::types::OperatorPropertiesKeys, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.task_properties.unwrap_or_default();
hash_map.insert(k, v.into());
self.task_properties = ::std::option::Option::Some(hash_map);
self
}
/// <p>A map used to store task-related information. The execution service looks for particular information based on the <code>TaskType</code>.</p>
pub fn set_task_properties(
mut self,
input: ::std::option::Option<::std::collections::HashMap<crate::types::OperatorPropertiesKeys, ::std::string::String>>,
) -> Self {
self.task_properties = input;
self
}
/// <p>A map used to store task-related information. The execution service looks for particular information based on the <code>TaskType</code>.</p>
pub fn get_task_properties(
&self,
) -> &::std::option::Option<::std::collections::HashMap<crate::types::OperatorPropertiesKeys, ::std::string::String>> {
&self.task_properties
}
/// Consumes the builder and constructs a [`Task`](crate::types::Task).
/// This method will fail if any of the following fields are not set:
/// - [`source_fields`](crate::types::builders::TaskBuilder::source_fields)
/// - [`task_type`](crate::types::builders::TaskBuilder::task_type)
pub fn build(self) -> ::std::result::Result<crate::types::Task, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Task {
source_fields: self.source_fields.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"source_fields",
"source_fields was not specified but it is required when building Task",
)
})?,
connector_operator: self.connector_operator,
destination_field: self.destination_field,
task_type: self.task_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"task_type",
"task_type was not specified but it is required when building Task",
)
})?,
task_properties: self.task_properties,
})
}
}