{-# 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.SnapStart where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lambda.Types.SnapStartApplyOn
import qualified Amazonka.Prelude as Prelude
data SnapStart = SnapStart'
{
SnapStart -> Maybe SnapStartApplyOn
applyOn :: Prelude.Maybe SnapStartApplyOn
}
deriving (SnapStart -> SnapStart -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SnapStart -> SnapStart -> Bool
$c/= :: SnapStart -> SnapStart -> Bool
== :: SnapStart -> SnapStart -> Bool
$c== :: SnapStart -> SnapStart -> Bool
Prelude.Eq, ReadPrec [SnapStart]
ReadPrec SnapStart
Int -> ReadS SnapStart
ReadS [SnapStart]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SnapStart]
$creadListPrec :: ReadPrec [SnapStart]
readPrec :: ReadPrec SnapStart
$creadPrec :: ReadPrec SnapStart
readList :: ReadS [SnapStart]
$creadList :: ReadS [SnapStart]
readsPrec :: Int -> ReadS SnapStart
$creadsPrec :: Int -> ReadS SnapStart
Prelude.Read, Int -> SnapStart -> ShowS
[SnapStart] -> ShowS
SnapStart -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SnapStart] -> ShowS
$cshowList :: [SnapStart] -> ShowS
show :: SnapStart -> String
$cshow :: SnapStart -> String
showsPrec :: Int -> SnapStart -> ShowS
$cshowsPrec :: Int -> SnapStart -> ShowS
Prelude.Show, forall x. Rep SnapStart x -> SnapStart
forall x. SnapStart -> Rep SnapStart x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SnapStart x -> SnapStart
$cfrom :: forall x. SnapStart -> Rep SnapStart x
Prelude.Generic)
newSnapStart ::
SnapStart
newSnapStart :: SnapStart
newSnapStart = SnapStart' {$sel:applyOn:SnapStart' :: Maybe SnapStartApplyOn
applyOn = forall a. Maybe a
Prelude.Nothing}
snapStart_applyOn :: Lens.Lens' SnapStart (Prelude.Maybe SnapStartApplyOn)
snapStart_applyOn :: Lens' SnapStart (Maybe SnapStartApplyOn)
snapStart_applyOn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapStart' {Maybe SnapStartApplyOn
applyOn :: Maybe SnapStartApplyOn
$sel:applyOn:SnapStart' :: SnapStart -> Maybe SnapStartApplyOn
applyOn} -> Maybe SnapStartApplyOn
applyOn) (\s :: SnapStart
s@SnapStart' {} Maybe SnapStartApplyOn
a -> SnapStart
s {$sel:applyOn:SnapStart' :: Maybe SnapStartApplyOn
applyOn = Maybe SnapStartApplyOn
a} :: SnapStart)
instance Prelude.Hashable SnapStart where
hashWithSalt :: Int -> SnapStart -> Int
hashWithSalt Int
_salt SnapStart' {Maybe SnapStartApplyOn
applyOn :: Maybe SnapStartApplyOn
$sel:applyOn:SnapStart' :: SnapStart -> Maybe SnapStartApplyOn
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SnapStartApplyOn
applyOn
instance Prelude.NFData SnapStart where
rnf :: SnapStart -> ()
rnf SnapStart' {Maybe SnapStartApplyOn
applyOn :: Maybe SnapStartApplyOn
$sel:applyOn:SnapStart' :: SnapStart -> Maybe SnapStartApplyOn
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe SnapStartApplyOn
applyOn
instance Data.ToJSON SnapStart where
toJSON :: SnapStart -> Value
toJSON SnapStart' {Maybe SnapStartApplyOn
applyOn :: Maybe SnapStartApplyOn
$sel:applyOn:SnapStart' :: SnapStart -> Maybe SnapStartApplyOn
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"ApplyOn" 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 SnapStartApplyOn
applyOn]
)