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

import Amazonka.Chime.Types.ArtifactsState
import Amazonka.Chime.Types.VideoMuxType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The video artifact configuration object.
--
-- /See:/ 'newVideoArtifactsConfiguration' smart constructor.
data VideoArtifactsConfiguration = VideoArtifactsConfiguration'
  { -- | The MUX type of the video artifact configuration object.
    VideoArtifactsConfiguration -> Maybe VideoMuxType
muxType :: Prelude.Maybe VideoMuxType,
    -- | Indicates whether the video artifact is enabled or disabled.
    VideoArtifactsConfiguration -> ArtifactsState
state :: ArtifactsState
  }
  deriving (VideoArtifactsConfiguration -> VideoArtifactsConfiguration -> Bool
(VideoArtifactsConfiguration
 -> VideoArtifactsConfiguration -> Bool)
-> (VideoArtifactsConfiguration
    -> VideoArtifactsConfiguration -> Bool)
-> Eq VideoArtifactsConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VideoArtifactsConfiguration -> VideoArtifactsConfiguration -> Bool
$c/= :: VideoArtifactsConfiguration -> VideoArtifactsConfiguration -> Bool
== :: VideoArtifactsConfiguration -> VideoArtifactsConfiguration -> Bool
$c== :: VideoArtifactsConfiguration -> VideoArtifactsConfiguration -> Bool
Prelude.Eq, ReadPrec [VideoArtifactsConfiguration]
ReadPrec VideoArtifactsConfiguration
Int -> ReadS VideoArtifactsConfiguration
ReadS [VideoArtifactsConfiguration]
(Int -> ReadS VideoArtifactsConfiguration)
-> ReadS [VideoArtifactsConfiguration]
-> ReadPrec VideoArtifactsConfiguration
-> ReadPrec [VideoArtifactsConfiguration]
-> Read VideoArtifactsConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VideoArtifactsConfiguration]
$creadListPrec :: ReadPrec [VideoArtifactsConfiguration]
readPrec :: ReadPrec VideoArtifactsConfiguration
$creadPrec :: ReadPrec VideoArtifactsConfiguration
readList :: ReadS [VideoArtifactsConfiguration]
$creadList :: ReadS [VideoArtifactsConfiguration]
readsPrec :: Int -> ReadS VideoArtifactsConfiguration
$creadsPrec :: Int -> ReadS VideoArtifactsConfiguration
Prelude.Read, Int -> VideoArtifactsConfiguration -> ShowS
[VideoArtifactsConfiguration] -> ShowS
VideoArtifactsConfiguration -> String
(Int -> VideoArtifactsConfiguration -> ShowS)
-> (VideoArtifactsConfiguration -> String)
-> ([VideoArtifactsConfiguration] -> ShowS)
-> Show VideoArtifactsConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VideoArtifactsConfiguration] -> ShowS
$cshowList :: [VideoArtifactsConfiguration] -> ShowS
show :: VideoArtifactsConfiguration -> String
$cshow :: VideoArtifactsConfiguration -> String
showsPrec :: Int -> VideoArtifactsConfiguration -> ShowS
$cshowsPrec :: Int -> VideoArtifactsConfiguration -> ShowS
Prelude.Show, (forall x.
 VideoArtifactsConfiguration -> Rep VideoArtifactsConfiguration x)
-> (forall x.
    Rep VideoArtifactsConfiguration x -> VideoArtifactsConfiguration)
-> Generic VideoArtifactsConfiguration
forall x.
Rep VideoArtifactsConfiguration x -> VideoArtifactsConfiguration
forall x.
VideoArtifactsConfiguration -> Rep VideoArtifactsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VideoArtifactsConfiguration x -> VideoArtifactsConfiguration
$cfrom :: forall x.
VideoArtifactsConfiguration -> Rep VideoArtifactsConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'VideoArtifactsConfiguration' 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', 'videoArtifactsConfiguration_muxType' - The MUX type of the video artifact configuration object.
--
-- 'state', 'videoArtifactsConfiguration_state' - Indicates whether the video artifact is enabled or disabled.
newVideoArtifactsConfiguration ::
  -- | 'state'
  ArtifactsState ->
  VideoArtifactsConfiguration
newVideoArtifactsConfiguration :: ArtifactsState -> VideoArtifactsConfiguration
newVideoArtifactsConfiguration ArtifactsState
pState_ =
  VideoArtifactsConfiguration' :: Maybe VideoMuxType -> ArtifactsState -> VideoArtifactsConfiguration
VideoArtifactsConfiguration'
    { $sel:muxType:VideoArtifactsConfiguration' :: Maybe VideoMuxType
muxType =
        Maybe VideoMuxType
forall a. Maybe a
Prelude.Nothing,
      $sel:state:VideoArtifactsConfiguration' :: ArtifactsState
state = ArtifactsState
pState_
    }

-- | The MUX type of the video artifact configuration object.
videoArtifactsConfiguration_muxType :: Lens.Lens' VideoArtifactsConfiguration (Prelude.Maybe VideoMuxType)
videoArtifactsConfiguration_muxType :: (Maybe VideoMuxType -> f (Maybe VideoMuxType))
-> VideoArtifactsConfiguration -> f VideoArtifactsConfiguration
videoArtifactsConfiguration_muxType = (VideoArtifactsConfiguration -> Maybe VideoMuxType)
-> (VideoArtifactsConfiguration
    -> Maybe VideoMuxType -> VideoArtifactsConfiguration)
-> Lens
     VideoArtifactsConfiguration
     VideoArtifactsConfiguration
     (Maybe VideoMuxType)
     (Maybe VideoMuxType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoArtifactsConfiguration' {Maybe VideoMuxType
muxType :: Maybe VideoMuxType
$sel:muxType:VideoArtifactsConfiguration' :: VideoArtifactsConfiguration -> Maybe VideoMuxType
muxType} -> Maybe VideoMuxType
muxType) (\s :: VideoArtifactsConfiguration
s@VideoArtifactsConfiguration' {} Maybe VideoMuxType
a -> VideoArtifactsConfiguration
s {$sel:muxType:VideoArtifactsConfiguration' :: Maybe VideoMuxType
muxType = Maybe VideoMuxType
a} :: VideoArtifactsConfiguration)

-- | Indicates whether the video artifact is enabled or disabled.
videoArtifactsConfiguration_state :: Lens.Lens' VideoArtifactsConfiguration ArtifactsState
videoArtifactsConfiguration_state :: (ArtifactsState -> f ArtifactsState)
-> VideoArtifactsConfiguration -> f VideoArtifactsConfiguration
videoArtifactsConfiguration_state = (VideoArtifactsConfiguration -> ArtifactsState)
-> (VideoArtifactsConfiguration
    -> ArtifactsState -> VideoArtifactsConfiguration)
-> Lens
     VideoArtifactsConfiguration
     VideoArtifactsConfiguration
     ArtifactsState
     ArtifactsState
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VideoArtifactsConfiguration' {ArtifactsState
state :: ArtifactsState
$sel:state:VideoArtifactsConfiguration' :: VideoArtifactsConfiguration -> ArtifactsState
state} -> ArtifactsState
state) (\s :: VideoArtifactsConfiguration
s@VideoArtifactsConfiguration' {} ArtifactsState
a -> VideoArtifactsConfiguration
s {$sel:state:VideoArtifactsConfiguration' :: ArtifactsState
state = ArtifactsState
a} :: VideoArtifactsConfiguration)

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

instance Prelude.Hashable VideoArtifactsConfiguration

instance Prelude.NFData VideoArtifactsConfiguration

instance Core.ToJSON VideoArtifactsConfiguration where
  toJSON :: VideoArtifactsConfiguration -> Value
toJSON VideoArtifactsConfiguration' {Maybe VideoMuxType
ArtifactsState
state :: ArtifactsState
muxType :: Maybe VideoMuxType
$sel:state:VideoArtifactsConfiguration' :: VideoArtifactsConfiguration -> ArtifactsState
$sel:muxType:VideoArtifactsConfiguration' :: VideoArtifactsConfiguration -> Maybe VideoMuxType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"MuxType" Text -> VideoMuxType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VideoMuxType -> Pair) -> Maybe VideoMuxType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VideoMuxType
muxType,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"State" Text -> ArtifactsState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ArtifactsState
state)
          ]
      )