{-# 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.MediaConnect.Types.MediaStreamAttributes
-- 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.MediaConnect.Types.MediaStreamAttributes where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConnect.Types.Fmtp
import qualified Amazonka.Prelude as Prelude

-- | Attributes that are related to the media stream.
--
-- /See:/ 'newMediaStreamAttributes' smart constructor.
data MediaStreamAttributes = MediaStreamAttributes'
  { -- | The audio language, in a format that is recognized by the receiver.
    MediaStreamAttributes -> Maybe Text
lang :: Prelude.Maybe Prelude.Text,
    -- | A set of parameters that define the media stream.
    MediaStreamAttributes -> Fmtp
fmtp :: Fmtp
  }
  deriving (MediaStreamAttributes -> MediaStreamAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MediaStreamAttributes -> MediaStreamAttributes -> Bool
$c/= :: MediaStreamAttributes -> MediaStreamAttributes -> Bool
== :: MediaStreamAttributes -> MediaStreamAttributes -> Bool
$c== :: MediaStreamAttributes -> MediaStreamAttributes -> Bool
Prelude.Eq, ReadPrec [MediaStreamAttributes]
ReadPrec MediaStreamAttributes
Int -> ReadS MediaStreamAttributes
ReadS [MediaStreamAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MediaStreamAttributes]
$creadListPrec :: ReadPrec [MediaStreamAttributes]
readPrec :: ReadPrec MediaStreamAttributes
$creadPrec :: ReadPrec MediaStreamAttributes
readList :: ReadS [MediaStreamAttributes]
$creadList :: ReadS [MediaStreamAttributes]
readsPrec :: Int -> ReadS MediaStreamAttributes
$creadsPrec :: Int -> ReadS MediaStreamAttributes
Prelude.Read, Int -> MediaStreamAttributes -> ShowS
[MediaStreamAttributes] -> ShowS
MediaStreamAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MediaStreamAttributes] -> ShowS
$cshowList :: [MediaStreamAttributes] -> ShowS
show :: MediaStreamAttributes -> String
$cshow :: MediaStreamAttributes -> String
showsPrec :: Int -> MediaStreamAttributes -> ShowS
$cshowsPrec :: Int -> MediaStreamAttributes -> ShowS
Prelude.Show, forall x. Rep MediaStreamAttributes x -> MediaStreamAttributes
forall x. MediaStreamAttributes -> Rep MediaStreamAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MediaStreamAttributes x -> MediaStreamAttributes
$cfrom :: forall x. MediaStreamAttributes -> Rep MediaStreamAttributes x
Prelude.Generic)

-- |
-- Create a value of 'MediaStreamAttributes' 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:
--
-- 'lang', 'mediaStreamAttributes_lang' - The audio language, in a format that is recognized by the receiver.
--
-- 'fmtp', 'mediaStreamAttributes_fmtp' - A set of parameters that define the media stream.
newMediaStreamAttributes ::
  -- | 'fmtp'
  Fmtp ->
  MediaStreamAttributes
newMediaStreamAttributes :: Fmtp -> MediaStreamAttributes
newMediaStreamAttributes Fmtp
pFmtp_ =
  MediaStreamAttributes'
    { $sel:lang:MediaStreamAttributes' :: Maybe Text
lang = forall a. Maybe a
Prelude.Nothing,
      $sel:fmtp:MediaStreamAttributes' :: Fmtp
fmtp = Fmtp
pFmtp_
    }

-- | The audio language, in a format that is recognized by the receiver.
mediaStreamAttributes_lang :: Lens.Lens' MediaStreamAttributes (Prelude.Maybe Prelude.Text)
mediaStreamAttributes_lang :: Lens' MediaStreamAttributes (Maybe Text)
mediaStreamAttributes_lang = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStreamAttributes' {Maybe Text
lang :: Maybe Text
$sel:lang:MediaStreamAttributes' :: MediaStreamAttributes -> Maybe Text
lang} -> Maybe Text
lang) (\s :: MediaStreamAttributes
s@MediaStreamAttributes' {} Maybe Text
a -> MediaStreamAttributes
s {$sel:lang:MediaStreamAttributes' :: Maybe Text
lang = Maybe Text
a} :: MediaStreamAttributes)

-- | A set of parameters that define the media stream.
mediaStreamAttributes_fmtp :: Lens.Lens' MediaStreamAttributes Fmtp
mediaStreamAttributes_fmtp :: Lens' MediaStreamAttributes Fmtp
mediaStreamAttributes_fmtp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStreamAttributes' {Fmtp
fmtp :: Fmtp
$sel:fmtp:MediaStreamAttributes' :: MediaStreamAttributes -> Fmtp
fmtp} -> Fmtp
fmtp) (\s :: MediaStreamAttributes
s@MediaStreamAttributes' {} Fmtp
a -> MediaStreamAttributes
s {$sel:fmtp:MediaStreamAttributes' :: Fmtp
fmtp = Fmtp
a} :: MediaStreamAttributes)

instance Data.FromJSON MediaStreamAttributes where
  parseJSON :: Value -> Parser MediaStreamAttributes
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MediaStreamAttributes"
      ( \Object
x ->
          Maybe Text -> Fmtp -> MediaStreamAttributes
MediaStreamAttributes'
            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
"lang")
            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
"fmtp")
      )

instance Prelude.Hashable MediaStreamAttributes where
  hashWithSalt :: Int -> MediaStreamAttributes -> Int
hashWithSalt Int
_salt MediaStreamAttributes' {Maybe Text
Fmtp
fmtp :: Fmtp
lang :: Maybe Text
$sel:fmtp:MediaStreamAttributes' :: MediaStreamAttributes -> Fmtp
$sel:lang:MediaStreamAttributes' :: MediaStreamAttributes -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lang
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Fmtp
fmtp

instance Prelude.NFData MediaStreamAttributes where
  rnf :: MediaStreamAttributes -> ()
rnf MediaStreamAttributes' {Maybe Text
Fmtp
fmtp :: Fmtp
lang :: Maybe Text
$sel:fmtp:MediaStreamAttributes' :: MediaStreamAttributes -> Fmtp
$sel:lang:MediaStreamAttributes' :: MediaStreamAttributes -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lang seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Fmtp
fmtp