{-# 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.FrameCaptureGroupSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.FrameCaptureCdnSettings
import Amazonka.MediaLive.Types.OutputLocationRef
import qualified Amazonka.Prelude as Prelude
data FrameCaptureGroupSettings = FrameCaptureGroupSettings'
{
FrameCaptureGroupSettings -> Maybe FrameCaptureCdnSettings
frameCaptureCdnSettings :: Prelude.Maybe FrameCaptureCdnSettings,
FrameCaptureGroupSettings -> OutputLocationRef
destination :: OutputLocationRef
}
deriving (FrameCaptureGroupSettings -> FrameCaptureGroupSettings -> Bool
(FrameCaptureGroupSettings -> FrameCaptureGroupSettings -> Bool)
-> (FrameCaptureGroupSettings -> FrameCaptureGroupSettings -> Bool)
-> Eq FrameCaptureGroupSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FrameCaptureGroupSettings -> FrameCaptureGroupSettings -> Bool
$c/= :: FrameCaptureGroupSettings -> FrameCaptureGroupSettings -> Bool
== :: FrameCaptureGroupSettings -> FrameCaptureGroupSettings -> Bool
$c== :: FrameCaptureGroupSettings -> FrameCaptureGroupSettings -> Bool
Prelude.Eq, ReadPrec [FrameCaptureGroupSettings]
ReadPrec FrameCaptureGroupSettings
Int -> ReadS FrameCaptureGroupSettings
ReadS [FrameCaptureGroupSettings]
(Int -> ReadS FrameCaptureGroupSettings)
-> ReadS [FrameCaptureGroupSettings]
-> ReadPrec FrameCaptureGroupSettings
-> ReadPrec [FrameCaptureGroupSettings]
-> Read FrameCaptureGroupSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FrameCaptureGroupSettings]
$creadListPrec :: ReadPrec [FrameCaptureGroupSettings]
readPrec :: ReadPrec FrameCaptureGroupSettings
$creadPrec :: ReadPrec FrameCaptureGroupSettings
readList :: ReadS [FrameCaptureGroupSettings]
$creadList :: ReadS [FrameCaptureGroupSettings]
readsPrec :: Int -> ReadS FrameCaptureGroupSettings
$creadsPrec :: Int -> ReadS FrameCaptureGroupSettings
Prelude.Read, Int -> FrameCaptureGroupSettings -> ShowS
[FrameCaptureGroupSettings] -> ShowS
FrameCaptureGroupSettings -> String
(Int -> FrameCaptureGroupSettings -> ShowS)
-> (FrameCaptureGroupSettings -> String)
-> ([FrameCaptureGroupSettings] -> ShowS)
-> Show FrameCaptureGroupSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FrameCaptureGroupSettings] -> ShowS
$cshowList :: [FrameCaptureGroupSettings] -> ShowS
show :: FrameCaptureGroupSettings -> String
$cshow :: FrameCaptureGroupSettings -> String
showsPrec :: Int -> FrameCaptureGroupSettings -> ShowS
$cshowsPrec :: Int -> FrameCaptureGroupSettings -> ShowS
Prelude.Show, (forall x.
FrameCaptureGroupSettings -> Rep FrameCaptureGroupSettings x)
-> (forall x.
Rep FrameCaptureGroupSettings x -> FrameCaptureGroupSettings)
-> Generic FrameCaptureGroupSettings
forall x.
Rep FrameCaptureGroupSettings x -> FrameCaptureGroupSettings
forall x.
FrameCaptureGroupSettings -> Rep FrameCaptureGroupSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FrameCaptureGroupSettings x -> FrameCaptureGroupSettings
$cfrom :: forall x.
FrameCaptureGroupSettings -> Rep FrameCaptureGroupSettings x
Prelude.Generic)
newFrameCaptureGroupSettings ::
OutputLocationRef ->
FrameCaptureGroupSettings
newFrameCaptureGroupSettings :: OutputLocationRef -> FrameCaptureGroupSettings
newFrameCaptureGroupSettings OutputLocationRef
pDestination_ =
FrameCaptureGroupSettings' :: Maybe FrameCaptureCdnSettings
-> OutputLocationRef -> FrameCaptureGroupSettings
FrameCaptureGroupSettings'
{ $sel:frameCaptureCdnSettings:FrameCaptureGroupSettings' :: Maybe FrameCaptureCdnSettings
frameCaptureCdnSettings =
Maybe FrameCaptureCdnSettings
forall a. Maybe a
Prelude.Nothing,
$sel:destination:FrameCaptureGroupSettings' :: OutputLocationRef
destination = OutputLocationRef
pDestination_
}
frameCaptureGroupSettings_frameCaptureCdnSettings :: Lens.Lens' FrameCaptureGroupSettings (Prelude.Maybe FrameCaptureCdnSettings)
frameCaptureGroupSettings_frameCaptureCdnSettings :: (Maybe FrameCaptureCdnSettings
-> f (Maybe FrameCaptureCdnSettings))
-> FrameCaptureGroupSettings -> f FrameCaptureGroupSettings
frameCaptureGroupSettings_frameCaptureCdnSettings = (FrameCaptureGroupSettings -> Maybe FrameCaptureCdnSettings)
-> (FrameCaptureGroupSettings
-> Maybe FrameCaptureCdnSettings -> FrameCaptureGroupSettings)
-> Lens
FrameCaptureGroupSettings
FrameCaptureGroupSettings
(Maybe FrameCaptureCdnSettings)
(Maybe FrameCaptureCdnSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FrameCaptureGroupSettings' {Maybe FrameCaptureCdnSettings
frameCaptureCdnSettings :: Maybe FrameCaptureCdnSettings
$sel:frameCaptureCdnSettings:FrameCaptureGroupSettings' :: FrameCaptureGroupSettings -> Maybe FrameCaptureCdnSettings
frameCaptureCdnSettings} -> Maybe FrameCaptureCdnSettings
frameCaptureCdnSettings) (\s :: FrameCaptureGroupSettings
s@FrameCaptureGroupSettings' {} Maybe FrameCaptureCdnSettings
a -> FrameCaptureGroupSettings
s {$sel:frameCaptureCdnSettings:FrameCaptureGroupSettings' :: Maybe FrameCaptureCdnSettings
frameCaptureCdnSettings = Maybe FrameCaptureCdnSettings
a} :: FrameCaptureGroupSettings)
frameCaptureGroupSettings_destination :: Lens.Lens' FrameCaptureGroupSettings OutputLocationRef
frameCaptureGroupSettings_destination :: (OutputLocationRef -> f OutputLocationRef)
-> FrameCaptureGroupSettings -> f FrameCaptureGroupSettings
frameCaptureGroupSettings_destination = (FrameCaptureGroupSettings -> OutputLocationRef)
-> (FrameCaptureGroupSettings
-> OutputLocationRef -> FrameCaptureGroupSettings)
-> Lens
FrameCaptureGroupSettings
FrameCaptureGroupSettings
OutputLocationRef
OutputLocationRef
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FrameCaptureGroupSettings' {OutputLocationRef
destination :: OutputLocationRef
$sel:destination:FrameCaptureGroupSettings' :: FrameCaptureGroupSettings -> OutputLocationRef
destination} -> OutputLocationRef
destination) (\s :: FrameCaptureGroupSettings
s@FrameCaptureGroupSettings' {} OutputLocationRef
a -> FrameCaptureGroupSettings
s {$sel:destination:FrameCaptureGroupSettings' :: OutputLocationRef
destination = OutputLocationRef
a} :: FrameCaptureGroupSettings)
instance Core.FromJSON FrameCaptureGroupSettings where
parseJSON :: Value -> Parser FrameCaptureGroupSettings
parseJSON =
String
-> (Object -> Parser FrameCaptureGroupSettings)
-> Value
-> Parser FrameCaptureGroupSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FrameCaptureGroupSettings"
( \Object
x ->
Maybe FrameCaptureCdnSettings
-> OutputLocationRef -> FrameCaptureGroupSettings
FrameCaptureGroupSettings'
(Maybe FrameCaptureCdnSettings
-> OutputLocationRef -> FrameCaptureGroupSettings)
-> Parser (Maybe FrameCaptureCdnSettings)
-> Parser (OutputLocationRef -> FrameCaptureGroupSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe FrameCaptureCdnSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"frameCaptureCdnSettings")
Parser (OutputLocationRef -> FrameCaptureGroupSettings)
-> Parser OutputLocationRef -> Parser FrameCaptureGroupSettings
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 FrameCaptureGroupSettings
instance Prelude.NFData FrameCaptureGroupSettings
instance Core.ToJSON FrameCaptureGroupSettings where
toJSON :: FrameCaptureGroupSettings -> Value
toJSON FrameCaptureGroupSettings' {Maybe FrameCaptureCdnSettings
OutputLocationRef
destination :: OutputLocationRef
frameCaptureCdnSettings :: Maybe FrameCaptureCdnSettings
$sel:destination:FrameCaptureGroupSettings' :: FrameCaptureGroupSettings -> OutputLocationRef
$sel:frameCaptureCdnSettings:FrameCaptureGroupSettings' :: FrameCaptureGroupSettings -> Maybe FrameCaptureCdnSettings
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"frameCaptureCdnSettings" Text -> FrameCaptureCdnSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(FrameCaptureCdnSettings -> Pair)
-> Maybe FrameCaptureCdnSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FrameCaptureCdnSettings
frameCaptureCdnSettings,
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)
]
)