{-# 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.Lambda.Types.OnSuccess where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data OnSuccess = OnSuccess'
{
OnSuccess -> Maybe Text
destination :: Prelude.Maybe Prelude.Text
}
deriving (OnSuccess -> OnSuccess -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OnSuccess -> OnSuccess -> Bool
$c/= :: OnSuccess -> OnSuccess -> Bool
== :: OnSuccess -> OnSuccess -> Bool
$c== :: OnSuccess -> OnSuccess -> Bool
Prelude.Eq, ReadPrec [OnSuccess]
ReadPrec OnSuccess
Int -> ReadS OnSuccess
ReadS [OnSuccess]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OnSuccess]
$creadListPrec :: ReadPrec [OnSuccess]
readPrec :: ReadPrec OnSuccess
$creadPrec :: ReadPrec OnSuccess
readList :: ReadS [OnSuccess]
$creadList :: ReadS [OnSuccess]
readsPrec :: Int -> ReadS OnSuccess
$creadsPrec :: Int -> ReadS OnSuccess
Prelude.Read, Int -> OnSuccess -> ShowS
[OnSuccess] -> ShowS
OnSuccess -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OnSuccess] -> ShowS
$cshowList :: [OnSuccess] -> ShowS
show :: OnSuccess -> String
$cshow :: OnSuccess -> String
showsPrec :: Int -> OnSuccess -> ShowS
$cshowsPrec :: Int -> OnSuccess -> ShowS
Prelude.Show, forall x. Rep OnSuccess x -> OnSuccess
forall x. OnSuccess -> Rep OnSuccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OnSuccess x -> OnSuccess
$cfrom :: forall x. OnSuccess -> Rep OnSuccess x
Prelude.Generic)
newOnSuccess ::
OnSuccess
newOnSuccess :: OnSuccess
newOnSuccess =
OnSuccess' {$sel:destination:OnSuccess' :: Maybe Text
destination = forall a. Maybe a
Prelude.Nothing}
onSuccess_destination :: Lens.Lens' OnSuccess (Prelude.Maybe Prelude.Text)
onSuccess_destination :: Lens' OnSuccess (Maybe Text)
onSuccess_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OnSuccess' {Maybe Text
destination :: Maybe Text
$sel:destination:OnSuccess' :: OnSuccess -> Maybe Text
destination} -> Maybe Text
destination) (\s :: OnSuccess
s@OnSuccess' {} Maybe Text
a -> OnSuccess
s {$sel:destination:OnSuccess' :: Maybe Text
destination = Maybe Text
a} :: OnSuccess)
instance Data.FromJSON OnSuccess where
parseJSON :: Value -> Parser OnSuccess
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"OnSuccess"
( \Object
x ->
Maybe Text -> OnSuccess
OnSuccess' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Destination")
)
instance Prelude.Hashable OnSuccess where
hashWithSalt :: Int -> OnSuccess -> Int
hashWithSalt Int
_salt OnSuccess' {Maybe Text
destination :: Maybe Text
$sel:destination:OnSuccess' :: OnSuccess -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destination
instance Prelude.NFData OnSuccess where
rnf :: OnSuccess -> ()
rnf OnSuccess' {Maybe Text
destination :: Maybe Text
$sel:destination:OnSuccess' :: OnSuccess -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
destination
instance Data.ToJSON OnSuccess where
toJSON :: OnSuccess -> Value
toJSON OnSuccess' {Maybe Text
destination :: Maybe Text
$sel:destination:OnSuccess' :: OnSuccess -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"Destination" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
destination]
)