{-# 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.SourceConfiguration where
import Amazonka.Chime.Types.SelectedVideoStreams
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SourceConfiguration = SourceConfiguration'
{
SourceConfiguration -> Maybe SelectedVideoStreams
selectedVideoStreams :: Prelude.Maybe SelectedVideoStreams
}
deriving (SourceConfiguration -> SourceConfiguration -> Bool
(SourceConfiguration -> SourceConfiguration -> Bool)
-> (SourceConfiguration -> SourceConfiguration -> Bool)
-> Eq SourceConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceConfiguration -> SourceConfiguration -> Bool
$c/= :: SourceConfiguration -> SourceConfiguration -> Bool
== :: SourceConfiguration -> SourceConfiguration -> Bool
$c== :: SourceConfiguration -> SourceConfiguration -> Bool
Prelude.Eq, Int -> SourceConfiguration -> ShowS
[SourceConfiguration] -> ShowS
SourceConfiguration -> String
(Int -> SourceConfiguration -> ShowS)
-> (SourceConfiguration -> String)
-> ([SourceConfiguration] -> ShowS)
-> Show SourceConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceConfiguration] -> ShowS
$cshowList :: [SourceConfiguration] -> ShowS
show :: SourceConfiguration -> String
$cshow :: SourceConfiguration -> String
showsPrec :: Int -> SourceConfiguration -> ShowS
$cshowsPrec :: Int -> SourceConfiguration -> ShowS
Prelude.Show, (forall x. SourceConfiguration -> Rep SourceConfiguration x)
-> (forall x. Rep SourceConfiguration x -> SourceConfiguration)
-> Generic SourceConfiguration
forall x. Rep SourceConfiguration x -> SourceConfiguration
forall x. SourceConfiguration -> Rep SourceConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceConfiguration x -> SourceConfiguration
$cfrom :: forall x. SourceConfiguration -> Rep SourceConfiguration x
Prelude.Generic)
newSourceConfiguration ::
SourceConfiguration
newSourceConfiguration :: SourceConfiguration
newSourceConfiguration =
SourceConfiguration' :: Maybe SelectedVideoStreams -> SourceConfiguration
SourceConfiguration'
{ $sel:selectedVideoStreams:SourceConfiguration' :: Maybe SelectedVideoStreams
selectedVideoStreams =
Maybe SelectedVideoStreams
forall a. Maybe a
Prelude.Nothing
}
sourceConfiguration_selectedVideoStreams :: Lens.Lens' SourceConfiguration (Prelude.Maybe SelectedVideoStreams)
sourceConfiguration_selectedVideoStreams :: (Maybe SelectedVideoStreams -> f (Maybe SelectedVideoStreams))
-> SourceConfiguration -> f SourceConfiguration
sourceConfiguration_selectedVideoStreams = (SourceConfiguration -> Maybe SelectedVideoStreams)
-> (SourceConfiguration
-> Maybe SelectedVideoStreams -> SourceConfiguration)
-> Lens
SourceConfiguration
SourceConfiguration
(Maybe SelectedVideoStreams)
(Maybe SelectedVideoStreams)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConfiguration' {Maybe SelectedVideoStreams
selectedVideoStreams :: Maybe SelectedVideoStreams
$sel:selectedVideoStreams:SourceConfiguration' :: SourceConfiguration -> Maybe SelectedVideoStreams
selectedVideoStreams} -> Maybe SelectedVideoStreams
selectedVideoStreams) (\s :: SourceConfiguration
s@SourceConfiguration' {} Maybe SelectedVideoStreams
a -> SourceConfiguration
s {$sel:selectedVideoStreams:SourceConfiguration' :: Maybe SelectedVideoStreams
selectedVideoStreams = Maybe SelectedVideoStreams
a} :: SourceConfiguration)
instance Core.FromJSON SourceConfiguration where
parseJSON :: Value -> Parser SourceConfiguration
parseJSON =
String
-> (Object -> Parser SourceConfiguration)
-> Value
-> Parser SourceConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SourceConfiguration"
( \Object
x ->
Maybe SelectedVideoStreams -> SourceConfiguration
SourceConfiguration'
(Maybe SelectedVideoStreams -> SourceConfiguration)
-> Parser (Maybe SelectedVideoStreams)
-> Parser SourceConfiguration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SelectedVideoStreams)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SelectedVideoStreams")
)
instance Prelude.Hashable SourceConfiguration
instance Prelude.NFData SourceConfiguration
instance Core.ToJSON SourceConfiguration where
toJSON :: SourceConfiguration -> Value
toJSON SourceConfiguration' {Maybe SelectedVideoStreams
selectedVideoStreams :: Maybe SelectedVideoStreams
$sel:selectedVideoStreams:SourceConfiguration' :: SourceConfiguration -> Maybe SelectedVideoStreams
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SelectedVideoStreams" Text -> SelectedVideoStreams -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SelectedVideoStreams -> Pair)
-> Maybe SelectedVideoStreams -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SelectedVideoStreams
selectedVideoStreams
]
)