{-# 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.Glue.Types.TriggerUpdate where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.Action
import Amazonka.Glue.Types.EventBatchingCondition
import Amazonka.Glue.Types.Predicate
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TriggerUpdate = TriggerUpdate'
{
TriggerUpdate -> Maybe [Action]
actions :: Prelude.Maybe [Action],
TriggerUpdate -> Maybe Text
schedule :: Prelude.Maybe Prelude.Text,
TriggerUpdate -> Maybe Predicate
predicate :: Prelude.Maybe Predicate,
TriggerUpdate -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
TriggerUpdate -> Maybe EventBatchingCondition
eventBatchingCondition :: Prelude.Maybe EventBatchingCondition,
TriggerUpdate -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (TriggerUpdate -> TriggerUpdate -> Bool
(TriggerUpdate -> TriggerUpdate -> Bool)
-> (TriggerUpdate -> TriggerUpdate -> Bool) -> Eq TriggerUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TriggerUpdate -> TriggerUpdate -> Bool
$c/= :: TriggerUpdate -> TriggerUpdate -> Bool
== :: TriggerUpdate -> TriggerUpdate -> Bool
$c== :: TriggerUpdate -> TriggerUpdate -> Bool
Prelude.Eq, ReadPrec [TriggerUpdate]
ReadPrec TriggerUpdate
Int -> ReadS TriggerUpdate
ReadS [TriggerUpdate]
(Int -> ReadS TriggerUpdate)
-> ReadS [TriggerUpdate]
-> ReadPrec TriggerUpdate
-> ReadPrec [TriggerUpdate]
-> Read TriggerUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TriggerUpdate]
$creadListPrec :: ReadPrec [TriggerUpdate]
readPrec :: ReadPrec TriggerUpdate
$creadPrec :: ReadPrec TriggerUpdate
readList :: ReadS [TriggerUpdate]
$creadList :: ReadS [TriggerUpdate]
readsPrec :: Int -> ReadS TriggerUpdate
$creadsPrec :: Int -> ReadS TriggerUpdate
Prelude.Read, Int -> TriggerUpdate -> ShowS
[TriggerUpdate] -> ShowS
TriggerUpdate -> String
(Int -> TriggerUpdate -> ShowS)
-> (TriggerUpdate -> String)
-> ([TriggerUpdate] -> ShowS)
-> Show TriggerUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TriggerUpdate] -> ShowS
$cshowList :: [TriggerUpdate] -> ShowS
show :: TriggerUpdate -> String
$cshow :: TriggerUpdate -> String
showsPrec :: Int -> TriggerUpdate -> ShowS
$cshowsPrec :: Int -> TriggerUpdate -> ShowS
Prelude.Show, (forall x. TriggerUpdate -> Rep TriggerUpdate x)
-> (forall x. Rep TriggerUpdate x -> TriggerUpdate)
-> Generic TriggerUpdate
forall x. Rep TriggerUpdate x -> TriggerUpdate
forall x. TriggerUpdate -> Rep TriggerUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TriggerUpdate x -> TriggerUpdate
$cfrom :: forall x. TriggerUpdate -> Rep TriggerUpdate x
Prelude.Generic)
newTriggerUpdate ::
TriggerUpdate
newTriggerUpdate :: TriggerUpdate
newTriggerUpdate =
TriggerUpdate' :: Maybe [Action]
-> Maybe Text
-> Maybe Predicate
-> Maybe Text
-> Maybe EventBatchingCondition
-> Maybe Text
-> TriggerUpdate
TriggerUpdate'
{ $sel:actions:TriggerUpdate' :: Maybe [Action]
actions = Maybe [Action]
forall a. Maybe a
Prelude.Nothing,
$sel:schedule:TriggerUpdate' :: Maybe Text
schedule = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:predicate:TriggerUpdate' :: Maybe Predicate
predicate = Maybe Predicate
forall a. Maybe a
Prelude.Nothing,
$sel:name:TriggerUpdate' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:eventBatchingCondition:TriggerUpdate' :: Maybe EventBatchingCondition
eventBatchingCondition = Maybe EventBatchingCondition
forall a. Maybe a
Prelude.Nothing,
$sel:description:TriggerUpdate' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
triggerUpdate_actions :: Lens.Lens' TriggerUpdate (Prelude.Maybe [Action])
triggerUpdate_actions :: (Maybe [Action] -> f (Maybe [Action]))
-> TriggerUpdate -> f TriggerUpdate
triggerUpdate_actions = (TriggerUpdate -> Maybe [Action])
-> (TriggerUpdate -> Maybe [Action] -> TriggerUpdate)
-> Lens
TriggerUpdate TriggerUpdate (Maybe [Action]) (Maybe [Action])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TriggerUpdate' {Maybe [Action]
actions :: Maybe [Action]
$sel:actions:TriggerUpdate' :: TriggerUpdate -> Maybe [Action]
actions} -> Maybe [Action]
actions) (\s :: TriggerUpdate
s@TriggerUpdate' {} Maybe [Action]
a -> TriggerUpdate
s {$sel:actions:TriggerUpdate' :: Maybe [Action]
actions = Maybe [Action]
a} :: TriggerUpdate) ((Maybe [Action] -> f (Maybe [Action]))
-> TriggerUpdate -> f TriggerUpdate)
-> ((Maybe [Action] -> f (Maybe [Action]))
-> Maybe [Action] -> f (Maybe [Action]))
-> (Maybe [Action] -> f (Maybe [Action]))
-> TriggerUpdate
-> f TriggerUpdate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Action] [Action] [Action] [Action]
-> Iso
(Maybe [Action]) (Maybe [Action]) (Maybe [Action]) (Maybe [Action])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Action] [Action] [Action] [Action]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
triggerUpdate_schedule :: Lens.Lens' TriggerUpdate (Prelude.Maybe Prelude.Text)
triggerUpdate_schedule :: (Maybe Text -> f (Maybe Text)) -> TriggerUpdate -> f TriggerUpdate
triggerUpdate_schedule = (TriggerUpdate -> Maybe Text)
-> (TriggerUpdate -> Maybe Text -> TriggerUpdate)
-> Lens TriggerUpdate TriggerUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TriggerUpdate' {Maybe Text
schedule :: Maybe Text
$sel:schedule:TriggerUpdate' :: TriggerUpdate -> Maybe Text
schedule} -> Maybe Text
schedule) (\s :: TriggerUpdate
s@TriggerUpdate' {} Maybe Text
a -> TriggerUpdate
s {$sel:schedule:TriggerUpdate' :: Maybe Text
schedule = Maybe Text
a} :: TriggerUpdate)
triggerUpdate_predicate :: Lens.Lens' TriggerUpdate (Prelude.Maybe Predicate)
triggerUpdate_predicate :: (Maybe Predicate -> f (Maybe Predicate))
-> TriggerUpdate -> f TriggerUpdate
triggerUpdate_predicate = (TriggerUpdate -> Maybe Predicate)
-> (TriggerUpdate -> Maybe Predicate -> TriggerUpdate)
-> Lens
TriggerUpdate TriggerUpdate (Maybe Predicate) (Maybe Predicate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TriggerUpdate' {Maybe Predicate
predicate :: Maybe Predicate
$sel:predicate:TriggerUpdate' :: TriggerUpdate -> Maybe Predicate
predicate} -> Maybe Predicate
predicate) (\s :: TriggerUpdate
s@TriggerUpdate' {} Maybe Predicate
a -> TriggerUpdate
s {$sel:predicate:TriggerUpdate' :: Maybe Predicate
predicate = Maybe Predicate
a} :: TriggerUpdate)
triggerUpdate_name :: Lens.Lens' TriggerUpdate (Prelude.Maybe Prelude.Text)
triggerUpdate_name :: (Maybe Text -> f (Maybe Text)) -> TriggerUpdate -> f TriggerUpdate
triggerUpdate_name = (TriggerUpdate -> Maybe Text)
-> (TriggerUpdate -> Maybe Text -> TriggerUpdate)
-> Lens TriggerUpdate TriggerUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TriggerUpdate' {Maybe Text
name :: Maybe Text
$sel:name:TriggerUpdate' :: TriggerUpdate -> Maybe Text
name} -> Maybe Text
name) (\s :: TriggerUpdate
s@TriggerUpdate' {} Maybe Text
a -> TriggerUpdate
s {$sel:name:TriggerUpdate' :: Maybe Text
name = Maybe Text
a} :: TriggerUpdate)
triggerUpdate_eventBatchingCondition :: Lens.Lens' TriggerUpdate (Prelude.Maybe EventBatchingCondition)
triggerUpdate_eventBatchingCondition :: (Maybe EventBatchingCondition -> f (Maybe EventBatchingCondition))
-> TriggerUpdate -> f TriggerUpdate
triggerUpdate_eventBatchingCondition = (TriggerUpdate -> Maybe EventBatchingCondition)
-> (TriggerUpdate -> Maybe EventBatchingCondition -> TriggerUpdate)
-> Lens
TriggerUpdate
TriggerUpdate
(Maybe EventBatchingCondition)
(Maybe EventBatchingCondition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TriggerUpdate' {Maybe EventBatchingCondition
eventBatchingCondition :: Maybe EventBatchingCondition
$sel:eventBatchingCondition:TriggerUpdate' :: TriggerUpdate -> Maybe EventBatchingCondition
eventBatchingCondition} -> Maybe EventBatchingCondition
eventBatchingCondition) (\s :: TriggerUpdate
s@TriggerUpdate' {} Maybe EventBatchingCondition
a -> TriggerUpdate
s {$sel:eventBatchingCondition:TriggerUpdate' :: Maybe EventBatchingCondition
eventBatchingCondition = Maybe EventBatchingCondition
a} :: TriggerUpdate)
triggerUpdate_description :: Lens.Lens' TriggerUpdate (Prelude.Maybe Prelude.Text)
triggerUpdate_description :: (Maybe Text -> f (Maybe Text)) -> TriggerUpdate -> f TriggerUpdate
triggerUpdate_description = (TriggerUpdate -> Maybe Text)
-> (TriggerUpdate -> Maybe Text -> TriggerUpdate)
-> Lens TriggerUpdate TriggerUpdate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TriggerUpdate' {Maybe Text
description :: Maybe Text
$sel:description:TriggerUpdate' :: TriggerUpdate -> Maybe Text
description} -> Maybe Text
description) (\s :: TriggerUpdate
s@TriggerUpdate' {} Maybe Text
a -> TriggerUpdate
s {$sel:description:TriggerUpdate' :: Maybe Text
description = Maybe Text
a} :: TriggerUpdate)
instance Prelude.Hashable TriggerUpdate
instance Prelude.NFData TriggerUpdate
instance Core.ToJSON TriggerUpdate where
toJSON :: TriggerUpdate -> Value
toJSON TriggerUpdate' {Maybe [Action]
Maybe Text
Maybe EventBatchingCondition
Maybe Predicate
description :: Maybe Text
eventBatchingCondition :: Maybe EventBatchingCondition
name :: Maybe Text
predicate :: Maybe Predicate
schedule :: Maybe Text
actions :: Maybe [Action]
$sel:description:TriggerUpdate' :: TriggerUpdate -> Maybe Text
$sel:eventBatchingCondition:TriggerUpdate' :: TriggerUpdate -> Maybe EventBatchingCondition
$sel:name:TriggerUpdate' :: TriggerUpdate -> Maybe Text
$sel:predicate:TriggerUpdate' :: TriggerUpdate -> Maybe Predicate
$sel:schedule:TriggerUpdate' :: TriggerUpdate -> Maybe Text
$sel:actions:TriggerUpdate' :: TriggerUpdate -> Maybe [Action]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Actions" Text -> [Action] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Action] -> Pair) -> Maybe [Action] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Action]
actions,
(Text
"Schedule" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
schedule,
(Text
"Predicate" Text -> Predicate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Predicate -> Pair) -> Maybe Predicate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Predicate
predicate,
(Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Text
"EventBatchingCondition" Text -> EventBatchingCondition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(EventBatchingCondition -> Pair)
-> Maybe EventBatchingCondition -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EventBatchingCondition
eventBatchingCondition,
(Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description
]
)