{-# 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.MediaLive.Types.ArchiveGroupSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.ArchiveCdnSettings
import Amazonka.MediaLive.Types.OutputLocationRef
import qualified Amazonka.Prelude as Prelude
data ArchiveGroupSettings = ArchiveGroupSettings'
{
ArchiveGroupSettings -> Maybe ArchiveCdnSettings
archiveCdnSettings :: Prelude.Maybe ArchiveCdnSettings,
ArchiveGroupSettings -> Maybe Natural
rolloverInterval :: Prelude.Maybe Prelude.Natural,
ArchiveGroupSettings -> OutputLocationRef
destination :: OutputLocationRef
}
deriving (ArchiveGroupSettings -> ArchiveGroupSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ArchiveGroupSettings -> ArchiveGroupSettings -> Bool
$c/= :: ArchiveGroupSettings -> ArchiveGroupSettings -> Bool
== :: ArchiveGroupSettings -> ArchiveGroupSettings -> Bool
$c== :: ArchiveGroupSettings -> ArchiveGroupSettings -> Bool
Prelude.Eq, ReadPrec [ArchiveGroupSettings]
ReadPrec ArchiveGroupSettings
Int -> ReadS ArchiveGroupSettings
ReadS [ArchiveGroupSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ArchiveGroupSettings]
$creadListPrec :: ReadPrec [ArchiveGroupSettings]
readPrec :: ReadPrec ArchiveGroupSettings
$creadPrec :: ReadPrec ArchiveGroupSettings
readList :: ReadS [ArchiveGroupSettings]
$creadList :: ReadS [ArchiveGroupSettings]
readsPrec :: Int -> ReadS ArchiveGroupSettings
$creadsPrec :: Int -> ReadS ArchiveGroupSettings
Prelude.Read, Int -> ArchiveGroupSettings -> ShowS
[ArchiveGroupSettings] -> ShowS
ArchiveGroupSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ArchiveGroupSettings] -> ShowS
$cshowList :: [ArchiveGroupSettings] -> ShowS
show :: ArchiveGroupSettings -> String
$cshow :: ArchiveGroupSettings -> String
showsPrec :: Int -> ArchiveGroupSettings -> ShowS
$cshowsPrec :: Int -> ArchiveGroupSettings -> ShowS
Prelude.Show, forall x. Rep ArchiveGroupSettings x -> ArchiveGroupSettings
forall x. ArchiveGroupSettings -> Rep ArchiveGroupSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ArchiveGroupSettings x -> ArchiveGroupSettings
$cfrom :: forall x. ArchiveGroupSettings -> Rep ArchiveGroupSettings x
Prelude.Generic)
newArchiveGroupSettings ::
OutputLocationRef ->
ArchiveGroupSettings
newArchiveGroupSettings :: OutputLocationRef -> ArchiveGroupSettings
newArchiveGroupSettings OutputLocationRef
pDestination_ =
ArchiveGroupSettings'
{ $sel:archiveCdnSettings:ArchiveGroupSettings' :: Maybe ArchiveCdnSettings
archiveCdnSettings =
forall a. Maybe a
Prelude.Nothing,
$sel:rolloverInterval:ArchiveGroupSettings' :: Maybe Natural
rolloverInterval = forall a. Maybe a
Prelude.Nothing,
$sel:destination:ArchiveGroupSettings' :: OutputLocationRef
destination = OutputLocationRef
pDestination_
}
archiveGroupSettings_archiveCdnSettings :: Lens.Lens' ArchiveGroupSettings (Prelude.Maybe ArchiveCdnSettings)
archiveGroupSettings_archiveCdnSettings :: Lens' ArchiveGroupSettings (Maybe ArchiveCdnSettings)
archiveGroupSettings_archiveCdnSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArchiveGroupSettings' {Maybe ArchiveCdnSettings
archiveCdnSettings :: Maybe ArchiveCdnSettings
$sel:archiveCdnSettings:ArchiveGroupSettings' :: ArchiveGroupSettings -> Maybe ArchiveCdnSettings
archiveCdnSettings} -> Maybe ArchiveCdnSettings
archiveCdnSettings) (\s :: ArchiveGroupSettings
s@ArchiveGroupSettings' {} Maybe ArchiveCdnSettings
a -> ArchiveGroupSettings
s {$sel:archiveCdnSettings:ArchiveGroupSettings' :: Maybe ArchiveCdnSettings
archiveCdnSettings = Maybe ArchiveCdnSettings
a} :: ArchiveGroupSettings)
archiveGroupSettings_rolloverInterval :: Lens.Lens' ArchiveGroupSettings (Prelude.Maybe Prelude.Natural)
archiveGroupSettings_rolloverInterval :: Lens' ArchiveGroupSettings (Maybe Natural)
archiveGroupSettings_rolloverInterval = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArchiveGroupSettings' {Maybe Natural
rolloverInterval :: Maybe Natural
$sel:rolloverInterval:ArchiveGroupSettings' :: ArchiveGroupSettings -> Maybe Natural
rolloverInterval} -> Maybe Natural
rolloverInterval) (\s :: ArchiveGroupSettings
s@ArchiveGroupSettings' {} Maybe Natural
a -> ArchiveGroupSettings
s {$sel:rolloverInterval:ArchiveGroupSettings' :: Maybe Natural
rolloverInterval = Maybe Natural
a} :: ArchiveGroupSettings)
archiveGroupSettings_destination :: Lens.Lens' ArchiveGroupSettings OutputLocationRef
archiveGroupSettings_destination :: Lens' ArchiveGroupSettings OutputLocationRef
archiveGroupSettings_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArchiveGroupSettings' {OutputLocationRef
destination :: OutputLocationRef
$sel:destination:ArchiveGroupSettings' :: ArchiveGroupSettings -> OutputLocationRef
destination} -> OutputLocationRef
destination) (\s :: ArchiveGroupSettings
s@ArchiveGroupSettings' {} OutputLocationRef
a -> ArchiveGroupSettings
s {$sel:destination:ArchiveGroupSettings' :: OutputLocationRef
destination = OutputLocationRef
a} :: ArchiveGroupSettings)
instance Data.FromJSON ArchiveGroupSettings where
parseJSON :: Value -> Parser ArchiveGroupSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ArchiveGroupSettings"
( \Object
x ->
Maybe ArchiveCdnSettings
-> Maybe Natural -> OutputLocationRef -> ArchiveGroupSettings
ArchiveGroupSettings'
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
"archiveCdnSettings")
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
"rolloverInterval")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"destination")
)
instance Prelude.Hashable ArchiveGroupSettings where
hashWithSalt :: Int -> ArchiveGroupSettings -> Int
hashWithSalt Int
_salt ArchiveGroupSettings' {Maybe Natural
Maybe ArchiveCdnSettings
OutputLocationRef
destination :: OutputLocationRef
rolloverInterval :: Maybe Natural
archiveCdnSettings :: Maybe ArchiveCdnSettings
$sel:destination:ArchiveGroupSettings' :: ArchiveGroupSettings -> OutputLocationRef
$sel:rolloverInterval:ArchiveGroupSettings' :: ArchiveGroupSettings -> Maybe Natural
$sel:archiveCdnSettings:ArchiveGroupSettings' :: ArchiveGroupSettings -> Maybe ArchiveCdnSettings
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ArchiveCdnSettings
archiveCdnSettings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
rolloverInterval
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` OutputLocationRef
destination
instance Prelude.NFData ArchiveGroupSettings where
rnf :: ArchiveGroupSettings -> ()
rnf ArchiveGroupSettings' {Maybe Natural
Maybe ArchiveCdnSettings
OutputLocationRef
destination :: OutputLocationRef
rolloverInterval :: Maybe Natural
archiveCdnSettings :: Maybe ArchiveCdnSettings
$sel:destination:ArchiveGroupSettings' :: ArchiveGroupSettings -> OutputLocationRef
$sel:rolloverInterval:ArchiveGroupSettings' :: ArchiveGroupSettings -> Maybe Natural
$sel:archiveCdnSettings:ArchiveGroupSettings' :: ArchiveGroupSettings -> Maybe ArchiveCdnSettings
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ArchiveCdnSettings
archiveCdnSettings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
rolloverInterval
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf OutputLocationRef
destination
instance Data.ToJSON ArchiveGroupSettings where
toJSON :: ArchiveGroupSettings -> Value
toJSON ArchiveGroupSettings' {Maybe Natural
Maybe ArchiveCdnSettings
OutputLocationRef
destination :: OutputLocationRef
rolloverInterval :: Maybe Natural
archiveCdnSettings :: Maybe ArchiveCdnSettings
$sel:destination:ArchiveGroupSettings' :: ArchiveGroupSettings -> OutputLocationRef
$sel:rolloverInterval:ArchiveGroupSettings' :: ArchiveGroupSettings -> Maybe Natural
$sel:archiveCdnSettings:ArchiveGroupSettings' :: ArchiveGroupSettings -> Maybe ArchiveCdnSettings
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"archiveCdnSettings" 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 ArchiveCdnSettings
archiveCdnSettings,
(Key
"rolloverInterval" 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
rolloverInterval,
forall a. a -> Maybe a
Prelude.Just (Key
"destination" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= OutputLocationRef
destination)
]
)