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

import Amazonka.Chime.Types.MediaPlacement
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A meeting created using the Amazon Chime SDK.
--
-- /See:/ 'newMeeting' smart constructor.
data Meeting = Meeting'
  { -- | The Region in which you create the meeting. Available values:
    -- @af-south-1@, @ap-northeast-1@, @ap-northeast-2@, @ap-south-1@,
    -- @ap-southeast-1@, @ap-southeast-2@, @ca-central-1@, @eu-central-1@,
    -- @eu-north-1@, @eu-south-1@, @eu-west-1@, @eu-west-2@, @eu-west-3@,
    -- @sa-east-1@, @us-east-1@, @us-east-2@, @us-west-1@, @us-west-2@.
    Meeting -> Maybe Text
mediaRegion :: Prelude.Maybe Prelude.Text,
    -- | The media placement for the meeting.
    Meeting -> Maybe MediaPlacement
mediaPlacement :: Prelude.Maybe MediaPlacement,
    -- | The external meeting ID.
    Meeting -> Maybe (Sensitive Text)
externalMeetingId :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The Amazon Chime SDK meeting ID.
    Meeting -> Maybe Text
meetingId :: Prelude.Maybe Prelude.Text
  }
  deriving (Meeting -> Meeting -> Bool
(Meeting -> Meeting -> Bool)
-> (Meeting -> Meeting -> Bool) -> Eq Meeting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Meeting -> Meeting -> Bool
$c/= :: Meeting -> Meeting -> Bool
== :: Meeting -> Meeting -> Bool
$c== :: Meeting -> Meeting -> Bool
Prelude.Eq, Int -> Meeting -> ShowS
[Meeting] -> ShowS
Meeting -> String
(Int -> Meeting -> ShowS)
-> (Meeting -> String) -> ([Meeting] -> ShowS) -> Show Meeting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Meeting] -> ShowS
$cshowList :: [Meeting] -> ShowS
show :: Meeting -> String
$cshow :: Meeting -> String
showsPrec :: Int -> Meeting -> ShowS
$cshowsPrec :: Int -> Meeting -> ShowS
Prelude.Show, (forall x. Meeting -> Rep Meeting x)
-> (forall x. Rep Meeting x -> Meeting) -> Generic Meeting
forall x. Rep Meeting x -> Meeting
forall x. Meeting -> Rep Meeting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Meeting x -> Meeting
$cfrom :: forall x. Meeting -> Rep Meeting x
Prelude.Generic)

-- |
-- Create a value of 'Meeting' 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:
--
-- 'mediaRegion', 'meeting_mediaRegion' - The Region in which you create the meeting. Available values:
-- @af-south-1@, @ap-northeast-1@, @ap-northeast-2@, @ap-south-1@,
-- @ap-southeast-1@, @ap-southeast-2@, @ca-central-1@, @eu-central-1@,
-- @eu-north-1@, @eu-south-1@, @eu-west-1@, @eu-west-2@, @eu-west-3@,
-- @sa-east-1@, @us-east-1@, @us-east-2@, @us-west-1@, @us-west-2@.
--
-- 'mediaPlacement', 'meeting_mediaPlacement' - The media placement for the meeting.
--
-- 'externalMeetingId', 'meeting_externalMeetingId' - The external meeting ID.
--
-- 'meetingId', 'meeting_meetingId' - The Amazon Chime SDK meeting ID.
newMeeting ::
  Meeting
newMeeting :: Meeting
newMeeting =
  Meeting' :: Maybe Text
-> Maybe MediaPlacement
-> Maybe (Sensitive Text)
-> Maybe Text
-> Meeting
Meeting'
    { $sel:mediaRegion:Meeting' :: Maybe Text
mediaRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:mediaPlacement:Meeting' :: Maybe MediaPlacement
mediaPlacement = Maybe MediaPlacement
forall a. Maybe a
Prelude.Nothing,
      $sel:externalMeetingId:Meeting' :: Maybe (Sensitive Text)
externalMeetingId = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:meetingId:Meeting' :: Maybe Text
meetingId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Region in which you create the meeting. Available values:
-- @af-south-1@, @ap-northeast-1@, @ap-northeast-2@, @ap-south-1@,
-- @ap-southeast-1@, @ap-southeast-2@, @ca-central-1@, @eu-central-1@,
-- @eu-north-1@, @eu-south-1@, @eu-west-1@, @eu-west-2@, @eu-west-3@,
-- @sa-east-1@, @us-east-1@, @us-east-2@, @us-west-1@, @us-west-2@.
meeting_mediaRegion :: Lens.Lens' Meeting (Prelude.Maybe Prelude.Text)
meeting_mediaRegion :: (Maybe Text -> f (Maybe Text)) -> Meeting -> f Meeting
meeting_mediaRegion = (Meeting -> Maybe Text)
-> (Meeting -> Maybe Text -> Meeting)
-> Lens Meeting Meeting (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Meeting' {Maybe Text
mediaRegion :: Maybe Text
$sel:mediaRegion:Meeting' :: Meeting -> Maybe Text
mediaRegion} -> Maybe Text
mediaRegion) (\s :: Meeting
s@Meeting' {} Maybe Text
a -> Meeting
s {$sel:mediaRegion:Meeting' :: Maybe Text
mediaRegion = Maybe Text
a} :: Meeting)

-- | The media placement for the meeting.
meeting_mediaPlacement :: Lens.Lens' Meeting (Prelude.Maybe MediaPlacement)
meeting_mediaPlacement :: (Maybe MediaPlacement -> f (Maybe MediaPlacement))
-> Meeting -> f Meeting
meeting_mediaPlacement = (Meeting -> Maybe MediaPlacement)
-> (Meeting -> Maybe MediaPlacement -> Meeting)
-> Lens
     Meeting Meeting (Maybe MediaPlacement) (Maybe MediaPlacement)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Meeting' {Maybe MediaPlacement
mediaPlacement :: Maybe MediaPlacement
$sel:mediaPlacement:Meeting' :: Meeting -> Maybe MediaPlacement
mediaPlacement} -> Maybe MediaPlacement
mediaPlacement) (\s :: Meeting
s@Meeting' {} Maybe MediaPlacement
a -> Meeting
s {$sel:mediaPlacement:Meeting' :: Maybe MediaPlacement
mediaPlacement = Maybe MediaPlacement
a} :: Meeting)

-- | The external meeting ID.
meeting_externalMeetingId :: Lens.Lens' Meeting (Prelude.Maybe Prelude.Text)
meeting_externalMeetingId :: (Maybe Text -> f (Maybe Text)) -> Meeting -> f Meeting
meeting_externalMeetingId = (Meeting -> Maybe (Sensitive Text))
-> (Meeting -> Maybe (Sensitive Text) -> Meeting)
-> Lens
     Meeting Meeting (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Meeting' {Maybe (Sensitive Text)
externalMeetingId :: Maybe (Sensitive Text)
$sel:externalMeetingId:Meeting' :: Meeting -> Maybe (Sensitive Text)
externalMeetingId} -> Maybe (Sensitive Text)
externalMeetingId) (\s :: Meeting
s@Meeting' {} Maybe (Sensitive Text)
a -> Meeting
s {$sel:externalMeetingId:Meeting' :: Maybe (Sensitive Text)
externalMeetingId = Maybe (Sensitive Text)
a} :: Meeting) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> Meeting -> f Meeting)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Meeting
-> f Meeting
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The Amazon Chime SDK meeting ID.
meeting_meetingId :: Lens.Lens' Meeting (Prelude.Maybe Prelude.Text)
meeting_meetingId :: (Maybe Text -> f (Maybe Text)) -> Meeting -> f Meeting
meeting_meetingId = (Meeting -> Maybe Text)
-> (Meeting -> Maybe Text -> Meeting)
-> Lens Meeting Meeting (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Meeting' {Maybe Text
meetingId :: Maybe Text
$sel:meetingId:Meeting' :: Meeting -> Maybe Text
meetingId} -> Maybe Text
meetingId) (\s :: Meeting
s@Meeting' {} Maybe Text
a -> Meeting
s {$sel:meetingId:Meeting' :: Maybe Text
meetingId = Maybe Text
a} :: Meeting)

instance Core.FromJSON Meeting where
  parseJSON :: Value -> Parser Meeting
parseJSON =
    String -> (Object -> Parser Meeting) -> Value -> Parser Meeting
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Meeting"
      ( \Object
x ->
          Maybe Text
-> Maybe MediaPlacement
-> Maybe (Sensitive Text)
-> Maybe Text
-> Meeting
Meeting'
            (Maybe Text
 -> Maybe MediaPlacement
 -> Maybe (Sensitive Text)
 -> Maybe Text
 -> Meeting)
-> Parser (Maybe Text)
-> Parser
     (Maybe MediaPlacement
      -> Maybe (Sensitive Text) -> Maybe Text -> Meeting)
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
"MediaRegion")
            Parser
  (Maybe MediaPlacement
   -> Maybe (Sensitive Text) -> Maybe Text -> Meeting)
-> Parser (Maybe MediaPlacement)
-> Parser (Maybe (Sensitive Text) -> Maybe Text -> Meeting)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MediaPlacement)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MediaPlacement")
            Parser (Maybe (Sensitive Text) -> Maybe Text -> Meeting)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Text -> Meeting)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExternalMeetingId")
            Parser (Maybe Text -> Meeting)
-> Parser (Maybe Text) -> Parser Meeting
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
"MeetingId")
      )

instance Prelude.Hashable Meeting

instance Prelude.NFData Meeting