Skip to main content

aws_sdk_appflow/types/
_event_bridge_destination_properties.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The properties that are applied when Amazon EventBridge is being used as a destination.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct EventBridgeDestinationProperties {
7    /// <p>The object specified in the Amazon EventBridge flow destination.</p>
8    pub object: ::std::string::String,
9    /// <p>The settings that determine how Amazon AppFlow handles an error when placing data in the destination. For example, this setting would determine if the flow should fail after one insertion error, or continue and attempt to insert every record regardless of the initial failure. <code>ErrorHandlingConfig</code> is a part of the destination connector details.</p>
10    pub error_handling_config: ::std::option::Option<crate::types::ErrorHandlingConfig>,
11}
12impl EventBridgeDestinationProperties {
13    /// <p>The object specified in the Amazon EventBridge flow destination.</p>
14    pub fn object(&self) -> &str {
15        use std::ops::Deref;
16        self.object.deref()
17    }
18    /// <p>The settings that determine how Amazon AppFlow handles an error when placing data in the destination. For example, this setting would determine if the flow should fail after one insertion error, or continue and attempt to insert every record regardless of the initial failure. <code>ErrorHandlingConfig</code> is a part of the destination connector details.</p>
19    pub fn error_handling_config(&self) -> ::std::option::Option<&crate::types::ErrorHandlingConfig> {
20        self.error_handling_config.as_ref()
21    }
22}
23impl EventBridgeDestinationProperties {
24    /// Creates a new builder-style object to manufacture [`EventBridgeDestinationProperties`](crate::types::EventBridgeDestinationProperties).
25    pub fn builder() -> crate::types::builders::EventBridgeDestinationPropertiesBuilder {
26        crate::types::builders::EventBridgeDestinationPropertiesBuilder::default()
27    }
28}
29
30/// A builder for [`EventBridgeDestinationProperties`](crate::types::EventBridgeDestinationProperties).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct EventBridgeDestinationPropertiesBuilder {
34    pub(crate) object: ::std::option::Option<::std::string::String>,
35    pub(crate) error_handling_config: ::std::option::Option<crate::types::ErrorHandlingConfig>,
36}
37impl EventBridgeDestinationPropertiesBuilder {
38    /// <p>The object specified in the Amazon EventBridge flow destination.</p>
39    /// This field is required.
40    pub fn object(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.object = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The object specified in the Amazon EventBridge flow destination.</p>
45    pub fn set_object(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.object = input;
47        self
48    }
49    /// <p>The object specified in the Amazon EventBridge flow destination.</p>
50    pub fn get_object(&self) -> &::std::option::Option<::std::string::String> {
51        &self.object
52    }
53    /// <p>The settings that determine how Amazon AppFlow handles an error when placing data in the destination. For example, this setting would determine if the flow should fail after one insertion error, or continue and attempt to insert every record regardless of the initial failure. <code>ErrorHandlingConfig</code> is a part of the destination connector details.</p>
54    pub fn error_handling_config(mut self, input: crate::types::ErrorHandlingConfig) -> Self {
55        self.error_handling_config = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>The settings that determine how Amazon AppFlow handles an error when placing data in the destination. For example, this setting would determine if the flow should fail after one insertion error, or continue and attempt to insert every record regardless of the initial failure. <code>ErrorHandlingConfig</code> is a part of the destination connector details.</p>
59    pub fn set_error_handling_config(mut self, input: ::std::option::Option<crate::types::ErrorHandlingConfig>) -> Self {
60        self.error_handling_config = input;
61        self
62    }
63    /// <p>The settings that determine how Amazon AppFlow handles an error when placing data in the destination. For example, this setting would determine if the flow should fail after one insertion error, or continue and attempt to insert every record regardless of the initial failure. <code>ErrorHandlingConfig</code> is a part of the destination connector details.</p>
64    pub fn get_error_handling_config(&self) -> &::std::option::Option<crate::types::ErrorHandlingConfig> {
65        &self.error_handling_config
66    }
67    /// Consumes the builder and constructs a [`EventBridgeDestinationProperties`](crate::types::EventBridgeDestinationProperties).
68    /// This method will fail if any of the following fields are not set:
69    /// - [`object`](crate::types::builders::EventBridgeDestinationPropertiesBuilder::object)
70    pub fn build(self) -> ::std::result::Result<crate::types::EventBridgeDestinationProperties, ::aws_smithy_types::error::operation::BuildError> {
71        ::std::result::Result::Ok(crate::types::EventBridgeDestinationProperties {
72            object: self.object.ok_or_else(|| {
73                ::aws_smithy_types::error::operation::BuildError::missing_field(
74                    "object",
75                    "object was not specified but it is required when building EventBridgeDestinationProperties",
76                )
77            })?,
78            error_handling_config: self.error_handling_config,
79        })
80    }
81}