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