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