{-# 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.DeletionConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KinesisVideo.Types.LocalSizeConfig
import qualified Amazonka.Prelude as Prelude
data DeletionConfig = DeletionConfig'
{
DeletionConfig -> Maybe Bool
deleteAfterUpload :: Prelude.Maybe Prelude.Bool,
DeletionConfig -> Maybe Natural
edgeRetentionInHours :: Prelude.Maybe Prelude.Natural,
DeletionConfig -> Maybe LocalSizeConfig
localSizeConfig :: Prelude.Maybe LocalSizeConfig
}
deriving (DeletionConfig -> DeletionConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletionConfig -> DeletionConfig -> Bool
$c/= :: DeletionConfig -> DeletionConfig -> Bool
== :: DeletionConfig -> DeletionConfig -> Bool
$c== :: DeletionConfig -> DeletionConfig -> Bool
Prelude.Eq, ReadPrec [DeletionConfig]
ReadPrec DeletionConfig
Int -> ReadS DeletionConfig
ReadS [DeletionConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeletionConfig]
$creadListPrec :: ReadPrec [DeletionConfig]
readPrec :: ReadPrec DeletionConfig
$creadPrec :: ReadPrec DeletionConfig
readList :: ReadS [DeletionConfig]
$creadList :: ReadS [DeletionConfig]
readsPrec :: Int -> ReadS DeletionConfig
$creadsPrec :: Int -> ReadS DeletionConfig
Prelude.Read, Int -> DeletionConfig -> ShowS
[DeletionConfig] -> ShowS
DeletionConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletionConfig] -> ShowS
$cshowList :: [DeletionConfig] -> ShowS
show :: DeletionConfig -> String
$cshow :: DeletionConfig -> String
showsPrec :: Int -> DeletionConfig -> ShowS
$cshowsPrec :: Int -> DeletionConfig -> ShowS
Prelude.Show, forall x. Rep DeletionConfig x -> DeletionConfig
forall x. DeletionConfig -> Rep DeletionConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeletionConfig x -> DeletionConfig
$cfrom :: forall x. DeletionConfig -> Rep DeletionConfig x
Prelude.Generic)
newDeletionConfig ::
DeletionConfig
newDeletionConfig :: DeletionConfig
newDeletionConfig =
DeletionConfig'
{ $sel:deleteAfterUpload:DeletionConfig' :: Maybe Bool
deleteAfterUpload =
forall a. Maybe a
Prelude.Nothing,
$sel:edgeRetentionInHours:DeletionConfig' :: Maybe Natural
edgeRetentionInHours = forall a. Maybe a
Prelude.Nothing,
$sel:localSizeConfig:DeletionConfig' :: Maybe LocalSizeConfig
localSizeConfig = forall a. Maybe a
Prelude.Nothing
}
deletionConfig_deleteAfterUpload :: Lens.Lens' DeletionConfig (Prelude.Maybe Prelude.Bool)
deletionConfig_deleteAfterUpload :: Lens' DeletionConfig (Maybe Bool)
deletionConfig_deleteAfterUpload = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletionConfig' {Maybe Bool
deleteAfterUpload :: Maybe Bool
$sel:deleteAfterUpload:DeletionConfig' :: DeletionConfig -> Maybe Bool
deleteAfterUpload} -> Maybe Bool
deleteAfterUpload) (\s :: DeletionConfig
s@DeletionConfig' {} Maybe Bool
a -> DeletionConfig
s {$sel:deleteAfterUpload:DeletionConfig' :: Maybe Bool
deleteAfterUpload = Maybe Bool
a} :: DeletionConfig)
deletionConfig_edgeRetentionInHours :: Lens.Lens' DeletionConfig (Prelude.Maybe Prelude.Natural)
deletionConfig_edgeRetentionInHours :: Lens' DeletionConfig (Maybe Natural)
deletionConfig_edgeRetentionInHours = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletionConfig' {Maybe Natural
edgeRetentionInHours :: Maybe Natural
$sel:edgeRetentionInHours:DeletionConfig' :: DeletionConfig -> Maybe Natural
edgeRetentionInHours} -> Maybe Natural
edgeRetentionInHours) (\s :: DeletionConfig
s@DeletionConfig' {} Maybe Natural
a -> DeletionConfig
s {$sel:edgeRetentionInHours:DeletionConfig' :: Maybe Natural
edgeRetentionInHours = Maybe Natural
a} :: DeletionConfig)
deletionConfig_localSizeConfig :: Lens.Lens' DeletionConfig (Prelude.Maybe LocalSizeConfig)
deletionConfig_localSizeConfig :: Lens' DeletionConfig (Maybe LocalSizeConfig)
deletionConfig_localSizeConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeletionConfig' {Maybe LocalSizeConfig
localSizeConfig :: Maybe LocalSizeConfig
$sel:localSizeConfig:DeletionConfig' :: DeletionConfig -> Maybe LocalSizeConfig
localSizeConfig} -> Maybe LocalSizeConfig
localSizeConfig) (\s :: DeletionConfig
s@DeletionConfig' {} Maybe LocalSizeConfig
a -> DeletionConfig
s {$sel:localSizeConfig:DeletionConfig' :: Maybe LocalSizeConfig
localSizeConfig = Maybe LocalSizeConfig
a} :: DeletionConfig)
instance Data.FromJSON DeletionConfig where
parseJSON :: Value -> Parser DeletionConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DeletionConfig"
( \Object
x ->
Maybe Bool
-> Maybe Natural -> Maybe LocalSizeConfig -> DeletionConfig
DeletionConfig'
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
"DeleteAfterUpload")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EdgeRetentionInHours")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LocalSizeConfig")
)
instance Prelude.Hashable DeletionConfig where
hashWithSalt :: Int -> DeletionConfig -> Int
hashWithSalt Int
_salt DeletionConfig' {Maybe Bool
Maybe Natural
Maybe LocalSizeConfig
localSizeConfig :: Maybe LocalSizeConfig
edgeRetentionInHours :: Maybe Natural
deleteAfterUpload :: Maybe Bool
$sel:localSizeConfig:DeletionConfig' :: DeletionConfig -> Maybe LocalSizeConfig
$sel:edgeRetentionInHours:DeletionConfig' :: DeletionConfig -> Maybe Natural
$sel:deleteAfterUpload:DeletionConfig' :: DeletionConfig -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
deleteAfterUpload
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
edgeRetentionInHours
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LocalSizeConfig
localSizeConfig
instance Prelude.NFData DeletionConfig where
rnf :: DeletionConfig -> ()
rnf DeletionConfig' {Maybe Bool
Maybe Natural
Maybe LocalSizeConfig
localSizeConfig :: Maybe LocalSizeConfig
edgeRetentionInHours :: Maybe Natural
deleteAfterUpload :: Maybe Bool
$sel:localSizeConfig:DeletionConfig' :: DeletionConfig -> Maybe LocalSizeConfig
$sel:edgeRetentionInHours:DeletionConfig' :: DeletionConfig -> Maybe Natural
$sel:deleteAfterUpload:DeletionConfig' :: DeletionConfig -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
deleteAfterUpload
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
edgeRetentionInHours
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LocalSizeConfig
localSizeConfig
instance Data.ToJSON DeletionConfig where
toJSON :: DeletionConfig -> Value
toJSON DeletionConfig' {Maybe Bool
Maybe Natural
Maybe LocalSizeConfig
localSizeConfig :: Maybe LocalSizeConfig
edgeRetentionInHours :: Maybe Natural
deleteAfterUpload :: Maybe Bool
$sel:localSizeConfig:DeletionConfig' :: DeletionConfig -> Maybe LocalSizeConfig
$sel:edgeRetentionInHours:DeletionConfig' :: DeletionConfig -> Maybe Natural
$sel:deleteAfterUpload:DeletionConfig' :: DeletionConfig -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DeleteAfterUpload" 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 Bool
deleteAfterUpload,
(Key
"EdgeRetentionInHours" 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
edgeRetentionInHours,
(Key
"LocalSizeConfig" 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 LocalSizeConfig
localSizeConfig
]
)