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