{-# 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.KinesisVideo.Types.SingleMasterConfiguration 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 SingleMasterConfiguration = SingleMasterConfiguration'
{
SingleMasterConfiguration -> Maybe Natural
messageTtlSeconds :: Prelude.Maybe Prelude.Natural
}
deriving (SingleMasterConfiguration -> SingleMasterConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SingleMasterConfiguration -> SingleMasterConfiguration -> Bool
$c/= :: SingleMasterConfiguration -> SingleMasterConfiguration -> Bool
== :: SingleMasterConfiguration -> SingleMasterConfiguration -> Bool
$c== :: SingleMasterConfiguration -> SingleMasterConfiguration -> Bool
Prelude.Eq, ReadPrec [SingleMasterConfiguration]
ReadPrec SingleMasterConfiguration
Int -> ReadS SingleMasterConfiguration
ReadS [SingleMasterConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SingleMasterConfiguration]
$creadListPrec :: ReadPrec [SingleMasterConfiguration]
readPrec :: ReadPrec SingleMasterConfiguration
$creadPrec :: ReadPrec SingleMasterConfiguration
readList :: ReadS [SingleMasterConfiguration]
$creadList :: ReadS [SingleMasterConfiguration]
readsPrec :: Int -> ReadS SingleMasterConfiguration
$creadsPrec :: Int -> ReadS SingleMasterConfiguration
Prelude.Read, Int -> SingleMasterConfiguration -> ShowS
[SingleMasterConfiguration] -> ShowS
SingleMasterConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SingleMasterConfiguration] -> ShowS
$cshowList :: [SingleMasterConfiguration] -> ShowS
show :: SingleMasterConfiguration -> String
$cshow :: SingleMasterConfiguration -> String
showsPrec :: Int -> SingleMasterConfiguration -> ShowS
$cshowsPrec :: Int -> SingleMasterConfiguration -> ShowS
Prelude.Show, forall x.
Rep SingleMasterConfiguration x -> SingleMasterConfiguration
forall x.
SingleMasterConfiguration -> Rep SingleMasterConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SingleMasterConfiguration x -> SingleMasterConfiguration
$cfrom :: forall x.
SingleMasterConfiguration -> Rep SingleMasterConfiguration x
Prelude.Generic)
newSingleMasterConfiguration ::
SingleMasterConfiguration
newSingleMasterConfiguration :: SingleMasterConfiguration
newSingleMasterConfiguration =
SingleMasterConfiguration'
{ $sel:messageTtlSeconds:SingleMasterConfiguration' :: Maybe Natural
messageTtlSeconds =
forall a. Maybe a
Prelude.Nothing
}
singleMasterConfiguration_messageTtlSeconds :: Lens.Lens' SingleMasterConfiguration (Prelude.Maybe Prelude.Natural)
singleMasterConfiguration_messageTtlSeconds :: Lens' SingleMasterConfiguration (Maybe Natural)
singleMasterConfiguration_messageTtlSeconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleMasterConfiguration' {Maybe Natural
messageTtlSeconds :: Maybe Natural
$sel:messageTtlSeconds:SingleMasterConfiguration' :: SingleMasterConfiguration -> Maybe Natural
messageTtlSeconds} -> Maybe Natural
messageTtlSeconds) (\s :: SingleMasterConfiguration
s@SingleMasterConfiguration' {} Maybe Natural
a -> SingleMasterConfiguration
s {$sel:messageTtlSeconds:SingleMasterConfiguration' :: Maybe Natural
messageTtlSeconds = Maybe Natural
a} :: SingleMasterConfiguration)
instance Data.FromJSON SingleMasterConfiguration where
parseJSON :: Value -> Parser SingleMasterConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SingleMasterConfiguration"
( \Object
x ->
Maybe Natural -> SingleMasterConfiguration
SingleMasterConfiguration'
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
"MessageTtlSeconds")
)
instance Prelude.Hashable SingleMasterConfiguration where
hashWithSalt :: Int -> SingleMasterConfiguration -> Int
hashWithSalt Int
_salt SingleMasterConfiguration' {Maybe Natural
messageTtlSeconds :: Maybe Natural
$sel:messageTtlSeconds:SingleMasterConfiguration' :: SingleMasterConfiguration -> Maybe Natural
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
messageTtlSeconds
instance Prelude.NFData SingleMasterConfiguration where
rnf :: SingleMasterConfiguration -> ()
rnf SingleMasterConfiguration' {Maybe Natural
messageTtlSeconds :: Maybe Natural
$sel:messageTtlSeconds:SingleMasterConfiguration' :: SingleMasterConfiguration -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
messageTtlSeconds
instance Data.ToJSON SingleMasterConfiguration where
toJSON :: SingleMasterConfiguration -> Value
toJSON SingleMasterConfiguration' {Maybe Natural
messageTtlSeconds :: Maybe Natural
$sel:messageTtlSeconds:SingleMasterConfiguration' :: SingleMasterConfiguration -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MessageTtlSeconds" 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 Natural
messageTtlSeconds
]
)