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

import Amazonka.Chime.Types.AudioArtifactsConfiguration
import Amazonka.Chime.Types.ContentArtifactsConfiguration
import Amazonka.Chime.Types.VideoArtifactsConfiguration
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The configuration for the artifacts.
--
-- /See:/ 'newArtifactsConfiguration' smart constructor.
data ArtifactsConfiguration = ArtifactsConfiguration'
  { -- | The configuration for the audio artifacts.
    ArtifactsConfiguration -> AudioArtifactsConfiguration
audio :: AudioArtifactsConfiguration,
    -- | The configuration for the video artifacts.
    ArtifactsConfiguration -> VideoArtifactsConfiguration
video :: VideoArtifactsConfiguration,
    -- | The configuration for the content artifacts.
    ArtifactsConfiguration -> ContentArtifactsConfiguration
content :: ContentArtifactsConfiguration
  }
  deriving (ArtifactsConfiguration -> ArtifactsConfiguration -> Bool
(ArtifactsConfiguration -> ArtifactsConfiguration -> Bool)
-> (ArtifactsConfiguration -> ArtifactsConfiguration -> Bool)
-> Eq ArtifactsConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ArtifactsConfiguration -> ArtifactsConfiguration -> Bool
$c/= :: ArtifactsConfiguration -> ArtifactsConfiguration -> Bool
== :: ArtifactsConfiguration -> ArtifactsConfiguration -> Bool
$c== :: ArtifactsConfiguration -> ArtifactsConfiguration -> Bool
Prelude.Eq, ReadPrec [ArtifactsConfiguration]
ReadPrec ArtifactsConfiguration
Int -> ReadS ArtifactsConfiguration
ReadS [ArtifactsConfiguration]
(Int -> ReadS ArtifactsConfiguration)
-> ReadS [ArtifactsConfiguration]
-> ReadPrec ArtifactsConfiguration
-> ReadPrec [ArtifactsConfiguration]
-> Read ArtifactsConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ArtifactsConfiguration]
$creadListPrec :: ReadPrec [ArtifactsConfiguration]
readPrec :: ReadPrec ArtifactsConfiguration
$creadPrec :: ReadPrec ArtifactsConfiguration
readList :: ReadS [ArtifactsConfiguration]
$creadList :: ReadS [ArtifactsConfiguration]
readsPrec :: Int -> ReadS ArtifactsConfiguration
$creadsPrec :: Int -> ReadS ArtifactsConfiguration
Prelude.Read, Int -> ArtifactsConfiguration -> ShowS
[ArtifactsConfiguration] -> ShowS
ArtifactsConfiguration -> String
(Int -> ArtifactsConfiguration -> ShowS)
-> (ArtifactsConfiguration -> String)
-> ([ArtifactsConfiguration] -> ShowS)
-> Show ArtifactsConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ArtifactsConfiguration] -> ShowS
$cshowList :: [ArtifactsConfiguration] -> ShowS
show :: ArtifactsConfiguration -> String
$cshow :: ArtifactsConfiguration -> String
showsPrec :: Int -> ArtifactsConfiguration -> ShowS
$cshowsPrec :: Int -> ArtifactsConfiguration -> ShowS
Prelude.Show, (forall x. ArtifactsConfiguration -> Rep ArtifactsConfiguration x)
-> (forall x.
    Rep ArtifactsConfiguration x -> ArtifactsConfiguration)
-> Generic ArtifactsConfiguration
forall x. Rep ArtifactsConfiguration x -> ArtifactsConfiguration
forall x. ArtifactsConfiguration -> Rep ArtifactsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ArtifactsConfiguration x -> ArtifactsConfiguration
$cfrom :: forall x. ArtifactsConfiguration -> Rep ArtifactsConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ArtifactsConfiguration' 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:
--
-- 'audio', 'artifactsConfiguration_audio' - The configuration for the audio artifacts.
--
-- 'video', 'artifactsConfiguration_video' - The configuration for the video artifacts.
--
-- 'content', 'artifactsConfiguration_content' - The configuration for the content artifacts.
newArtifactsConfiguration ::
  -- | 'audio'
  AudioArtifactsConfiguration ->
  -- | 'video'
  VideoArtifactsConfiguration ->
  -- | 'content'
  ContentArtifactsConfiguration ->
  ArtifactsConfiguration
newArtifactsConfiguration :: AudioArtifactsConfiguration
-> VideoArtifactsConfiguration
-> ContentArtifactsConfiguration
-> ArtifactsConfiguration
newArtifactsConfiguration AudioArtifactsConfiguration
pAudio_ VideoArtifactsConfiguration
pVideo_ ContentArtifactsConfiguration
pContent_ =
  ArtifactsConfiguration' :: AudioArtifactsConfiguration
-> VideoArtifactsConfiguration
-> ContentArtifactsConfiguration
-> ArtifactsConfiguration
ArtifactsConfiguration'
    { $sel:audio:ArtifactsConfiguration' :: AudioArtifactsConfiguration
audio = AudioArtifactsConfiguration
pAudio_,
      $sel:video:ArtifactsConfiguration' :: VideoArtifactsConfiguration
video = VideoArtifactsConfiguration
pVideo_,
      $sel:content:ArtifactsConfiguration' :: ContentArtifactsConfiguration
content = ContentArtifactsConfiguration
pContent_
    }

-- | The configuration for the audio artifacts.
artifactsConfiguration_audio :: Lens.Lens' ArtifactsConfiguration AudioArtifactsConfiguration
artifactsConfiguration_audio :: (AudioArtifactsConfiguration -> f AudioArtifactsConfiguration)
-> ArtifactsConfiguration -> f ArtifactsConfiguration
artifactsConfiguration_audio = (ArtifactsConfiguration -> AudioArtifactsConfiguration)
-> (ArtifactsConfiguration
    -> AudioArtifactsConfiguration -> ArtifactsConfiguration)
-> Lens
     ArtifactsConfiguration
     ArtifactsConfiguration
     AudioArtifactsConfiguration
     AudioArtifactsConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactsConfiguration' {AudioArtifactsConfiguration
audio :: AudioArtifactsConfiguration
$sel:audio:ArtifactsConfiguration' :: ArtifactsConfiguration -> AudioArtifactsConfiguration
audio} -> AudioArtifactsConfiguration
audio) (\s :: ArtifactsConfiguration
s@ArtifactsConfiguration' {} AudioArtifactsConfiguration
a -> ArtifactsConfiguration
s {$sel:audio:ArtifactsConfiguration' :: AudioArtifactsConfiguration
audio = AudioArtifactsConfiguration
a} :: ArtifactsConfiguration)

-- | The configuration for the video artifacts.
artifactsConfiguration_video :: Lens.Lens' ArtifactsConfiguration VideoArtifactsConfiguration
artifactsConfiguration_video :: (VideoArtifactsConfiguration -> f VideoArtifactsConfiguration)
-> ArtifactsConfiguration -> f ArtifactsConfiguration
artifactsConfiguration_video = (ArtifactsConfiguration -> VideoArtifactsConfiguration)
-> (ArtifactsConfiguration
    -> VideoArtifactsConfiguration -> ArtifactsConfiguration)
-> Lens
     ArtifactsConfiguration
     ArtifactsConfiguration
     VideoArtifactsConfiguration
     VideoArtifactsConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactsConfiguration' {VideoArtifactsConfiguration
video :: VideoArtifactsConfiguration
$sel:video:ArtifactsConfiguration' :: ArtifactsConfiguration -> VideoArtifactsConfiguration
video} -> VideoArtifactsConfiguration
video) (\s :: ArtifactsConfiguration
s@ArtifactsConfiguration' {} VideoArtifactsConfiguration
a -> ArtifactsConfiguration
s {$sel:video:ArtifactsConfiguration' :: VideoArtifactsConfiguration
video = VideoArtifactsConfiguration
a} :: ArtifactsConfiguration)

-- | The configuration for the content artifacts.
artifactsConfiguration_content :: Lens.Lens' ArtifactsConfiguration ContentArtifactsConfiguration
artifactsConfiguration_content :: (ContentArtifactsConfiguration -> f ContentArtifactsConfiguration)
-> ArtifactsConfiguration -> f ArtifactsConfiguration
artifactsConfiguration_content = (ArtifactsConfiguration -> ContentArtifactsConfiguration)
-> (ArtifactsConfiguration
    -> ContentArtifactsConfiguration -> ArtifactsConfiguration)
-> Lens
     ArtifactsConfiguration
     ArtifactsConfiguration
     ContentArtifactsConfiguration
     ContentArtifactsConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ArtifactsConfiguration' {ContentArtifactsConfiguration
content :: ContentArtifactsConfiguration
$sel:content:ArtifactsConfiguration' :: ArtifactsConfiguration -> ContentArtifactsConfiguration
content} -> ContentArtifactsConfiguration
content) (\s :: ArtifactsConfiguration
s@ArtifactsConfiguration' {} ContentArtifactsConfiguration
a -> ArtifactsConfiguration
s {$sel:content:ArtifactsConfiguration' :: ContentArtifactsConfiguration
content = ContentArtifactsConfiguration
a} :: ArtifactsConfiguration)

instance Core.FromJSON ArtifactsConfiguration where
  parseJSON :: Value -> Parser ArtifactsConfiguration
parseJSON =
    String
-> (Object -> Parser ArtifactsConfiguration)
-> Value
-> Parser ArtifactsConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ArtifactsConfiguration"
      ( \Object
x ->
          AudioArtifactsConfiguration
-> VideoArtifactsConfiguration
-> ContentArtifactsConfiguration
-> ArtifactsConfiguration
ArtifactsConfiguration'
            (AudioArtifactsConfiguration
 -> VideoArtifactsConfiguration
 -> ContentArtifactsConfiguration
 -> ArtifactsConfiguration)
-> Parser AudioArtifactsConfiguration
-> Parser
     (VideoArtifactsConfiguration
      -> ContentArtifactsConfiguration -> ArtifactsConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser AudioArtifactsConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Audio")
            Parser
  (VideoArtifactsConfiguration
   -> ContentArtifactsConfiguration -> ArtifactsConfiguration)
-> Parser VideoArtifactsConfiguration
-> Parser (ContentArtifactsConfiguration -> ArtifactsConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser VideoArtifactsConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Video")
            Parser (ContentArtifactsConfiguration -> ArtifactsConfiguration)
-> Parser ContentArtifactsConfiguration
-> Parser ArtifactsConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ContentArtifactsConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Content")
      )

instance Prelude.Hashable ArtifactsConfiguration

instance Prelude.NFData ArtifactsConfiguration

instance Core.ToJSON ArtifactsConfiguration where
  toJSON :: ArtifactsConfiguration -> Value
toJSON ArtifactsConfiguration' {AudioArtifactsConfiguration
ContentArtifactsConfiguration
VideoArtifactsConfiguration
content :: ContentArtifactsConfiguration
video :: VideoArtifactsConfiguration
audio :: AudioArtifactsConfiguration
$sel:content:ArtifactsConfiguration' :: ArtifactsConfiguration -> ContentArtifactsConfiguration
$sel:video:ArtifactsConfiguration' :: ArtifactsConfiguration -> VideoArtifactsConfiguration
$sel:audio:ArtifactsConfiguration' :: ArtifactsConfiguration -> AudioArtifactsConfiguration
..} =
    [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
"Audio" Text -> AudioArtifactsConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AudioArtifactsConfiguration
audio),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Video" Text -> VideoArtifactsConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= VideoArtifactsConfiguration
video),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Content" Text -> ContentArtifactsConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ContentArtifactsConfiguration
content)
          ]
      )