{-# 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.ChimeSdkMeetingConfiguration
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Chime.Types.ChimeSdkMeetingConfiguration where

import Amazonka.Chime.Types.ArtifactsConfiguration
import Amazonka.Chime.Types.SourceConfiguration
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The configuration object of the Amazon Chime SDK meeting for a specified
-- media capture pipeline. @SourceType@ must be @ChimeSdkMeeting@.
--
-- /See:/ 'newChimeSdkMeetingConfiguration' smart constructor.
data ChimeSdkMeetingConfiguration = ChimeSdkMeetingConfiguration'
  { -- | The configuration for the artifacts in an Amazon Chime SDK meeting.
    ChimeSdkMeetingConfiguration -> Maybe ArtifactsConfiguration
artifactsConfiguration :: Prelude.Maybe ArtifactsConfiguration,
    -- | The source configuration for a specified media capture pipline.
    ChimeSdkMeetingConfiguration -> Maybe SourceConfiguration
sourceConfiguration :: Prelude.Maybe SourceConfiguration
  }
  deriving (ChimeSdkMeetingConfiguration
-> ChimeSdkMeetingConfiguration -> Bool
(ChimeSdkMeetingConfiguration
 -> ChimeSdkMeetingConfiguration -> Bool)
-> (ChimeSdkMeetingConfiguration
    -> ChimeSdkMeetingConfiguration -> Bool)
-> Eq ChimeSdkMeetingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChimeSdkMeetingConfiguration
-> ChimeSdkMeetingConfiguration -> Bool
$c/= :: ChimeSdkMeetingConfiguration
-> ChimeSdkMeetingConfiguration -> Bool
== :: ChimeSdkMeetingConfiguration
-> ChimeSdkMeetingConfiguration -> Bool
$c== :: ChimeSdkMeetingConfiguration
-> ChimeSdkMeetingConfiguration -> Bool
Prelude.Eq, Int -> ChimeSdkMeetingConfiguration -> ShowS
[ChimeSdkMeetingConfiguration] -> ShowS
ChimeSdkMeetingConfiguration -> String
(Int -> ChimeSdkMeetingConfiguration -> ShowS)
-> (ChimeSdkMeetingConfiguration -> String)
-> ([ChimeSdkMeetingConfiguration] -> ShowS)
-> Show ChimeSdkMeetingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChimeSdkMeetingConfiguration] -> ShowS
$cshowList :: [ChimeSdkMeetingConfiguration] -> ShowS
show :: ChimeSdkMeetingConfiguration -> String
$cshow :: ChimeSdkMeetingConfiguration -> String
showsPrec :: Int -> ChimeSdkMeetingConfiguration -> ShowS
$cshowsPrec :: Int -> ChimeSdkMeetingConfiguration -> ShowS
Prelude.Show, (forall x.
 ChimeSdkMeetingConfiguration -> Rep ChimeSdkMeetingConfiguration x)
-> (forall x.
    Rep ChimeSdkMeetingConfiguration x -> ChimeSdkMeetingConfiguration)
-> Generic ChimeSdkMeetingConfiguration
forall x.
Rep ChimeSdkMeetingConfiguration x -> ChimeSdkMeetingConfiguration
forall x.
ChimeSdkMeetingConfiguration -> Rep ChimeSdkMeetingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ChimeSdkMeetingConfiguration x -> ChimeSdkMeetingConfiguration
$cfrom :: forall x.
ChimeSdkMeetingConfiguration -> Rep ChimeSdkMeetingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ChimeSdkMeetingConfiguration' 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:
--
-- 'artifactsConfiguration', 'chimeSdkMeetingConfiguration_artifactsConfiguration' - The configuration for the artifacts in an Amazon Chime SDK meeting.
--
-- 'sourceConfiguration', 'chimeSdkMeetingConfiguration_sourceConfiguration' - The source configuration for a specified media capture pipline.
newChimeSdkMeetingConfiguration ::
  ChimeSdkMeetingConfiguration
newChimeSdkMeetingConfiguration :: ChimeSdkMeetingConfiguration
newChimeSdkMeetingConfiguration =
  ChimeSdkMeetingConfiguration' :: Maybe ArtifactsConfiguration
-> Maybe SourceConfiguration -> ChimeSdkMeetingConfiguration
ChimeSdkMeetingConfiguration'
    { $sel:artifactsConfiguration:ChimeSdkMeetingConfiguration' :: Maybe ArtifactsConfiguration
artifactsConfiguration =
        Maybe ArtifactsConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceConfiguration:ChimeSdkMeetingConfiguration' :: Maybe SourceConfiguration
sourceConfiguration = Maybe SourceConfiguration
forall a. Maybe a
Prelude.Nothing
    }

-- | The configuration for the artifacts in an Amazon Chime SDK meeting.
chimeSdkMeetingConfiguration_artifactsConfiguration :: Lens.Lens' ChimeSdkMeetingConfiguration (Prelude.Maybe ArtifactsConfiguration)
chimeSdkMeetingConfiguration_artifactsConfiguration :: (Maybe ArtifactsConfiguration -> f (Maybe ArtifactsConfiguration))
-> ChimeSdkMeetingConfiguration -> f ChimeSdkMeetingConfiguration
chimeSdkMeetingConfiguration_artifactsConfiguration = (ChimeSdkMeetingConfiguration -> Maybe ArtifactsConfiguration)
-> (ChimeSdkMeetingConfiguration
    -> Maybe ArtifactsConfiguration -> ChimeSdkMeetingConfiguration)
-> Lens
     ChimeSdkMeetingConfiguration
     ChimeSdkMeetingConfiguration
     (Maybe ArtifactsConfiguration)
     (Maybe ArtifactsConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChimeSdkMeetingConfiguration' {Maybe ArtifactsConfiguration
artifactsConfiguration :: Maybe ArtifactsConfiguration
$sel:artifactsConfiguration:ChimeSdkMeetingConfiguration' :: ChimeSdkMeetingConfiguration -> Maybe ArtifactsConfiguration
artifactsConfiguration} -> Maybe ArtifactsConfiguration
artifactsConfiguration) (\s :: ChimeSdkMeetingConfiguration
s@ChimeSdkMeetingConfiguration' {} Maybe ArtifactsConfiguration
a -> ChimeSdkMeetingConfiguration
s {$sel:artifactsConfiguration:ChimeSdkMeetingConfiguration' :: Maybe ArtifactsConfiguration
artifactsConfiguration = Maybe ArtifactsConfiguration
a} :: ChimeSdkMeetingConfiguration)

-- | The source configuration for a specified media capture pipline.
chimeSdkMeetingConfiguration_sourceConfiguration :: Lens.Lens' ChimeSdkMeetingConfiguration (Prelude.Maybe SourceConfiguration)
chimeSdkMeetingConfiguration_sourceConfiguration :: (Maybe SourceConfiguration -> f (Maybe SourceConfiguration))
-> ChimeSdkMeetingConfiguration -> f ChimeSdkMeetingConfiguration
chimeSdkMeetingConfiguration_sourceConfiguration = (ChimeSdkMeetingConfiguration -> Maybe SourceConfiguration)
-> (ChimeSdkMeetingConfiguration
    -> Maybe SourceConfiguration -> ChimeSdkMeetingConfiguration)
-> Lens
     ChimeSdkMeetingConfiguration
     ChimeSdkMeetingConfiguration
     (Maybe SourceConfiguration)
     (Maybe SourceConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChimeSdkMeetingConfiguration' {Maybe SourceConfiguration
sourceConfiguration :: Maybe SourceConfiguration
$sel:sourceConfiguration:ChimeSdkMeetingConfiguration' :: ChimeSdkMeetingConfiguration -> Maybe SourceConfiguration
sourceConfiguration} -> Maybe SourceConfiguration
sourceConfiguration) (\s :: ChimeSdkMeetingConfiguration
s@ChimeSdkMeetingConfiguration' {} Maybe SourceConfiguration
a -> ChimeSdkMeetingConfiguration
s {$sel:sourceConfiguration:ChimeSdkMeetingConfiguration' :: Maybe SourceConfiguration
sourceConfiguration = Maybe SourceConfiguration
a} :: ChimeSdkMeetingConfiguration)

instance Core.FromJSON ChimeSdkMeetingConfiguration where
  parseJSON :: Value -> Parser ChimeSdkMeetingConfiguration
parseJSON =
    String
-> (Object -> Parser ChimeSdkMeetingConfiguration)
-> Value
-> Parser ChimeSdkMeetingConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ChimeSdkMeetingConfiguration"
      ( \Object
x ->
          Maybe ArtifactsConfiguration
-> Maybe SourceConfiguration -> ChimeSdkMeetingConfiguration
ChimeSdkMeetingConfiguration'
            (Maybe ArtifactsConfiguration
 -> Maybe SourceConfiguration -> ChimeSdkMeetingConfiguration)
-> Parser (Maybe ArtifactsConfiguration)
-> Parser
     (Maybe SourceConfiguration -> ChimeSdkMeetingConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ArtifactsConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ArtifactsConfiguration")
            Parser (Maybe SourceConfiguration -> ChimeSdkMeetingConfiguration)
-> Parser (Maybe SourceConfiguration)
-> Parser ChimeSdkMeetingConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SourceConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SourceConfiguration")
      )

instance
  Prelude.Hashable
    ChimeSdkMeetingConfiguration

instance Prelude.NFData ChimeSdkMeetingConfiguration

instance Core.ToJSON ChimeSdkMeetingConfiguration where
  toJSON :: ChimeSdkMeetingConfiguration -> Value
toJSON ChimeSdkMeetingConfiguration' {Maybe SourceConfiguration
Maybe ArtifactsConfiguration
sourceConfiguration :: Maybe SourceConfiguration
artifactsConfiguration :: Maybe ArtifactsConfiguration
$sel:sourceConfiguration:ChimeSdkMeetingConfiguration' :: ChimeSdkMeetingConfiguration -> Maybe SourceConfiguration
$sel:artifactsConfiguration:ChimeSdkMeetingConfiguration' :: ChimeSdkMeetingConfiguration -> Maybe ArtifactsConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ArtifactsConfiguration" Text -> ArtifactsConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ArtifactsConfiguration -> Pair)
-> Maybe ArtifactsConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ArtifactsConfiguration
artifactsConfiguration,
            (Text
"SourceConfiguration" Text -> SourceConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SourceConfiguration -> Pair)
-> Maybe SourceConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SourceConfiguration
sourceConfiguration
          ]
      )