{-# 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.AudioArtifactsConfiguration
-- 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.AudioArtifactsConfiguration where

import Amazonka.Chime.Types.AudioMuxType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The audio artifact configuration object.
--
-- /See:/ 'newAudioArtifactsConfiguration' smart constructor.
data AudioArtifactsConfiguration = AudioArtifactsConfiguration'
  { -- | The MUX type of the audio artifact configuration object.
    AudioArtifactsConfiguration -> AudioMuxType
muxType :: AudioMuxType
  }
  deriving (AudioArtifactsConfiguration -> AudioArtifactsConfiguration -> Bool
(AudioArtifactsConfiguration
 -> AudioArtifactsConfiguration -> Bool)
-> (AudioArtifactsConfiguration
    -> AudioArtifactsConfiguration -> Bool)
-> Eq AudioArtifactsConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AudioArtifactsConfiguration -> AudioArtifactsConfiguration -> Bool
$c/= :: AudioArtifactsConfiguration -> AudioArtifactsConfiguration -> Bool
== :: AudioArtifactsConfiguration -> AudioArtifactsConfiguration -> Bool
$c== :: AudioArtifactsConfiguration -> AudioArtifactsConfiguration -> Bool
Prelude.Eq, ReadPrec [AudioArtifactsConfiguration]
ReadPrec AudioArtifactsConfiguration
Int -> ReadS AudioArtifactsConfiguration
ReadS [AudioArtifactsConfiguration]
(Int -> ReadS AudioArtifactsConfiguration)
-> ReadS [AudioArtifactsConfiguration]
-> ReadPrec AudioArtifactsConfiguration
-> ReadPrec [AudioArtifactsConfiguration]
-> Read AudioArtifactsConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AudioArtifactsConfiguration]
$creadListPrec :: ReadPrec [AudioArtifactsConfiguration]
readPrec :: ReadPrec AudioArtifactsConfiguration
$creadPrec :: ReadPrec AudioArtifactsConfiguration
readList :: ReadS [AudioArtifactsConfiguration]
$creadList :: ReadS [AudioArtifactsConfiguration]
readsPrec :: Int -> ReadS AudioArtifactsConfiguration
$creadsPrec :: Int -> ReadS AudioArtifactsConfiguration
Prelude.Read, Int -> AudioArtifactsConfiguration -> ShowS
[AudioArtifactsConfiguration] -> ShowS
AudioArtifactsConfiguration -> String
(Int -> AudioArtifactsConfiguration -> ShowS)
-> (AudioArtifactsConfiguration -> String)
-> ([AudioArtifactsConfiguration] -> ShowS)
-> Show AudioArtifactsConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AudioArtifactsConfiguration] -> ShowS
$cshowList :: [AudioArtifactsConfiguration] -> ShowS
show :: AudioArtifactsConfiguration -> String
$cshow :: AudioArtifactsConfiguration -> String
showsPrec :: Int -> AudioArtifactsConfiguration -> ShowS
$cshowsPrec :: Int -> AudioArtifactsConfiguration -> ShowS
Prelude.Show, (forall x.
 AudioArtifactsConfiguration -> Rep AudioArtifactsConfiguration x)
-> (forall x.
    Rep AudioArtifactsConfiguration x -> AudioArtifactsConfiguration)
-> Generic AudioArtifactsConfiguration
forall x.
Rep AudioArtifactsConfiguration x -> AudioArtifactsConfiguration
forall x.
AudioArtifactsConfiguration -> Rep AudioArtifactsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AudioArtifactsConfiguration x -> AudioArtifactsConfiguration
$cfrom :: forall x.
AudioArtifactsConfiguration -> Rep AudioArtifactsConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'AudioArtifactsConfiguration' 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:
--
-- 'muxType', 'audioArtifactsConfiguration_muxType' - The MUX type of the audio artifact configuration object.
newAudioArtifactsConfiguration ::
  -- | 'muxType'
  AudioMuxType ->
  AudioArtifactsConfiguration
newAudioArtifactsConfiguration :: AudioMuxType -> AudioArtifactsConfiguration
newAudioArtifactsConfiguration AudioMuxType
pMuxType_ =
  AudioArtifactsConfiguration' :: AudioMuxType -> AudioArtifactsConfiguration
AudioArtifactsConfiguration' {$sel:muxType:AudioArtifactsConfiguration' :: AudioMuxType
muxType = AudioMuxType
pMuxType_}

-- | The MUX type of the audio artifact configuration object.
audioArtifactsConfiguration_muxType :: Lens.Lens' AudioArtifactsConfiguration AudioMuxType
audioArtifactsConfiguration_muxType :: (AudioMuxType -> f AudioMuxType)
-> AudioArtifactsConfiguration -> f AudioArtifactsConfiguration
audioArtifactsConfiguration_muxType = (AudioArtifactsConfiguration -> AudioMuxType)
-> (AudioArtifactsConfiguration
    -> AudioMuxType -> AudioArtifactsConfiguration)
-> Lens
     AudioArtifactsConfiguration
     AudioArtifactsConfiguration
     AudioMuxType
     AudioMuxType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AudioArtifactsConfiguration' {AudioMuxType
muxType :: AudioMuxType
$sel:muxType:AudioArtifactsConfiguration' :: AudioArtifactsConfiguration -> AudioMuxType
muxType} -> AudioMuxType
muxType) (\s :: AudioArtifactsConfiguration
s@AudioArtifactsConfiguration' {} AudioMuxType
a -> AudioArtifactsConfiguration
s {$sel:muxType:AudioArtifactsConfiguration' :: AudioMuxType
muxType = AudioMuxType
a} :: AudioArtifactsConfiguration)

instance Core.FromJSON AudioArtifactsConfiguration where
  parseJSON :: Value -> Parser AudioArtifactsConfiguration
parseJSON =
    String
-> (Object -> Parser AudioArtifactsConfiguration)
-> Value
-> Parser AudioArtifactsConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AudioArtifactsConfiguration"
      ( \Object
x ->
          AudioMuxType -> AudioArtifactsConfiguration
AudioArtifactsConfiguration'
            (AudioMuxType -> AudioArtifactsConfiguration)
-> Parser AudioMuxType -> Parser AudioArtifactsConfiguration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser AudioMuxType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"MuxType")
      )

instance Prelude.Hashable AudioArtifactsConfiguration

instance Prelude.NFData AudioArtifactsConfiguration

instance Core.ToJSON AudioArtifactsConfiguration where
  toJSON :: AudioArtifactsConfiguration -> Value
toJSON AudioArtifactsConfiguration' {AudioMuxType
muxType :: AudioMuxType
$sel:muxType:AudioArtifactsConfiguration' :: AudioArtifactsConfiguration -> AudioMuxType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MuxType" Text -> AudioMuxType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AudioMuxType
muxType)]
      )