{-# 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.Lens as Lens
import Amazonka.MediaLive.Types.ArchiveCdnSettings
import Amazonka.MediaLive.Types.OutputLocationRef
import qualified Amazonka.Prelude as Prelude
data ArchiveGroupSettings = ArchiveGroupSettings'
{
ArchiveGroupSettings -> Maybe Natural
rolloverInterval :: Prelude.Maybe Prelude.Natural,
ArchiveGroupSettings -> Maybe ArchiveCdnSettings
archiveCdnSettings :: Prelude.Maybe ArchiveCdnSettings,
ArchiveGroupSettings -> OutputLocationRef
destination :: OutputLocationRef
}
deriving (ArchiveGroupSettings -> ArchiveGroupSettings -> Bool
(ArchiveGroupSettings -> ArchiveGroupSettings -> Bool)
-> (ArchiveGroupSettings -> ArchiveGroupSettings -> Bool)
-> Eq ArchiveGroupSettings
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]
(Int -> ReadS ArchiveGroupSettings)
-> ReadS [ArchiveGroupSettings]
-> ReadPrec ArchiveGroupSettings
-> ReadPrec [ArchiveGroupSettings]
-> Read 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
(Int -> ArchiveGroupSettings -> ShowS)
-> (ArchiveGroupSettings -> String)
-> ([ArchiveGroupSettings] -> ShowS)
-> Show ArchiveGroupSettings
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. ArchiveGroupSettings -> Rep ArchiveGroupSettings x)
-> (forall x. Rep ArchiveGroupSettings x -> ArchiveGroupSettings)
-> Generic ArchiveGroupSettings
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' :: Maybe Natural
-> Maybe ArchiveCdnSettings
-> OutputLocationRef
-> ArchiveGroupSettings
ArchiveGroupSettings'
{ $sel:rolloverInterval:ArchiveGroupSettings' :: Maybe Natural
rolloverInterval =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:archiveCdnSettings:ArchiveGroupSettings' :: Maybe ArchiveCdnSettings
archiveCdnSettings = Maybe ArchiveCdnSettings
forall a. Maybe a
Prelude.Nothing,
$sel:destination:ArchiveGroupSettings' :: OutputLocationRef
destination = OutputLocationRef
pDestination_
}
archiveGroupSettings_rolloverInterval :: Lens.Lens' ArchiveGroupSettings (Prelude.Maybe Prelude.Natural)
archiveGroupSettings_rolloverInterval :: (Maybe Natural -> f (Maybe Natural))
-> ArchiveGroupSettings -> f ArchiveGroupSettings
archiveGroupSettings_rolloverInterval = (ArchiveGroupSettings -> Maybe Natural)
-> (ArchiveGroupSettings -> Maybe Natural -> ArchiveGroupSettings)
-> Lens
ArchiveGroupSettings
ArchiveGroupSettings
(Maybe Natural)
(Maybe Natural)
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_archiveCdnSettings :: Lens.Lens' ArchiveGroupSettings (Prelude.Maybe ArchiveCdnSettings)
archiveGroupSettings_archiveCdnSettings :: (Maybe ArchiveCdnSettings -> f (Maybe ArchiveCdnSettings))
-> ArchiveGroupSettings -> f ArchiveGroupSettings
archiveGroupSettings_archiveCdnSettings = (ArchiveGroupSettings -> Maybe ArchiveCdnSettings)
-> (ArchiveGroupSettings
-> Maybe ArchiveCdnSettings -> ArchiveGroupSettings)
-> Lens
ArchiveGroupSettings
ArchiveGroupSettings
(Maybe ArchiveCdnSettings)
(Maybe 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_destination :: Lens.Lens' ArchiveGroupSettings OutputLocationRef
archiveGroupSettings_destination :: (OutputLocationRef -> f OutputLocationRef)
-> ArchiveGroupSettings -> f ArchiveGroupSettings
archiveGroupSettings_destination = (ArchiveGroupSettings -> OutputLocationRef)
-> (ArchiveGroupSettings
-> OutputLocationRef -> ArchiveGroupSettings)
-> Lens
ArchiveGroupSettings
ArchiveGroupSettings
OutputLocationRef
OutputLocationRef
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 Core.FromJSON ArchiveGroupSettings where
parseJSON :: Value -> Parser ArchiveGroupSettings
parseJSON =
String
-> (Object -> Parser ArchiveGroupSettings)
-> Value
-> Parser ArchiveGroupSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ArchiveGroupSettings"
( \Object
x ->
Maybe Natural
-> Maybe ArchiveCdnSettings
-> OutputLocationRef
-> ArchiveGroupSettings
ArchiveGroupSettings'
(Maybe Natural
-> Maybe ArchiveCdnSettings
-> OutputLocationRef
-> ArchiveGroupSettings)
-> Parser (Maybe Natural)
-> Parser
(Maybe ArchiveCdnSettings
-> OutputLocationRef -> ArchiveGroupSettings)
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
"rolloverInterval")
Parser
(Maybe ArchiveCdnSettings
-> OutputLocationRef -> ArchiveGroupSettings)
-> Parser (Maybe ArchiveCdnSettings)
-> Parser (OutputLocationRef -> ArchiveGroupSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ArchiveCdnSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"archiveCdnSettings")
Parser (OutputLocationRef -> ArchiveGroupSettings)
-> Parser OutputLocationRef -> Parser ArchiveGroupSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser OutputLocationRef
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"destination")
)
instance Prelude.Hashable ArchiveGroupSettings
instance Prelude.NFData ArchiveGroupSettings
instance Core.ToJSON ArchiveGroupSettings where
toJSON :: ArchiveGroupSettings -> Value
toJSON ArchiveGroupSettings' {Maybe Natural
Maybe ArchiveCdnSettings
OutputLocationRef
destination :: OutputLocationRef
archiveCdnSettings :: Maybe ArchiveCdnSettings
rolloverInterval :: Maybe Natural
$sel:destination:ArchiveGroupSettings' :: ArchiveGroupSettings -> OutputLocationRef
$sel:archiveCdnSettings:ArchiveGroupSettings' :: ArchiveGroupSettings -> Maybe ArchiveCdnSettings
$sel:rolloverInterval:ArchiveGroupSettings' :: ArchiveGroupSettings -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"rolloverInterval" 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
rolloverInterval,
(Text
"archiveCdnSettings" Text -> ArchiveCdnSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ArchiveCdnSettings -> Pair)
-> Maybe ArchiveCdnSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ArchiveCdnSettings
archiveCdnSettings,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"destination" Text -> OutputLocationRef -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= OutputLocationRef
destination)
]
)