{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.AppFlow.Types.EventBridgeDestinationProperties where
import Amazonka.AppFlow.Types.ErrorHandlingConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EventBridgeDestinationProperties = EventBridgeDestinationProperties'
{ EventBridgeDestinationProperties -> Maybe ErrorHandlingConfig
errorHandlingConfig :: Prelude.Maybe ErrorHandlingConfig,
EventBridgeDestinationProperties -> Text
object' :: Prelude.Text
}
deriving (EventBridgeDestinationProperties
-> EventBridgeDestinationProperties -> Bool
(EventBridgeDestinationProperties
-> EventBridgeDestinationProperties -> Bool)
-> (EventBridgeDestinationProperties
-> EventBridgeDestinationProperties -> Bool)
-> Eq EventBridgeDestinationProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventBridgeDestinationProperties
-> EventBridgeDestinationProperties -> Bool
$c/= :: EventBridgeDestinationProperties
-> EventBridgeDestinationProperties -> Bool
== :: EventBridgeDestinationProperties
-> EventBridgeDestinationProperties -> Bool
$c== :: EventBridgeDestinationProperties
-> EventBridgeDestinationProperties -> Bool
Prelude.Eq, ReadPrec [EventBridgeDestinationProperties]
ReadPrec EventBridgeDestinationProperties
Int -> ReadS EventBridgeDestinationProperties
ReadS [EventBridgeDestinationProperties]
(Int -> ReadS EventBridgeDestinationProperties)
-> ReadS [EventBridgeDestinationProperties]
-> ReadPrec EventBridgeDestinationProperties
-> ReadPrec [EventBridgeDestinationProperties]
-> Read EventBridgeDestinationProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventBridgeDestinationProperties]
$creadListPrec :: ReadPrec [EventBridgeDestinationProperties]
readPrec :: ReadPrec EventBridgeDestinationProperties
$creadPrec :: ReadPrec EventBridgeDestinationProperties
readList :: ReadS [EventBridgeDestinationProperties]
$creadList :: ReadS [EventBridgeDestinationProperties]
readsPrec :: Int -> ReadS EventBridgeDestinationProperties
$creadsPrec :: Int -> ReadS EventBridgeDestinationProperties
Prelude.Read, Int -> EventBridgeDestinationProperties -> ShowS
[EventBridgeDestinationProperties] -> ShowS
EventBridgeDestinationProperties -> String
(Int -> EventBridgeDestinationProperties -> ShowS)
-> (EventBridgeDestinationProperties -> String)
-> ([EventBridgeDestinationProperties] -> ShowS)
-> Show EventBridgeDestinationProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventBridgeDestinationProperties] -> ShowS
$cshowList :: [EventBridgeDestinationProperties] -> ShowS
show :: EventBridgeDestinationProperties -> String
$cshow :: EventBridgeDestinationProperties -> String
showsPrec :: Int -> EventBridgeDestinationProperties -> ShowS
$cshowsPrec :: Int -> EventBridgeDestinationProperties -> ShowS
Prelude.Show, (forall x.
EventBridgeDestinationProperties
-> Rep EventBridgeDestinationProperties x)
-> (forall x.
Rep EventBridgeDestinationProperties x
-> EventBridgeDestinationProperties)
-> Generic EventBridgeDestinationProperties
forall x.
Rep EventBridgeDestinationProperties x
-> EventBridgeDestinationProperties
forall x.
EventBridgeDestinationProperties
-> Rep EventBridgeDestinationProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EventBridgeDestinationProperties x
-> EventBridgeDestinationProperties
$cfrom :: forall x.
EventBridgeDestinationProperties
-> Rep EventBridgeDestinationProperties x
Prelude.Generic)
newEventBridgeDestinationProperties ::
Prelude.Text ->
EventBridgeDestinationProperties
newEventBridgeDestinationProperties :: Text -> EventBridgeDestinationProperties
newEventBridgeDestinationProperties Text
pObject_ =
EventBridgeDestinationProperties' :: Maybe ErrorHandlingConfig
-> Text -> EventBridgeDestinationProperties
EventBridgeDestinationProperties'
{ $sel:errorHandlingConfig:EventBridgeDestinationProperties' :: Maybe ErrorHandlingConfig
errorHandlingConfig =
Maybe ErrorHandlingConfig
forall a. Maybe a
Prelude.Nothing,
$sel:object':EventBridgeDestinationProperties' :: Text
object' = Text
pObject_
}
eventBridgeDestinationProperties_errorHandlingConfig :: Lens.Lens' EventBridgeDestinationProperties (Prelude.Maybe ErrorHandlingConfig)
eventBridgeDestinationProperties_errorHandlingConfig :: (Maybe ErrorHandlingConfig -> f (Maybe ErrorHandlingConfig))
-> EventBridgeDestinationProperties
-> f EventBridgeDestinationProperties
eventBridgeDestinationProperties_errorHandlingConfig = (EventBridgeDestinationProperties -> Maybe ErrorHandlingConfig)
-> (EventBridgeDestinationProperties
-> Maybe ErrorHandlingConfig -> EventBridgeDestinationProperties)
-> Lens
EventBridgeDestinationProperties
EventBridgeDestinationProperties
(Maybe ErrorHandlingConfig)
(Maybe ErrorHandlingConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventBridgeDestinationProperties' {Maybe ErrorHandlingConfig
errorHandlingConfig :: Maybe ErrorHandlingConfig
$sel:errorHandlingConfig:EventBridgeDestinationProperties' :: EventBridgeDestinationProperties -> Maybe ErrorHandlingConfig
errorHandlingConfig} -> Maybe ErrorHandlingConfig
errorHandlingConfig) (\s :: EventBridgeDestinationProperties
s@EventBridgeDestinationProperties' {} Maybe ErrorHandlingConfig
a -> EventBridgeDestinationProperties
s {$sel:errorHandlingConfig:EventBridgeDestinationProperties' :: Maybe ErrorHandlingConfig
errorHandlingConfig = Maybe ErrorHandlingConfig
a} :: EventBridgeDestinationProperties)
eventBridgeDestinationProperties_object :: Lens.Lens' EventBridgeDestinationProperties Prelude.Text
eventBridgeDestinationProperties_object :: (Text -> f Text)
-> EventBridgeDestinationProperties
-> f EventBridgeDestinationProperties
eventBridgeDestinationProperties_object = (EventBridgeDestinationProperties -> Text)
-> (EventBridgeDestinationProperties
-> Text -> EventBridgeDestinationProperties)
-> Lens
EventBridgeDestinationProperties
EventBridgeDestinationProperties
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventBridgeDestinationProperties' {Text
object' :: Text
$sel:object':EventBridgeDestinationProperties' :: EventBridgeDestinationProperties -> Text
object'} -> Text
object') (\s :: EventBridgeDestinationProperties
s@EventBridgeDestinationProperties' {} Text
a -> EventBridgeDestinationProperties
s {$sel:object':EventBridgeDestinationProperties' :: Text
object' = Text
a} :: EventBridgeDestinationProperties)
instance
Core.FromJSON
EventBridgeDestinationProperties
where
parseJSON :: Value -> Parser EventBridgeDestinationProperties
parseJSON =
String
-> (Object -> Parser EventBridgeDestinationProperties)
-> Value
-> Parser EventBridgeDestinationProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EventBridgeDestinationProperties"
( \Object
x ->
Maybe ErrorHandlingConfig
-> Text -> EventBridgeDestinationProperties
EventBridgeDestinationProperties'
(Maybe ErrorHandlingConfig
-> Text -> EventBridgeDestinationProperties)
-> Parser (Maybe ErrorHandlingConfig)
-> Parser (Text -> EventBridgeDestinationProperties)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ErrorHandlingConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorHandlingConfig")
Parser (Text -> EventBridgeDestinationProperties)
-> Parser Text -> Parser EventBridgeDestinationProperties
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"object")
)
instance
Prelude.Hashable
EventBridgeDestinationProperties
instance
Prelude.NFData
EventBridgeDestinationProperties
instance Core.ToJSON EventBridgeDestinationProperties where
toJSON :: EventBridgeDestinationProperties -> Value
toJSON EventBridgeDestinationProperties' {Maybe ErrorHandlingConfig
Text
object' :: Text
errorHandlingConfig :: Maybe ErrorHandlingConfig
$sel:object':EventBridgeDestinationProperties' :: EventBridgeDestinationProperties -> Text
$sel:errorHandlingConfig:EventBridgeDestinationProperties' :: EventBridgeDestinationProperties -> Maybe ErrorHandlingConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"errorHandlingConfig" Text -> ErrorHandlingConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ErrorHandlingConfig -> Pair)
-> Maybe ErrorHandlingConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ErrorHandlingConfig
errorHandlingConfig,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"object" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
object')
]
)