{-# 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.IVS.Types.RecordingConfigurationSummary
-- 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.IVS.Types.RecordingConfigurationSummary where

import qualified Amazonka.Core as Core
import Amazonka.IVS.Types.DestinationConfiguration
import Amazonka.IVS.Types.RecordingConfigurationState
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Summary information about a RecordingConfiguration.
--
-- /See:/ 'newRecordingConfigurationSummary' smart constructor.
data RecordingConfigurationSummary = RecordingConfigurationSummary'
  { -- | Recording-configuration name. The value does not need to be unique.
    RecordingConfigurationSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Array of 1-50 maps, each of the form @string:string (key:value)@.
    RecordingConfigurationSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Recording-configuration ARN.
    RecordingConfigurationSummary -> Text
arn :: Prelude.Text,
    -- | A complex type that contains information about where recorded video will
    -- be stored.
    RecordingConfigurationSummary -> DestinationConfiguration
destinationConfiguration :: DestinationConfiguration,
    -- | Indicates the current state of the recording configuration. When the
    -- state is @ACTIVE@, the configuration is ready for recording a channel
    -- stream.
    RecordingConfigurationSummary -> RecordingConfigurationState
state :: RecordingConfigurationState
  }
  deriving (RecordingConfigurationSummary
-> RecordingConfigurationSummary -> Bool
(RecordingConfigurationSummary
 -> RecordingConfigurationSummary -> Bool)
-> (RecordingConfigurationSummary
    -> RecordingConfigurationSummary -> Bool)
-> Eq RecordingConfigurationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecordingConfigurationSummary
-> RecordingConfigurationSummary -> Bool
$c/= :: RecordingConfigurationSummary
-> RecordingConfigurationSummary -> Bool
== :: RecordingConfigurationSummary
-> RecordingConfigurationSummary -> Bool
$c== :: RecordingConfigurationSummary
-> RecordingConfigurationSummary -> Bool
Prelude.Eq, ReadPrec [RecordingConfigurationSummary]
ReadPrec RecordingConfigurationSummary
Int -> ReadS RecordingConfigurationSummary
ReadS [RecordingConfigurationSummary]
(Int -> ReadS RecordingConfigurationSummary)
-> ReadS [RecordingConfigurationSummary]
-> ReadPrec RecordingConfigurationSummary
-> ReadPrec [RecordingConfigurationSummary]
-> Read RecordingConfigurationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecordingConfigurationSummary]
$creadListPrec :: ReadPrec [RecordingConfigurationSummary]
readPrec :: ReadPrec RecordingConfigurationSummary
$creadPrec :: ReadPrec RecordingConfigurationSummary
readList :: ReadS [RecordingConfigurationSummary]
$creadList :: ReadS [RecordingConfigurationSummary]
readsPrec :: Int -> ReadS RecordingConfigurationSummary
$creadsPrec :: Int -> ReadS RecordingConfigurationSummary
Prelude.Read, Int -> RecordingConfigurationSummary -> ShowS
[RecordingConfigurationSummary] -> ShowS
RecordingConfigurationSummary -> String
(Int -> RecordingConfigurationSummary -> ShowS)
-> (RecordingConfigurationSummary -> String)
-> ([RecordingConfigurationSummary] -> ShowS)
-> Show RecordingConfigurationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecordingConfigurationSummary] -> ShowS
$cshowList :: [RecordingConfigurationSummary] -> ShowS
show :: RecordingConfigurationSummary -> String
$cshow :: RecordingConfigurationSummary -> String
showsPrec :: Int -> RecordingConfigurationSummary -> ShowS
$cshowsPrec :: Int -> RecordingConfigurationSummary -> ShowS
Prelude.Show, (forall x.
 RecordingConfigurationSummary
 -> Rep RecordingConfigurationSummary x)
-> (forall x.
    Rep RecordingConfigurationSummary x
    -> RecordingConfigurationSummary)
-> Generic RecordingConfigurationSummary
forall x.
Rep RecordingConfigurationSummary x
-> RecordingConfigurationSummary
forall x.
RecordingConfigurationSummary
-> Rep RecordingConfigurationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RecordingConfigurationSummary x
-> RecordingConfigurationSummary
$cfrom :: forall x.
RecordingConfigurationSummary
-> Rep RecordingConfigurationSummary x
Prelude.Generic)

-- |
-- Create a value of 'RecordingConfigurationSummary' 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:
--
-- 'name', 'recordingConfigurationSummary_name' - Recording-configuration name. The value does not need to be unique.
--
-- 'tags', 'recordingConfigurationSummary_tags' - Array of 1-50 maps, each of the form @string:string (key:value)@.
--
-- 'arn', 'recordingConfigurationSummary_arn' - Recording-configuration ARN.
--
-- 'destinationConfiguration', 'recordingConfigurationSummary_destinationConfiguration' - A complex type that contains information about where recorded video will
-- be stored.
--
-- 'state', 'recordingConfigurationSummary_state' - Indicates the current state of the recording configuration. When the
-- state is @ACTIVE@, the configuration is ready for recording a channel
-- stream.
newRecordingConfigurationSummary ::
  -- | 'arn'
  Prelude.Text ->
  -- | 'destinationConfiguration'
  DestinationConfiguration ->
  -- | 'state'
  RecordingConfigurationState ->
  RecordingConfigurationSummary
newRecordingConfigurationSummary :: Text
-> DestinationConfiguration
-> RecordingConfigurationState
-> RecordingConfigurationSummary
newRecordingConfigurationSummary
  Text
pArn_
  DestinationConfiguration
pDestinationConfiguration_
  RecordingConfigurationState
pState_ =
    RecordingConfigurationSummary' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> DestinationConfiguration
-> RecordingConfigurationState
-> RecordingConfigurationSummary
RecordingConfigurationSummary'
      { $sel:name:RecordingConfigurationSummary' :: Maybe Text
name =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:RecordingConfigurationSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:arn:RecordingConfigurationSummary' :: Text
arn = Text
pArn_,
        $sel:destinationConfiguration:RecordingConfigurationSummary' :: DestinationConfiguration
destinationConfiguration =
          DestinationConfiguration
pDestinationConfiguration_,
        $sel:state:RecordingConfigurationSummary' :: RecordingConfigurationState
state = RecordingConfigurationState
pState_
      }

-- | Recording-configuration name. The value does not need to be unique.
recordingConfigurationSummary_name :: Lens.Lens' RecordingConfigurationSummary (Prelude.Maybe Prelude.Text)
recordingConfigurationSummary_name :: (Maybe Text -> f (Maybe Text))
-> RecordingConfigurationSummary -> f RecordingConfigurationSummary
recordingConfigurationSummary_name = (RecordingConfigurationSummary -> Maybe Text)
-> (RecordingConfigurationSummary
    -> Maybe Text -> RecordingConfigurationSummary)
-> Lens
     RecordingConfigurationSummary
     RecordingConfigurationSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecordingConfigurationSummary' {Maybe Text
name :: Maybe Text
$sel:name:RecordingConfigurationSummary' :: RecordingConfigurationSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: RecordingConfigurationSummary
s@RecordingConfigurationSummary' {} Maybe Text
a -> RecordingConfigurationSummary
s {$sel:name:RecordingConfigurationSummary' :: Maybe Text
name = Maybe Text
a} :: RecordingConfigurationSummary)

-- | Array of 1-50 maps, each of the form @string:string (key:value)@.
recordingConfigurationSummary_tags :: Lens.Lens' RecordingConfigurationSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
recordingConfigurationSummary_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RecordingConfigurationSummary -> f RecordingConfigurationSummary
recordingConfigurationSummary_tags = (RecordingConfigurationSummary -> Maybe (HashMap Text Text))
-> (RecordingConfigurationSummary
    -> Maybe (HashMap Text Text) -> RecordingConfigurationSummary)
-> Lens
     RecordingConfigurationSummary
     RecordingConfigurationSummary
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecordingConfigurationSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:RecordingConfigurationSummary' :: RecordingConfigurationSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: RecordingConfigurationSummary
s@RecordingConfigurationSummary' {} Maybe (HashMap Text Text)
a -> RecordingConfigurationSummary
s {$sel:tags:RecordingConfigurationSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: RecordingConfigurationSummary) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> RecordingConfigurationSummary
 -> f RecordingConfigurationSummary)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> RecordingConfigurationSummary
-> f RecordingConfigurationSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Recording-configuration ARN.
recordingConfigurationSummary_arn :: Lens.Lens' RecordingConfigurationSummary Prelude.Text
recordingConfigurationSummary_arn :: (Text -> f Text)
-> RecordingConfigurationSummary -> f RecordingConfigurationSummary
recordingConfigurationSummary_arn = (RecordingConfigurationSummary -> Text)
-> (RecordingConfigurationSummary
    -> Text -> RecordingConfigurationSummary)
-> Lens
     RecordingConfigurationSummary
     RecordingConfigurationSummary
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecordingConfigurationSummary' {Text
arn :: Text
$sel:arn:RecordingConfigurationSummary' :: RecordingConfigurationSummary -> Text
arn} -> Text
arn) (\s :: RecordingConfigurationSummary
s@RecordingConfigurationSummary' {} Text
a -> RecordingConfigurationSummary
s {$sel:arn:RecordingConfigurationSummary' :: Text
arn = Text
a} :: RecordingConfigurationSummary)

-- | A complex type that contains information about where recorded video will
-- be stored.
recordingConfigurationSummary_destinationConfiguration :: Lens.Lens' RecordingConfigurationSummary DestinationConfiguration
recordingConfigurationSummary_destinationConfiguration :: (DestinationConfiguration -> f DestinationConfiguration)
-> RecordingConfigurationSummary -> f RecordingConfigurationSummary
recordingConfigurationSummary_destinationConfiguration = (RecordingConfigurationSummary -> DestinationConfiguration)
-> (RecordingConfigurationSummary
    -> DestinationConfiguration -> RecordingConfigurationSummary)
-> Lens
     RecordingConfigurationSummary
     RecordingConfigurationSummary
     DestinationConfiguration
     DestinationConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecordingConfigurationSummary' {DestinationConfiguration
destinationConfiguration :: DestinationConfiguration
$sel:destinationConfiguration:RecordingConfigurationSummary' :: RecordingConfigurationSummary -> DestinationConfiguration
destinationConfiguration} -> DestinationConfiguration
destinationConfiguration) (\s :: RecordingConfigurationSummary
s@RecordingConfigurationSummary' {} DestinationConfiguration
a -> RecordingConfigurationSummary
s {$sel:destinationConfiguration:RecordingConfigurationSummary' :: DestinationConfiguration
destinationConfiguration = DestinationConfiguration
a} :: RecordingConfigurationSummary)

-- | Indicates the current state of the recording configuration. When the
-- state is @ACTIVE@, the configuration is ready for recording a channel
-- stream.
recordingConfigurationSummary_state :: Lens.Lens' RecordingConfigurationSummary RecordingConfigurationState
recordingConfigurationSummary_state :: (RecordingConfigurationState -> f RecordingConfigurationState)
-> RecordingConfigurationSummary -> f RecordingConfigurationSummary
recordingConfigurationSummary_state = (RecordingConfigurationSummary -> RecordingConfigurationState)
-> (RecordingConfigurationSummary
    -> RecordingConfigurationState -> RecordingConfigurationSummary)
-> Lens
     RecordingConfigurationSummary
     RecordingConfigurationSummary
     RecordingConfigurationState
     RecordingConfigurationState
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecordingConfigurationSummary' {RecordingConfigurationState
state :: RecordingConfigurationState
$sel:state:RecordingConfigurationSummary' :: RecordingConfigurationSummary -> RecordingConfigurationState
state} -> RecordingConfigurationState
state) (\s :: RecordingConfigurationSummary
s@RecordingConfigurationSummary' {} RecordingConfigurationState
a -> RecordingConfigurationSummary
s {$sel:state:RecordingConfigurationSummary' :: RecordingConfigurationState
state = RecordingConfigurationState
a} :: RecordingConfigurationSummary)

instance Core.FromJSON RecordingConfigurationSummary where
  parseJSON :: Value -> Parser RecordingConfigurationSummary
parseJSON =
    String
-> (Object -> Parser RecordingConfigurationSummary)
-> Value
-> Parser RecordingConfigurationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RecordingConfigurationSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> DestinationConfiguration
-> RecordingConfigurationState
-> RecordingConfigurationSummary
RecordingConfigurationSummary'
            (Maybe Text
 -> Maybe (HashMap Text Text)
 -> Text
 -> DestinationConfiguration
 -> RecordingConfigurationState
 -> RecordingConfigurationSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Text
      -> DestinationConfiguration
      -> RecordingConfigurationState
      -> RecordingConfigurationSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
            Parser
  (Maybe (HashMap Text Text)
   -> Text
   -> DestinationConfiguration
   -> RecordingConfigurationState
   -> RecordingConfigurationSummary)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Text
      -> DestinationConfiguration
      -> RecordingConfigurationState
      -> RecordingConfigurationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Text
   -> DestinationConfiguration
   -> RecordingConfigurationState
   -> RecordingConfigurationSummary)
-> Parser Text
-> Parser
     (DestinationConfiguration
      -> RecordingConfigurationState -> RecordingConfigurationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"arn")
            Parser
  (DestinationConfiguration
   -> RecordingConfigurationState -> RecordingConfigurationSummary)
-> Parser DestinationConfiguration
-> Parser
     (RecordingConfigurationState -> RecordingConfigurationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DestinationConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"destinationConfiguration")
            Parser
  (RecordingConfigurationState -> RecordingConfigurationSummary)
-> Parser RecordingConfigurationState
-> Parser RecordingConfigurationSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser RecordingConfigurationState
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"state")
      )

instance
  Prelude.Hashable
    RecordingConfigurationSummary

instance Prelude.NFData RecordingConfigurationSummary