{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IVS.Types.ChannelSummary where

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

-- | Summary information about a channel.
--
-- /See:/ 'newChannelSummary' smart constructor.
data ChannelSummary = ChannelSummary'
  { -- | Channel ARN.
    ChannelSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Whether the channel is private (enabled for playback authorization).
    -- Default: @false@.
    ChannelSummary -> Maybe Bool
authorized :: Prelude.Maybe Prelude.Bool,
    -- | 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)@. See
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
    -- for more information, including restrictions that apply to tags and
    -- \"Tag naming limits and requirements\"; Amazon IVS has no
    -- service-specific constraints beyond what is documented there.
    ChannelSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (ChannelSummary -> ChannelSummary -> Bool
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]
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
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. 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:
--
-- 'arn', 'channelSummary_arn' - Channel ARN.
--
-- 'authorized', 'channelSummary_authorized' - Whether the channel is private (enabled for playback authorization).
-- Default: @false@.
--
-- '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)@. See
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
-- for more information, including restrictions that apply to tags and
-- \"Tag naming limits and requirements\"; Amazon IVS has no
-- service-specific constraints beyond what is documented there.
newChannelSummary ::
  ChannelSummary
newChannelSummary :: ChannelSummary
newChannelSummary =
  ChannelSummary'
    { $sel:arn:ChannelSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:authorized:ChannelSummary' :: Maybe Bool
authorized = forall a. Maybe a
Prelude.Nothing,
      $sel:latencyMode:ChannelSummary' :: Maybe ChannelLatencyMode
latencyMode = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ChannelSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:recordingConfigurationArn:ChannelSummary' :: Maybe Text
recordingConfigurationArn = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ChannelSummary' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | Channel ARN.
channelSummary_arn :: Lens.Lens' ChannelSummary (Prelude.Maybe Prelude.Text)
channelSummary_arn :: Lens' ChannelSummary (Maybe Text)
channelSummary_arn = 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)

-- | Whether the channel is private (enabled for playback authorization).
-- Default: @false@.
channelSummary_authorized :: Lens.Lens' ChannelSummary (Prelude.Maybe Prelude.Bool)
channelSummary_authorized :: Lens' ChannelSummary (Maybe Bool)
channelSummary_authorized = 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 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 :: Lens' ChannelSummary (Maybe ChannelLatencyMode)
channelSummary_latencyMode = 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 :: Lens' ChannelSummary (Maybe Text)
channelSummary_name = 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 :: Lens' ChannelSummary (Maybe Text)
channelSummary_recordingConfigurationArn = 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)@. See
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>
-- for more information, including restrictions that apply to tags and
-- \"Tag naming limits and requirements\"; Amazon IVS has no
-- service-specific constraints beyond what is documented there.
channelSummary_tags :: Lens.Lens' ChannelSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
channelSummary_tags :: Lens' ChannelSummary (Maybe (HashMap Text Text))
channelSummary_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable ChannelSummary where
  hashWithSalt :: Int -> ChannelSummary -> Int
hashWithSalt Int
_salt ChannelSummary' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe ChannelLatencyMode
tags :: Maybe (HashMap Text Text)
recordingConfigurationArn :: Maybe Text
name :: Maybe Text
latencyMode :: Maybe ChannelLatencyMode
authorized :: Maybe Bool
arn :: Maybe Text
$sel:tags:ChannelSummary' :: ChannelSummary -> Maybe (HashMap Text Text)
$sel:recordingConfigurationArn:ChannelSummary' :: ChannelSummary -> Maybe Text
$sel:name:ChannelSummary' :: ChannelSummary -> Maybe Text
$sel:latencyMode:ChannelSummary' :: ChannelSummary -> Maybe ChannelLatencyMode
$sel:authorized:ChannelSummary' :: ChannelSummary -> Maybe Bool
$sel:arn:ChannelSummary' :: ChannelSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
authorized
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChannelLatencyMode
latencyMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recordingConfigurationArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance Prelude.NFData ChannelSummary where
  rnf :: ChannelSummary -> ()
rnf ChannelSummary' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Maybe ChannelLatencyMode
tags :: Maybe (HashMap Text Text)
recordingConfigurationArn :: Maybe Text
name :: Maybe Text
latencyMode :: Maybe ChannelLatencyMode
authorized :: Maybe Bool
arn :: Maybe Text
$sel:tags:ChannelSummary' :: ChannelSummary -> Maybe (HashMap Text Text)
$sel:recordingConfigurationArn:ChannelSummary' :: ChannelSummary -> Maybe Text
$sel:name:ChannelSummary' :: ChannelSummary -> Maybe Text
$sel:latencyMode:ChannelSummary' :: ChannelSummary -> Maybe ChannelLatencyMode
$sel:authorized:ChannelSummary' :: ChannelSummary -> Maybe Bool
$sel:arn:ChannelSummary' :: ChannelSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
authorized
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ChannelLatencyMode
latencyMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recordingConfigurationArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags