{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Chime.Types.SourceConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Chime.Types.SourceConfiguration where

import Amazonka.Chime.Types.SelectedVideoStreams
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Source configuration for a specified media capture pipeline.
--
-- /See:/ 'newSourceConfiguration' smart constructor.
data SourceConfiguration = SourceConfiguration'
  { -- | The selected video streams to capture for a specified media capture
    -- pipeline. The number of video streams can\'t exceed 25.
    SourceConfiguration -> Maybe SelectedVideoStreams
selectedVideoStreams :: Prelude.Maybe SelectedVideoStreams
  }
  deriving (SourceConfiguration -> SourceConfiguration -> Bool
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
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. 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)

-- |
-- Create a value of 'SourceConfiguration' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'selectedVideoStreams', 'sourceConfiguration_selectedVideoStreams' - The selected video streams to capture for a specified media capture
-- pipeline. The number of video streams can\'t exceed 25.
newSourceConfiguration ::
  SourceConfiguration
newSourceConfiguration :: SourceConfiguration
newSourceConfiguration =
  SourceConfiguration'
    { $sel:selectedVideoStreams:SourceConfiguration' :: Maybe SelectedVideoStreams
selectedVideoStreams =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The selected video streams to capture for a specified media capture
-- pipeline. The number of video streams can\'t exceed 25.
sourceConfiguration_selectedVideoStreams :: Lens.Lens' SourceConfiguration (Prelude.Maybe SelectedVideoStreams)
sourceConfiguration_selectedVideoStreams :: Lens' SourceConfiguration (Maybe SelectedVideoStreams)
sourceConfiguration_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 Data.FromJSON SourceConfiguration where
  parseJSON :: Value -> Parser SourceConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SourceConfiguration"
      ( \Object
x ->
          Maybe SelectedVideoStreams -> SourceConfiguration
SourceConfiguration'
            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
"SelectedVideoStreams")
      )

instance Prelude.Hashable SourceConfiguration where
  hashWithSalt :: Int -> SourceConfiguration -> Int
hashWithSalt Int
_salt SourceConfiguration' {Maybe SelectedVideoStreams
selectedVideoStreams :: Maybe SelectedVideoStreams
$sel:selectedVideoStreams:SourceConfiguration' :: SourceConfiguration -> Maybe SelectedVideoStreams
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SelectedVideoStreams
selectedVideoStreams

instance Prelude.NFData SourceConfiguration where
  rnf :: SourceConfiguration -> ()
rnf SourceConfiguration' {Maybe SelectedVideoStreams
selectedVideoStreams :: Maybe SelectedVideoStreams
$sel:selectedVideoStreams:SourceConfiguration' :: SourceConfiguration -> Maybe SelectedVideoStreams
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SelectedVideoStreams
selectedVideoStreams

instance Data.ToJSON SourceConfiguration where
  toJSON :: SourceConfiguration -> Value
toJSON SourceConfiguration' {Maybe SelectedVideoStreams
selectedVideoStreams :: Maybe SelectedVideoStreams
$sel:selectedVideoStreams:SourceConfiguration' :: SourceConfiguration -> Maybe SelectedVideoStreams
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"SelectedVideoStreams" 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 SelectedVideoStreams
selectedVideoStreams
          ]
      )