{-# 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.Chime.Types.MediaPlacement
-- 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.Chime.Types.MediaPlacement where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A set of endpoints used by clients to connect to the media service group
-- for an Amazon Chime SDK meeting.
--
-- /See:/ 'newMediaPlacement' smart constructor.
data MediaPlacement = MediaPlacement'
  { -- | The screen data URL.
    MediaPlacement -> Maybe Text
screenDataUrl :: Prelude.Maybe Prelude.Text,
    -- | The event ingestion URL.
    MediaPlacement -> Maybe Text
eventIngestionUrl :: Prelude.Maybe Prelude.Text,
    -- | The signaling URL.
    MediaPlacement -> Maybe Text
signalingUrl :: Prelude.Maybe Prelude.Text,
    -- | The screen sharing URL.
    MediaPlacement -> Maybe Text
screenSharingUrl :: Prelude.Maybe Prelude.Text,
    -- | The screen viewing URL.
    MediaPlacement -> Maybe Text
screenViewingUrl :: Prelude.Maybe Prelude.Text,
    -- | The audio host URL.
    MediaPlacement -> Maybe Text
audioHostUrl :: Prelude.Maybe Prelude.Text,
    -- | The audio fallback URL.
    MediaPlacement -> Maybe Text
audioFallbackUrl :: Prelude.Maybe Prelude.Text,
    -- | The turn control URL.
    MediaPlacement -> Maybe Text
turnControlUrl :: Prelude.Maybe Prelude.Text
  }
  deriving (MediaPlacement -> MediaPlacement -> Bool
(MediaPlacement -> MediaPlacement -> Bool)
-> (MediaPlacement -> MediaPlacement -> Bool) -> Eq MediaPlacement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MediaPlacement -> MediaPlacement -> Bool
$c/= :: MediaPlacement -> MediaPlacement -> Bool
== :: MediaPlacement -> MediaPlacement -> Bool
$c== :: MediaPlacement -> MediaPlacement -> Bool
Prelude.Eq, ReadPrec [MediaPlacement]
ReadPrec MediaPlacement
Int -> ReadS MediaPlacement
ReadS [MediaPlacement]
(Int -> ReadS MediaPlacement)
-> ReadS [MediaPlacement]
-> ReadPrec MediaPlacement
-> ReadPrec [MediaPlacement]
-> Read MediaPlacement
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MediaPlacement]
$creadListPrec :: ReadPrec [MediaPlacement]
readPrec :: ReadPrec MediaPlacement
$creadPrec :: ReadPrec MediaPlacement
readList :: ReadS [MediaPlacement]
$creadList :: ReadS [MediaPlacement]
readsPrec :: Int -> ReadS MediaPlacement
$creadsPrec :: Int -> ReadS MediaPlacement
Prelude.Read, Int -> MediaPlacement -> ShowS
[MediaPlacement] -> ShowS
MediaPlacement -> String
(Int -> MediaPlacement -> ShowS)
-> (MediaPlacement -> String)
-> ([MediaPlacement] -> ShowS)
-> Show MediaPlacement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MediaPlacement] -> ShowS
$cshowList :: [MediaPlacement] -> ShowS
show :: MediaPlacement -> String
$cshow :: MediaPlacement -> String
showsPrec :: Int -> MediaPlacement -> ShowS
$cshowsPrec :: Int -> MediaPlacement -> ShowS
Prelude.Show, (forall x. MediaPlacement -> Rep MediaPlacement x)
-> (forall x. Rep MediaPlacement x -> MediaPlacement)
-> Generic MediaPlacement
forall x. Rep MediaPlacement x -> MediaPlacement
forall x. MediaPlacement -> Rep MediaPlacement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MediaPlacement x -> MediaPlacement
$cfrom :: forall x. MediaPlacement -> Rep MediaPlacement x
Prelude.Generic)

-- |
-- Create a value of 'MediaPlacement' 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:
--
-- 'screenDataUrl', 'mediaPlacement_screenDataUrl' - The screen data URL.
--
-- 'eventIngestionUrl', 'mediaPlacement_eventIngestionUrl' - The event ingestion URL.
--
-- 'signalingUrl', 'mediaPlacement_signalingUrl' - The signaling URL.
--
-- 'screenSharingUrl', 'mediaPlacement_screenSharingUrl' - The screen sharing URL.
--
-- 'screenViewingUrl', 'mediaPlacement_screenViewingUrl' - The screen viewing URL.
--
-- 'audioHostUrl', 'mediaPlacement_audioHostUrl' - The audio host URL.
--
-- 'audioFallbackUrl', 'mediaPlacement_audioFallbackUrl' - The audio fallback URL.
--
-- 'turnControlUrl', 'mediaPlacement_turnControlUrl' - The turn control URL.
newMediaPlacement ::
  MediaPlacement
newMediaPlacement :: MediaPlacement
newMediaPlacement =
  MediaPlacement' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MediaPlacement
MediaPlacement'
    { $sel:screenDataUrl:MediaPlacement' :: Maybe Text
screenDataUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eventIngestionUrl:MediaPlacement' :: Maybe Text
eventIngestionUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:signalingUrl:MediaPlacement' :: Maybe Text
signalingUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:screenSharingUrl:MediaPlacement' :: Maybe Text
screenSharingUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:screenViewingUrl:MediaPlacement' :: Maybe Text
screenViewingUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:audioHostUrl:MediaPlacement' :: Maybe Text
audioHostUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:audioFallbackUrl:MediaPlacement' :: Maybe Text
audioFallbackUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:turnControlUrl:MediaPlacement' :: Maybe Text
turnControlUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The screen data URL.
mediaPlacement_screenDataUrl :: Lens.Lens' MediaPlacement (Prelude.Maybe Prelude.Text)
mediaPlacement_screenDataUrl :: (Maybe Text -> f (Maybe Text))
-> MediaPlacement -> f MediaPlacement
mediaPlacement_screenDataUrl = (MediaPlacement -> Maybe Text)
-> (MediaPlacement -> Maybe Text -> MediaPlacement)
-> Lens MediaPlacement MediaPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaPlacement' {Maybe Text
screenDataUrl :: Maybe Text
$sel:screenDataUrl:MediaPlacement' :: MediaPlacement -> Maybe Text
screenDataUrl} -> Maybe Text
screenDataUrl) (\s :: MediaPlacement
s@MediaPlacement' {} Maybe Text
a -> MediaPlacement
s {$sel:screenDataUrl:MediaPlacement' :: Maybe Text
screenDataUrl = Maybe Text
a} :: MediaPlacement)

-- | The event ingestion URL.
mediaPlacement_eventIngestionUrl :: Lens.Lens' MediaPlacement (Prelude.Maybe Prelude.Text)
mediaPlacement_eventIngestionUrl :: (Maybe Text -> f (Maybe Text))
-> MediaPlacement -> f MediaPlacement
mediaPlacement_eventIngestionUrl = (MediaPlacement -> Maybe Text)
-> (MediaPlacement -> Maybe Text -> MediaPlacement)
-> Lens MediaPlacement MediaPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaPlacement' {Maybe Text
eventIngestionUrl :: Maybe Text
$sel:eventIngestionUrl:MediaPlacement' :: MediaPlacement -> Maybe Text
eventIngestionUrl} -> Maybe Text
eventIngestionUrl) (\s :: MediaPlacement
s@MediaPlacement' {} Maybe Text
a -> MediaPlacement
s {$sel:eventIngestionUrl:MediaPlacement' :: Maybe Text
eventIngestionUrl = Maybe Text
a} :: MediaPlacement)

-- | The signaling URL.
mediaPlacement_signalingUrl :: Lens.Lens' MediaPlacement (Prelude.Maybe Prelude.Text)
mediaPlacement_signalingUrl :: (Maybe Text -> f (Maybe Text))
-> MediaPlacement -> f MediaPlacement
mediaPlacement_signalingUrl = (MediaPlacement -> Maybe Text)
-> (MediaPlacement -> Maybe Text -> MediaPlacement)
-> Lens MediaPlacement MediaPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaPlacement' {Maybe Text
signalingUrl :: Maybe Text
$sel:signalingUrl:MediaPlacement' :: MediaPlacement -> Maybe Text
signalingUrl} -> Maybe Text
signalingUrl) (\s :: MediaPlacement
s@MediaPlacement' {} Maybe Text
a -> MediaPlacement
s {$sel:signalingUrl:MediaPlacement' :: Maybe Text
signalingUrl = Maybe Text
a} :: MediaPlacement)

-- | The screen sharing URL.
mediaPlacement_screenSharingUrl :: Lens.Lens' MediaPlacement (Prelude.Maybe Prelude.Text)
mediaPlacement_screenSharingUrl :: (Maybe Text -> f (Maybe Text))
-> MediaPlacement -> f MediaPlacement
mediaPlacement_screenSharingUrl = (MediaPlacement -> Maybe Text)
-> (MediaPlacement -> Maybe Text -> MediaPlacement)
-> Lens MediaPlacement MediaPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaPlacement' {Maybe Text
screenSharingUrl :: Maybe Text
$sel:screenSharingUrl:MediaPlacement' :: MediaPlacement -> Maybe Text
screenSharingUrl} -> Maybe Text
screenSharingUrl) (\s :: MediaPlacement
s@MediaPlacement' {} Maybe Text
a -> MediaPlacement
s {$sel:screenSharingUrl:MediaPlacement' :: Maybe Text
screenSharingUrl = Maybe Text
a} :: MediaPlacement)

-- | The screen viewing URL.
mediaPlacement_screenViewingUrl :: Lens.Lens' MediaPlacement (Prelude.Maybe Prelude.Text)
mediaPlacement_screenViewingUrl :: (Maybe Text -> f (Maybe Text))
-> MediaPlacement -> f MediaPlacement
mediaPlacement_screenViewingUrl = (MediaPlacement -> Maybe Text)
-> (MediaPlacement -> Maybe Text -> MediaPlacement)
-> Lens MediaPlacement MediaPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaPlacement' {Maybe Text
screenViewingUrl :: Maybe Text
$sel:screenViewingUrl:MediaPlacement' :: MediaPlacement -> Maybe Text
screenViewingUrl} -> Maybe Text
screenViewingUrl) (\s :: MediaPlacement
s@MediaPlacement' {} Maybe Text
a -> MediaPlacement
s {$sel:screenViewingUrl:MediaPlacement' :: Maybe Text
screenViewingUrl = Maybe Text
a} :: MediaPlacement)

-- | The audio host URL.
mediaPlacement_audioHostUrl :: Lens.Lens' MediaPlacement (Prelude.Maybe Prelude.Text)
mediaPlacement_audioHostUrl :: (Maybe Text -> f (Maybe Text))
-> MediaPlacement -> f MediaPlacement
mediaPlacement_audioHostUrl = (MediaPlacement -> Maybe Text)
-> (MediaPlacement -> Maybe Text -> MediaPlacement)
-> Lens MediaPlacement MediaPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaPlacement' {Maybe Text
audioHostUrl :: Maybe Text
$sel:audioHostUrl:MediaPlacement' :: MediaPlacement -> Maybe Text
audioHostUrl} -> Maybe Text
audioHostUrl) (\s :: MediaPlacement
s@MediaPlacement' {} Maybe Text
a -> MediaPlacement
s {$sel:audioHostUrl:MediaPlacement' :: Maybe Text
audioHostUrl = Maybe Text
a} :: MediaPlacement)

-- | The audio fallback URL.
mediaPlacement_audioFallbackUrl :: Lens.Lens' MediaPlacement (Prelude.Maybe Prelude.Text)
mediaPlacement_audioFallbackUrl :: (Maybe Text -> f (Maybe Text))
-> MediaPlacement -> f MediaPlacement
mediaPlacement_audioFallbackUrl = (MediaPlacement -> Maybe Text)
-> (MediaPlacement -> Maybe Text -> MediaPlacement)
-> Lens MediaPlacement MediaPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaPlacement' {Maybe Text
audioFallbackUrl :: Maybe Text
$sel:audioFallbackUrl:MediaPlacement' :: MediaPlacement -> Maybe Text
audioFallbackUrl} -> Maybe Text
audioFallbackUrl) (\s :: MediaPlacement
s@MediaPlacement' {} Maybe Text
a -> MediaPlacement
s {$sel:audioFallbackUrl:MediaPlacement' :: Maybe Text
audioFallbackUrl = Maybe Text
a} :: MediaPlacement)

-- | The turn control URL.
mediaPlacement_turnControlUrl :: Lens.Lens' MediaPlacement (Prelude.Maybe Prelude.Text)
mediaPlacement_turnControlUrl :: (Maybe Text -> f (Maybe Text))
-> MediaPlacement -> f MediaPlacement
mediaPlacement_turnControlUrl = (MediaPlacement -> Maybe Text)
-> (MediaPlacement -> Maybe Text -> MediaPlacement)
-> Lens MediaPlacement MediaPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaPlacement' {Maybe Text
turnControlUrl :: Maybe Text
$sel:turnControlUrl:MediaPlacement' :: MediaPlacement -> Maybe Text
turnControlUrl} -> Maybe Text
turnControlUrl) (\s :: MediaPlacement
s@MediaPlacement' {} Maybe Text
a -> MediaPlacement
s {$sel:turnControlUrl:MediaPlacement' :: Maybe Text
turnControlUrl = Maybe Text
a} :: MediaPlacement)

instance Core.FromJSON MediaPlacement where
  parseJSON :: Value -> Parser MediaPlacement
parseJSON =
    String
-> (Object -> Parser MediaPlacement)
-> Value
-> Parser MediaPlacement
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MediaPlacement"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MediaPlacement
MediaPlacement'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> MediaPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> MediaPlacement)
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
"ScreenDataUrl")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> MediaPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> MediaPlacement)
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
"EventIngestionUrl")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> MediaPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> MediaPlacement)
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
"SignalingUrl")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> MediaPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> MediaPlacement)
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
"ScreenSharingUrl")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> MediaPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> MediaPlacement)
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
"ScreenViewingUrl")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> MediaPlacement)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> MediaPlacement)
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
"AudioHostUrl")
            Parser (Maybe Text -> Maybe Text -> MediaPlacement)
-> Parser (Maybe Text) -> Parser (Maybe Text -> MediaPlacement)
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
"AudioFallbackUrl")
            Parser (Maybe Text -> MediaPlacement)
-> Parser (Maybe Text) -> Parser MediaPlacement
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
"TurnControlUrl")
      )

instance Prelude.Hashable MediaPlacement

instance Prelude.NFData MediaPlacement