{-# 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.ArchiveOutputSettings 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.ArchiveContainerSettings
import qualified Amazonka.Prelude as Prelude
data ArchiveOutputSettings = ArchiveOutputSettings'
{
ArchiveOutputSettings -> Maybe Text
extension :: Prelude.Maybe Prelude.Text,
ArchiveOutputSettings -> Maybe Text
nameModifier :: Prelude.Maybe Prelude.Text,
ArchiveOutputSettings -> ArchiveContainerSettings
containerSettings :: ArchiveContainerSettings
}
deriving (ArchiveOutputSettings -> ArchiveOutputSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ArchiveOutputSettings -> ArchiveOutputSettings -> Bool
$c/= :: ArchiveOutputSettings -> ArchiveOutputSettings -> Bool
== :: ArchiveOutputSettings -> ArchiveOutputSettings -> Bool
$c== :: ArchiveOutputSettings -> ArchiveOutputSettings -> Bool
Prelude.Eq, ReadPrec [ArchiveOutputSettings]
ReadPrec ArchiveOutputSettings
Int -> ReadS ArchiveOutputSettings
ReadS [ArchiveOutputSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ArchiveOutputSettings]
$creadListPrec :: ReadPrec [ArchiveOutputSettings]
readPrec :: ReadPrec ArchiveOutputSettings
$creadPrec :: ReadPrec ArchiveOutputSettings
readList :: ReadS [ArchiveOutputSettings]
$creadList :: ReadS [ArchiveOutputSettings]
readsPrec :: Int -> ReadS ArchiveOutputSettings
$creadsPrec :: Int -> ReadS ArchiveOutputSettings
Prelude.Read, Int -> ArchiveOutputSettings -> ShowS
[ArchiveOutputSettings] -> ShowS
ArchiveOutputSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ArchiveOutputSettings] -> ShowS
$cshowList :: [ArchiveOutputSettings] -> ShowS
show :: ArchiveOutputSettings -> String
$cshow :: ArchiveOutputSettings -> String
showsPrec :: Int -> ArchiveOutputSettings -> ShowS
$cshowsPrec :: Int -> ArchiveOutputSettings -> ShowS
Prelude.Show, forall x. Rep ArchiveOutputSettings x -> ArchiveOutputSettings
forall x. ArchiveOutputSettings -> Rep ArchiveOutputSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ArchiveOutputSettings x -> ArchiveOutputSettings
$cfrom :: forall x. ArchiveOutputSettings -> Rep ArchiveOutputSettings x
Prelude.Generic)
newArchiveOutputSettings ::
ArchiveContainerSettings ->
ArchiveOutputSettings
newArchiveOutputSettings :: ArchiveContainerSettings -> ArchiveOutputSettings
newArchiveOutputSettings ArchiveContainerSettings
pContainerSettings_ =
ArchiveOutputSettings'
{ $sel:extension:ArchiveOutputSettings' :: Maybe Text
extension = forall a. Maybe a
Prelude.Nothing,
$sel:nameModifier:ArchiveOutputSettings' :: Maybe Text
nameModifier = forall a. Maybe a
Prelude.Nothing,
$sel:containerSettings:ArchiveOutputSettings' :: ArchiveContainerSettings
containerSettings = ArchiveContainerSettings
pContainerSettings_
}
archiveOutputSettings_extension :: Lens.Lens' ArchiveOutputSettings (Prelude.Maybe Prelude.Text)
archiveOutputSettings_extension :: Lens' ArchiveOutputSettings (Maybe Text)
archiveOutputSettings_extension = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArchiveOutputSettings' {Maybe Text
extension :: Maybe Text
$sel:extension:ArchiveOutputSettings' :: ArchiveOutputSettings -> Maybe Text
extension} -> Maybe Text
extension) (\s :: ArchiveOutputSettings
s@ArchiveOutputSettings' {} Maybe Text
a -> ArchiveOutputSettings
s {$sel:extension:ArchiveOutputSettings' :: Maybe Text
extension = Maybe Text
a} :: ArchiveOutputSettings)
archiveOutputSettings_nameModifier :: Lens.Lens' ArchiveOutputSettings (Prelude.Maybe Prelude.Text)
archiveOutputSettings_nameModifier :: Lens' ArchiveOutputSettings (Maybe Text)
archiveOutputSettings_nameModifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArchiveOutputSettings' {Maybe Text
nameModifier :: Maybe Text
$sel:nameModifier:ArchiveOutputSettings' :: ArchiveOutputSettings -> Maybe Text
nameModifier} -> Maybe Text
nameModifier) (\s :: ArchiveOutputSettings
s@ArchiveOutputSettings' {} Maybe Text
a -> ArchiveOutputSettings
s {$sel:nameModifier:ArchiveOutputSettings' :: Maybe Text
nameModifier = Maybe Text
a} :: ArchiveOutputSettings)
archiveOutputSettings_containerSettings :: Lens.Lens' ArchiveOutputSettings ArchiveContainerSettings
archiveOutputSettings_containerSettings :: Lens' ArchiveOutputSettings ArchiveContainerSettings
archiveOutputSettings_containerSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArchiveOutputSettings' {ArchiveContainerSettings
containerSettings :: ArchiveContainerSettings
$sel:containerSettings:ArchiveOutputSettings' :: ArchiveOutputSettings -> ArchiveContainerSettings
containerSettings} -> ArchiveContainerSettings
containerSettings) (\s :: ArchiveOutputSettings
s@ArchiveOutputSettings' {} ArchiveContainerSettings
a -> ArchiveOutputSettings
s {$sel:containerSettings:ArchiveOutputSettings' :: ArchiveContainerSettings
containerSettings = ArchiveContainerSettings
a} :: ArchiveOutputSettings)
instance Data.FromJSON ArchiveOutputSettings where
parseJSON :: Value -> Parser ArchiveOutputSettings
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ArchiveOutputSettings"
( \Object
x ->
Maybe Text
-> Maybe Text -> ArchiveContainerSettings -> ArchiveOutputSettings
ArchiveOutputSettings'
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
"extension")
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
"nameModifier")
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
"containerSettings")
)
instance Prelude.Hashable ArchiveOutputSettings where
hashWithSalt :: Int -> ArchiveOutputSettings -> Int
hashWithSalt Int
_salt ArchiveOutputSettings' {Maybe Text
ArchiveContainerSettings
containerSettings :: ArchiveContainerSettings
nameModifier :: Maybe Text
extension :: Maybe Text
$sel:containerSettings:ArchiveOutputSettings' :: ArchiveOutputSettings -> ArchiveContainerSettings
$sel:nameModifier:ArchiveOutputSettings' :: ArchiveOutputSettings -> Maybe Text
$sel:extension:ArchiveOutputSettings' :: ArchiveOutputSettings -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
extension
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nameModifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ArchiveContainerSettings
containerSettings
instance Prelude.NFData ArchiveOutputSettings where
rnf :: ArchiveOutputSettings -> ()
rnf ArchiveOutputSettings' {Maybe Text
ArchiveContainerSettings
containerSettings :: ArchiveContainerSettings
nameModifier :: Maybe Text
extension :: Maybe Text
$sel:containerSettings:ArchiveOutputSettings' :: ArchiveOutputSettings -> ArchiveContainerSettings
$sel:nameModifier:ArchiveOutputSettings' :: ArchiveOutputSettings -> Maybe Text
$sel:extension:ArchiveOutputSettings' :: ArchiveOutputSettings -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
extension
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nameModifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ArchiveContainerSettings
containerSettings
instance Data.ToJSON ArchiveOutputSettings where
toJSON :: ArchiveOutputSettings -> Value
toJSON ArchiveOutputSettings' {Maybe Text
ArchiveContainerSettings
containerSettings :: ArchiveContainerSettings
nameModifier :: Maybe Text
extension :: Maybe Text
$sel:containerSettings:ArchiveOutputSettings' :: ArchiveOutputSettings -> ArchiveContainerSettings
$sel:nameModifier:ArchiveOutputSettings' :: ArchiveOutputSettings -> Maybe Text
$sel:extension:ArchiveOutputSettings' :: ArchiveOutputSettings -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"extension" 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 Text
extension,
(Key
"nameModifier" 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 Text
nameModifier,
forall a. a -> Maybe a
Prelude.Just
(Key
"containerSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ArchiveContainerSettings
containerSettings)
]
)