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

import Amazonka.ChimeSdkMediaPipelines.Types.ArtifactsState
import Amazonka.ChimeSdkMediaPipelines.Types.VideoMuxType
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

-- | 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
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]
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
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.
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'
    { $sel:muxType:VideoArtifactsConfiguration' :: Maybe VideoMuxType
muxType =
        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 :: Lens' VideoArtifactsConfiguration (Maybe VideoMuxType)
videoArtifactsConfiguration_muxType = 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 :: Lens' VideoArtifactsConfiguration ArtifactsState
videoArtifactsConfiguration_state = 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 Data.FromJSON VideoArtifactsConfiguration where
  parseJSON :: Value -> Parser VideoArtifactsConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VideoArtifactsConfiguration"
      ( \Object
x ->
          Maybe VideoMuxType -> ArtifactsState -> VideoArtifactsConfiguration
VideoArtifactsConfiguration'
            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
"MuxType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"State")
      )

instance Prelude.Hashable VideoArtifactsConfiguration where
  hashWithSalt :: Int -> VideoArtifactsConfiguration -> Int
hashWithSalt Int
_salt VideoArtifactsConfiguration' {Maybe VideoMuxType
ArtifactsState
state :: ArtifactsState
muxType :: Maybe VideoMuxType
$sel:state:VideoArtifactsConfiguration' :: VideoArtifactsConfiguration -> ArtifactsState
$sel:muxType:VideoArtifactsConfiguration' :: VideoArtifactsConfiguration -> Maybe VideoMuxType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VideoMuxType
muxType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ArtifactsState
state

instance Prelude.NFData VideoArtifactsConfiguration where
  rnf :: VideoArtifactsConfiguration -> ()
rnf VideoArtifactsConfiguration' {Maybe VideoMuxType
ArtifactsState
state :: ArtifactsState
muxType :: Maybe VideoMuxType
$sel:state:VideoArtifactsConfiguration' :: VideoArtifactsConfiguration -> ArtifactsState
$sel:muxType:VideoArtifactsConfiguration' :: VideoArtifactsConfiguration -> Maybe VideoMuxType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe VideoMuxType
muxType seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ArtifactsState
state

instance Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MuxType" 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 VideoMuxType
muxType,
            forall a. a -> Maybe a
Prelude.Just (Key
"State" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ArtifactsState
state)
          ]
      )