{-# 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.Chime.Types.VideoArtifactsConfiguration where
import Amazonka.Chime.Types.ArtifactsState
import Amazonka.Chime.Types.VideoMuxType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data VideoArtifactsConfiguration = VideoArtifactsConfiguration'
{
VideoArtifactsConfiguration -> Maybe VideoMuxType
muxType :: Prelude.Maybe VideoMuxType,
VideoArtifactsConfiguration -> ArtifactsState
state :: ArtifactsState
}
deriving (VideoArtifactsConfiguration -> VideoArtifactsConfiguration -> Bool
(VideoArtifactsConfiguration
-> VideoArtifactsConfiguration -> Bool)
-> (VideoArtifactsConfiguration
-> VideoArtifactsConfiguration -> Bool)
-> Eq VideoArtifactsConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VideoArtifactsConfiguration -> VideoArtifactsConfiguration -> Bool
$c/= :: VideoArtifactsConfiguration -> VideoArtifactsConfiguration -> Bool
== :: VideoArtifactsConfiguration -> VideoArtifactsConfiguration -> Bool
$c== :: VideoArtifactsConfiguration -> VideoArtifactsConfiguration -> Bool
Prelude.Eq, ReadPrec [VideoArtifactsConfiguration]
ReadPrec VideoArtifactsConfiguration
Int -> ReadS VideoArtifactsConfiguration
ReadS [VideoArtifactsConfiguration]
(Int -> ReadS VideoArtifactsConfiguration)
-> ReadS [VideoArtifactsConfiguration]
-> ReadPrec VideoArtifactsConfiguration
-> ReadPrec [VideoArtifactsConfiguration]
-> Read VideoArtifactsConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VideoArtifactsConfiguration]
$creadListPrec :: ReadPrec [VideoArtifactsConfiguration]
readPrec :: ReadPrec VideoArtifactsConfiguration
$creadPrec :: ReadPrec VideoArtifactsConfiguration
readList :: ReadS [VideoArtifactsConfiguration]
$creadList :: ReadS [VideoArtifactsConfiguration]
readsPrec :: Int -> ReadS VideoArtifactsConfiguration
$creadsPrec :: Int -> ReadS VideoArtifactsConfiguration
Prelude.Read, Int -> VideoArtifactsConfiguration -> ShowS
[VideoArtifactsConfiguration] -> ShowS
VideoArtifactsConfiguration -> String
(Int -> VideoArtifactsConfiguration -> ShowS)
-> (VideoArtifactsConfiguration -> String)
-> ([VideoArtifactsConfiguration] -> ShowS)
-> Show VideoArtifactsConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoArtifactsConfiguration] -> ShowS
$cshowList :: [VideoArtifactsConfiguration] -> ShowS
show :: VideoArtifactsConfiguration -> String
$cshow :: VideoArtifactsConfiguration -> String
showsPrec :: Int -> VideoArtifactsConfiguration -> ShowS
$cshowsPrec :: Int -> VideoArtifactsConfiguration -> ShowS
Prelude.Show, (forall x.
VideoArtifactsConfiguration -> Rep VideoArtifactsConfiguration x)
-> (forall x.
Rep VideoArtifactsConfiguration x -> VideoArtifactsConfiguration)
-> Generic VideoArtifactsConfiguration
forall x.
Rep VideoArtifactsConfiguration x -> VideoArtifactsConfiguration
forall x.
VideoArtifactsConfiguration -> Rep VideoArtifactsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VideoArtifactsConfiguration x -> VideoArtifactsConfiguration
$cfrom :: forall x.
VideoArtifactsConfiguration -> Rep VideoArtifactsConfiguration x
Prelude.Generic)
newVideoArtifactsConfiguration ::
ArtifactsState ->
VideoArtifactsConfiguration
newVideoArtifactsConfiguration :: ArtifactsState -> VideoArtifactsConfiguration
newVideoArtifactsConfiguration ArtifactsState
pState_ =
VideoArtifactsConfiguration' :: Maybe VideoMuxType -> ArtifactsState -> VideoArtifactsConfiguration
VideoArtifactsConfiguration'
{ $sel:muxType:VideoArtifactsConfiguration' :: Maybe VideoMuxType
muxType =
Maybe VideoMuxType
forall a. Maybe a
Prelude.Nothing,
$sel:state:VideoArtifactsConfiguration' :: ArtifactsState
state = ArtifactsState
pState_
}
videoArtifactsConfiguration_muxType :: Lens.Lens' VideoArtifactsConfiguration (Prelude.Maybe VideoMuxType)
videoArtifactsConfiguration_muxType :: (Maybe VideoMuxType -> f (Maybe VideoMuxType))
-> VideoArtifactsConfiguration -> f VideoArtifactsConfiguration
videoArtifactsConfiguration_muxType = (VideoArtifactsConfiguration -> Maybe VideoMuxType)
-> (VideoArtifactsConfiguration
-> Maybe VideoMuxType -> VideoArtifactsConfiguration)
-> Lens
VideoArtifactsConfiguration
VideoArtifactsConfiguration
(Maybe VideoMuxType)
(Maybe VideoMuxType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoArtifactsConfiguration' {Maybe VideoMuxType
muxType :: Maybe VideoMuxType
$sel:muxType:VideoArtifactsConfiguration' :: VideoArtifactsConfiguration -> Maybe VideoMuxType
muxType} -> Maybe VideoMuxType
muxType) (\s :: VideoArtifactsConfiguration
s@VideoArtifactsConfiguration' {} Maybe VideoMuxType
a -> VideoArtifactsConfiguration
s {$sel:muxType:VideoArtifactsConfiguration' :: Maybe VideoMuxType
muxType = Maybe VideoMuxType
a} :: VideoArtifactsConfiguration)
videoArtifactsConfiguration_state :: Lens.Lens' VideoArtifactsConfiguration ArtifactsState
videoArtifactsConfiguration_state :: (ArtifactsState -> f ArtifactsState)
-> VideoArtifactsConfiguration -> f VideoArtifactsConfiguration
videoArtifactsConfiguration_state = (VideoArtifactsConfiguration -> ArtifactsState)
-> (VideoArtifactsConfiguration
-> ArtifactsState -> VideoArtifactsConfiguration)
-> Lens
VideoArtifactsConfiguration
VideoArtifactsConfiguration
ArtifactsState
ArtifactsState
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoArtifactsConfiguration' {ArtifactsState
state :: ArtifactsState
$sel:state:VideoArtifactsConfiguration' :: VideoArtifactsConfiguration -> ArtifactsState
state} -> ArtifactsState
state) (\s :: VideoArtifactsConfiguration
s@VideoArtifactsConfiguration' {} ArtifactsState
a -> VideoArtifactsConfiguration
s {$sel:state:VideoArtifactsConfiguration' :: ArtifactsState
state = ArtifactsState
a} :: VideoArtifactsConfiguration)
instance Core.FromJSON VideoArtifactsConfiguration where
parseJSON :: Value -> Parser VideoArtifactsConfiguration
parseJSON =
String
-> (Object -> Parser VideoArtifactsConfiguration)
-> Value
-> Parser VideoArtifactsConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VideoArtifactsConfiguration"
( \Object
x ->
Maybe VideoMuxType -> ArtifactsState -> VideoArtifactsConfiguration
VideoArtifactsConfiguration'
(Maybe VideoMuxType
-> ArtifactsState -> VideoArtifactsConfiguration)
-> Parser (Maybe VideoMuxType)
-> Parser (ArtifactsState -> VideoArtifactsConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe VideoMuxType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MuxType")
Parser (ArtifactsState -> VideoArtifactsConfiguration)
-> Parser ArtifactsState -> Parser VideoArtifactsConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ArtifactsState
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"State")
)
instance Prelude.Hashable VideoArtifactsConfiguration
instance Prelude.NFData VideoArtifactsConfiguration
instance Core.ToJSON VideoArtifactsConfiguration where
toJSON :: VideoArtifactsConfiguration -> Value
toJSON VideoArtifactsConfiguration' {Maybe VideoMuxType
ArtifactsState
state :: ArtifactsState
muxType :: Maybe VideoMuxType
$sel:state:VideoArtifactsConfiguration' :: VideoArtifactsConfiguration -> ArtifactsState
$sel:muxType:VideoArtifactsConfiguration' :: VideoArtifactsConfiguration -> Maybe VideoMuxType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"MuxType" Text -> VideoMuxType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VideoMuxType -> Pair) -> Maybe VideoMuxType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VideoMuxType
muxType,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"State" Text -> ArtifactsState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ArtifactsState
state)
]
)