aws_sdk_appflow/types/
_custom_connector_destination_properties.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CustomConnectorDestinationProperties {
7 pub entity_name: ::std::string::String,
9 pub error_handling_config: ::std::option::Option<crate::types::ErrorHandlingConfig>,
11 pub write_operation_type: ::std::option::Option<crate::types::WriteOperationType>,
13 pub id_field_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
15 pub custom_properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
17}
18impl CustomConnectorDestinationProperties {
19 pub fn entity_name(&self) -> &str {
21 use std::ops::Deref;
22 self.entity_name.deref()
23 }
24 pub fn error_handling_config(&self) -> ::std::option::Option<&crate::types::ErrorHandlingConfig> {
26 self.error_handling_config.as_ref()
27 }
28 pub fn write_operation_type(&self) -> ::std::option::Option<&crate::types::WriteOperationType> {
30 self.write_operation_type.as_ref()
31 }
32 pub fn id_field_names(&self) -> &[::std::string::String] {
36 self.id_field_names.as_deref().unwrap_or_default()
37 }
38 pub fn custom_properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
40 self.custom_properties.as_ref()
41 }
42}
43impl CustomConnectorDestinationProperties {
44 pub fn builder() -> crate::types::builders::CustomConnectorDestinationPropertiesBuilder {
46 crate::types::builders::CustomConnectorDestinationPropertiesBuilder::default()
47 }
48}
49
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct CustomConnectorDestinationPropertiesBuilder {
54 pub(crate) entity_name: ::std::option::Option<::std::string::String>,
55 pub(crate) error_handling_config: ::std::option::Option<crate::types::ErrorHandlingConfig>,
56 pub(crate) write_operation_type: ::std::option::Option<crate::types::WriteOperationType>,
57 pub(crate) id_field_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
58 pub(crate) custom_properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
59}
60impl CustomConnectorDestinationPropertiesBuilder {
61 pub fn entity_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64 self.entity_name = ::std::option::Option::Some(input.into());
65 self
66 }
67 pub fn set_entity_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69 self.entity_name = input;
70 self
71 }
72 pub fn get_entity_name(&self) -> &::std::option::Option<::std::string::String> {
74 &self.entity_name
75 }
76 pub fn error_handling_config(mut self, input: crate::types::ErrorHandlingConfig) -> Self {
78 self.error_handling_config = ::std::option::Option::Some(input);
79 self
80 }
81 pub fn set_error_handling_config(mut self, input: ::std::option::Option<crate::types::ErrorHandlingConfig>) -> Self {
83 self.error_handling_config = input;
84 self
85 }
86 pub fn get_error_handling_config(&self) -> &::std::option::Option<crate::types::ErrorHandlingConfig> {
88 &self.error_handling_config
89 }
90 pub fn write_operation_type(mut self, input: crate::types::WriteOperationType) -> Self {
92 self.write_operation_type = ::std::option::Option::Some(input);
93 self
94 }
95 pub fn set_write_operation_type(mut self, input: ::std::option::Option<crate::types::WriteOperationType>) -> Self {
97 self.write_operation_type = input;
98 self
99 }
100 pub fn get_write_operation_type(&self) -> &::std::option::Option<crate::types::WriteOperationType> {
102 &self.write_operation_type
103 }
104 pub fn id_field_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110 let mut v = self.id_field_names.unwrap_or_default();
111 v.push(input.into());
112 self.id_field_names = ::std::option::Option::Some(v);
113 self
114 }
115 pub fn set_id_field_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
117 self.id_field_names = input;
118 self
119 }
120 pub fn get_id_field_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
122 &self.id_field_names
123 }
124 pub fn custom_properties(
130 mut self,
131 k: impl ::std::convert::Into<::std::string::String>,
132 v: impl ::std::convert::Into<::std::string::String>,
133 ) -> Self {
134 let mut hash_map = self.custom_properties.unwrap_or_default();
135 hash_map.insert(k.into(), v.into());
136 self.custom_properties = ::std::option::Option::Some(hash_map);
137 self
138 }
139 pub fn set_custom_properties(
141 mut self,
142 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
143 ) -> Self {
144 self.custom_properties = input;
145 self
146 }
147 pub fn get_custom_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
149 &self.custom_properties
150 }
151 pub fn build(
155 self,
156 ) -> ::std::result::Result<crate::types::CustomConnectorDestinationProperties, ::aws_smithy_types::error::operation::BuildError> {
157 ::std::result::Result::Ok(crate::types::CustomConnectorDestinationProperties {
158 entity_name: self.entity_name.ok_or_else(|| {
159 ::aws_smithy_types::error::operation::BuildError::missing_field(
160 "entity_name",
161 "entity_name was not specified but it is required when building CustomConnectorDestinationProperties",
162 )
163 })?,
164 error_handling_config: self.error_handling_config,
165 write_operation_type: self.write_operation_type,
166 id_field_names: self.id_field_names,
167 custom_properties: self.custom_properties,
168 })
169 }
170}