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

import qualified Amazonka.Core as Core
import Amazonka.IVS.Types.ChannelLatencyMode
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Summary information about a channel.
--
-- /See:/ 'newChannelSummary' smart constructor.
data ChannelSummary = ChannelSummary'
  { -- | Whether the channel is private (enabled for playback authorization).
    -- Default: @false@.
    ChannelSummary -> Maybe Bool
authorized :: Prelude.Maybe Prelude.Bool,
    -- | Channel ARN.
    ChannelSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Channel latency mode. Use @NORMAL@ to broadcast and deliver live video
    -- up to Full HD. Use @LOW@ for near-real-time interaction with viewers.
    -- Default: @LOW@. (Note: In the Amazon IVS console, @LOW@ and @NORMAL@
    -- correspond to Ultra-low and Standard, respectively.)
    ChannelSummary -> Maybe ChannelLatencyMode
latencyMode :: Prelude.Maybe ChannelLatencyMode,
    -- | Channel name.
    ChannelSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Recording-configuration ARN. A value other than an empty string
    -- indicates that recording is enabled. Default: \"\" (empty string,
    -- recording is disabled).
    ChannelSummary -> Maybe Text
recordingConfigurationArn :: Prelude.Maybe Prelude.Text,
    -- | Array of 1-50 maps, each of the form @string:string (key:value)@.
    ChannelSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (ChannelSummary -> ChannelSummary -> Bool
(ChannelSummary -> ChannelSummary -> Bool)
-> (ChannelSummary -> ChannelSummary -> Bool) -> Eq ChannelSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelSummary -> ChannelSummary -> Bool
$c/= :: ChannelSummary -> ChannelSummary -> Bool
== :: ChannelSummary -> ChannelSummary -> Bool
$c== :: ChannelSummary -> ChannelSummary -> Bool
Prelude.Eq, ReadPrec [ChannelSummary]
ReadPrec ChannelSummary
Int -> ReadS ChannelSummary
ReadS [ChannelSummary]
(Int -> ReadS ChannelSummary)
-> ReadS [ChannelSummary]
-> ReadPrec ChannelSummary
-> ReadPrec [ChannelSummary]
-> Read ChannelSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChannelSummary]
$creadListPrec :: ReadPrec [ChannelSummary]
readPrec :: ReadPrec ChannelSummary
$creadPrec :: ReadPrec ChannelSummary
readList :: ReadS [ChannelSummary]
$creadList :: ReadS [ChannelSummary]
readsPrec :: Int -> ReadS ChannelSummary
$creadsPrec :: Int -> ReadS ChannelSummary
Prelude.Read, Int -> ChannelSummary -> ShowS
[ChannelSummary] -> ShowS
ChannelSummary -> String
(Int -> ChannelSummary -> ShowS)
-> (ChannelSummary -> String)
-> ([ChannelSummary] -> ShowS)
-> Show ChannelSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelSummary] -> ShowS
$cshowList :: [ChannelSummary] -> ShowS
show :: ChannelSummary -> String
$cshow :: ChannelSummary -> String
showsPrec :: Int -> ChannelSummary -> ShowS
$cshowsPrec :: Int -> ChannelSummary -> ShowS
Prelude.Show, (forall x. ChannelSummary -> Rep ChannelSummary x)
-> (forall x. Rep ChannelSummary x -> ChannelSummary)
-> Generic ChannelSummary
forall x. Rep ChannelSummary x -> ChannelSummary
forall x. ChannelSummary -> Rep ChannelSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelSummary x -> ChannelSummary
$cfrom :: forall x. ChannelSummary -> Rep ChannelSummary x
Prelude.Generic)

-- |
-- Create a value of 'ChannelSummary' 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:
--
-- 'authorized', 'channelSummary_authorized' - Whether the channel is private (enabled for playback authorization).
-- Default: @false@.
--
-- 'arn', 'channelSummary_arn' - Channel ARN.
--
-- 'latencyMode', 'channelSummary_latencyMode' - Channel latency mode. Use @NORMAL@ to broadcast and deliver live video
-- up to Full HD. Use @LOW@ for near-real-time interaction with viewers.
-- Default: @LOW@. (Note: In the Amazon IVS console, @LOW@ and @NORMAL@
-- correspond to Ultra-low and Standard, respectively.)
--
-- 'name', 'channelSummary_name' - Channel name.
--
-- 'recordingConfigurationArn', 'channelSummary_recordingConfigurationArn' - Recording-configuration ARN. A value other than an empty string
-- indicates that recording is enabled. Default: \"\" (empty string,
-- recording is disabled).
--
-- 'tags', 'channelSummary_tags' - Array of 1-50 maps, each of the form @string:string (key:value)@.
newChannelSummary ::
  ChannelSummary
newChannelSummary :: ChannelSummary
newChannelSummary =
  ChannelSummary' :: Maybe Bool
-> Maybe Text
-> Maybe ChannelLatencyMode
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ChannelSummary
ChannelSummary'
    { $sel:authorized:ChannelSummary' :: Maybe Bool
authorized = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ChannelSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latencyMode:ChannelSummary' :: Maybe ChannelLatencyMode
latencyMode = Maybe ChannelLatencyMode
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ChannelSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recordingConfigurationArn:ChannelSummary' :: Maybe Text
recordingConfigurationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ChannelSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | Whether the channel is private (enabled for playback authorization).
-- Default: @false@.
channelSummary_authorized :: Lens.Lens' ChannelSummary (Prelude.Maybe Prelude.Bool)
channelSummary_authorized :: (Maybe Bool -> f (Maybe Bool))
-> ChannelSummary -> f ChannelSummary
channelSummary_authorized = (ChannelSummary -> Maybe Bool)
-> (ChannelSummary -> Maybe Bool -> ChannelSummary)
-> Lens ChannelSummary ChannelSummary (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSummary' {Maybe Bool
authorized :: Maybe Bool
$sel:authorized:ChannelSummary' :: ChannelSummary -> Maybe Bool
authorized} -> Maybe Bool
authorized) (\s :: ChannelSummary
s@ChannelSummary' {} Maybe Bool
a -> ChannelSummary
s {$sel:authorized:ChannelSummary' :: Maybe Bool
authorized = Maybe Bool
a} :: ChannelSummary)

-- | Channel ARN.
channelSummary_arn :: Lens.Lens' ChannelSummary (Prelude.Maybe Prelude.Text)
channelSummary_arn :: (Maybe Text -> f (Maybe Text))
-> ChannelSummary -> f ChannelSummary
channelSummary_arn = (ChannelSummary -> Maybe Text)
-> (ChannelSummary -> Maybe Text -> ChannelSummary)
-> Lens ChannelSummary ChannelSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:ChannelSummary' :: ChannelSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ChannelSummary
s@ChannelSummary' {} Maybe Text
a -> ChannelSummary
s {$sel:arn:ChannelSummary' :: Maybe Text
arn = Maybe Text
a} :: ChannelSummary)

-- | Channel latency mode. Use @NORMAL@ to broadcast and deliver live video
-- up to Full HD. Use @LOW@ for near-real-time interaction with viewers.
-- Default: @LOW@. (Note: In the Amazon IVS console, @LOW@ and @NORMAL@
-- correspond to Ultra-low and Standard, respectively.)
channelSummary_latencyMode :: Lens.Lens' ChannelSummary (Prelude.Maybe ChannelLatencyMode)
channelSummary_latencyMode :: (Maybe ChannelLatencyMode -> f (Maybe ChannelLatencyMode))
-> ChannelSummary -> f ChannelSummary
channelSummary_latencyMode = (ChannelSummary -> Maybe ChannelLatencyMode)
-> (ChannelSummary -> Maybe ChannelLatencyMode -> ChannelSummary)
-> Lens
     ChannelSummary
     ChannelSummary
     (Maybe ChannelLatencyMode)
     (Maybe ChannelLatencyMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSummary' {Maybe ChannelLatencyMode
latencyMode :: Maybe ChannelLatencyMode
$sel:latencyMode:ChannelSummary' :: ChannelSummary -> Maybe ChannelLatencyMode
latencyMode} -> Maybe ChannelLatencyMode
latencyMode) (\s :: ChannelSummary
s@ChannelSummary' {} Maybe ChannelLatencyMode
a -> ChannelSummary
s {$sel:latencyMode:ChannelSummary' :: Maybe ChannelLatencyMode
latencyMode = Maybe ChannelLatencyMode
a} :: ChannelSummary)

-- | Channel name.
channelSummary_name :: Lens.Lens' ChannelSummary (Prelude.Maybe Prelude.Text)
channelSummary_name :: (Maybe Text -> f (Maybe Text))
-> ChannelSummary -> f ChannelSummary
channelSummary_name = (ChannelSummary -> Maybe Text)
-> (ChannelSummary -> Maybe Text -> ChannelSummary)
-> Lens ChannelSummary ChannelSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSummary' {Maybe Text
name :: Maybe Text
$sel:name:ChannelSummary' :: ChannelSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ChannelSummary
s@ChannelSummary' {} Maybe Text
a -> ChannelSummary
s {$sel:name:ChannelSummary' :: Maybe Text
name = Maybe Text
a} :: ChannelSummary)

-- | Recording-configuration ARN. A value other than an empty string
-- indicates that recording is enabled. Default: \"\" (empty string,
-- recording is disabled).
channelSummary_recordingConfigurationArn :: Lens.Lens' ChannelSummary (Prelude.Maybe Prelude.Text)
channelSummary_recordingConfigurationArn :: (Maybe Text -> f (Maybe Text))
-> ChannelSummary -> f ChannelSummary
channelSummary_recordingConfigurationArn = (ChannelSummary -> Maybe Text)
-> (ChannelSummary -> Maybe Text -> ChannelSummary)
-> Lens ChannelSummary ChannelSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelSummary' {Maybe Text
recordingConfigurationArn :: Maybe Text
$sel:recordingConfigurationArn:ChannelSummary' :: ChannelSummary -> Maybe Text
recordingConfigurationArn} -> Maybe Text
recordingConfigurationArn) (\s :: ChannelSummary
s@ChannelSummary' {} Maybe Text
a -> ChannelSummary
s {$sel:recordingConfigurationArn:ChannelSummary' :: Maybe Text
recordingConfigurationArn = Maybe Text
a} :: ChannelSummary)

-- | Array of 1-50 maps, each of the form @string:string (key:value)@.
channelSummary_tags :: Lens.Lens' ChannelSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
channelSummary_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ChannelSummary -> f ChannelSummary
channelSummary_tags = (ChannelSummary -> Maybe (HashMap Text Text))
-> (ChannelSummary -> Maybe (HashMap Text Text) -> ChannelSummary)
-> Lens
     ChannelSummary
     ChannelSummary
     (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 (\ChannelSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ChannelSummary' :: ChannelSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ChannelSummary
s@ChannelSummary' {} Maybe (HashMap Text Text)
a -> ChannelSummary
s {$sel:tags:ChannelSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ChannelSummary) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ChannelSummary -> f ChannelSummary)
-> ((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)))
-> ChannelSummary
-> f ChannelSummary
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

instance Core.FromJSON ChannelSummary where
  parseJSON :: Value -> Parser ChannelSummary
parseJSON =
    String
-> (Object -> Parser ChannelSummary)
-> Value
-> Parser ChannelSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ChannelSummary"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe ChannelLatencyMode
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ChannelSummary
ChannelSummary'
            (Maybe Bool
 -> Maybe Text
 -> Maybe ChannelLatencyMode
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> ChannelSummary)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe ChannelLatencyMode
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> ChannelSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"authorized")
            Parser
  (Maybe Text
   -> Maybe ChannelLatencyMode
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> ChannelSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe ChannelLatencyMode
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> ChannelSummary)
forall (f :: * -> *) a b. Applicative f => 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
"arn")
            Parser
  (Maybe ChannelLatencyMode
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> ChannelSummary)
-> Parser (Maybe ChannelLatencyMode)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe (HashMap Text Text) -> ChannelSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ChannelLatencyMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"latencyMode")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe (HashMap Text Text) -> ChannelSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe (HashMap Text Text) -> ChannelSummary)
forall (f :: * -> *) a b. Applicative f => 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 Text -> Maybe (HashMap Text Text) -> ChannelSummary)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> ChannelSummary)
forall (f :: * -> *) a b. Applicative f => 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
"recordingConfigurationArn")
            Parser (Maybe (HashMap Text Text) -> ChannelSummary)
-> Parser (Maybe (HashMap Text Text)) -> Parser ChannelSummary
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)
      )

instance Prelude.Hashable ChannelSummary

instance Prelude.NFData ChannelSummary