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