{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateMeeting
-- 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)
--
-- Creates a new Amazon Chime SDK meeting in the specified media Region
-- with no initial attendees. For more information about specifying media
-- Regions, see
-- <https://docs.aws.amazon.com/chime/latest/dg/chime-sdk-meetings-regions.html Amazon Chime SDK Media Regions>
-- in the /Amazon Chime Developer Guide/ . For more information about the
-- Amazon Chime SDK, see
-- <https://docs.aws.amazon.com/chime/latest/dg/meetings-sdk.html Using the Amazon Chime SDK>
-- in the /Amazon Chime Developer Guide/ .
module Amazonka.Chime.CreateMeeting
  ( -- * Creating a Request
    CreateMeeting (..),
    newCreateMeeting,

    -- * Request Lenses
    createMeeting_mediaRegion,
    createMeeting_meetingHostId,
    createMeeting_notificationsConfiguration,
    createMeeting_externalMeetingId,
    createMeeting_tags,
    createMeeting_clientRequestToken,

    -- * Destructuring the Response
    CreateMeetingResponse (..),
    newCreateMeetingResponse,

    -- * Response Lenses
    createMeetingResponse_meeting,
    createMeetingResponse_httpStatus,
  )
where

import Amazonka.Chime.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateMeeting' smart constructor.
data CreateMeeting = CreateMeeting'
  { -- | The Region in which to create the meeting. Default: @us-east-1@.
    --
    -- 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@ .
    CreateMeeting -> Maybe Text
mediaRegion :: Prelude.Maybe Prelude.Text,
    -- | Reserved.
    CreateMeeting -> Maybe (Sensitive Text)
meetingHostId :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The configuration for resource targets to receive notifications when
    -- meeting and attendee events occur.
    CreateMeeting -> Maybe MeetingNotificationConfiguration
notificationsConfiguration :: Prelude.Maybe MeetingNotificationConfiguration,
    -- | The external meeting ID.
    CreateMeeting -> Maybe (Sensitive Text)
externalMeetingId :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The tag key-value pairs.
    CreateMeeting -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The unique identifier for the client request. Use a different token for
    -- different meetings.
    CreateMeeting -> Sensitive Text
clientRequestToken :: Core.Sensitive Prelude.Text
  }
  deriving (CreateMeeting -> CreateMeeting -> Bool
(CreateMeeting -> CreateMeeting -> Bool)
-> (CreateMeeting -> CreateMeeting -> Bool) -> Eq CreateMeeting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMeeting -> CreateMeeting -> Bool
$c/= :: CreateMeeting -> CreateMeeting -> Bool
== :: CreateMeeting -> CreateMeeting -> Bool
$c== :: CreateMeeting -> CreateMeeting -> Bool
Prelude.Eq, Int -> CreateMeeting -> ShowS
[CreateMeeting] -> ShowS
CreateMeeting -> String
(Int -> CreateMeeting -> ShowS)
-> (CreateMeeting -> String)
-> ([CreateMeeting] -> ShowS)
-> Show CreateMeeting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMeeting] -> ShowS
$cshowList :: [CreateMeeting] -> ShowS
show :: CreateMeeting -> String
$cshow :: CreateMeeting -> String
showsPrec :: Int -> CreateMeeting -> ShowS
$cshowsPrec :: Int -> CreateMeeting -> ShowS
Prelude.Show, (forall x. CreateMeeting -> Rep CreateMeeting x)
-> (forall x. Rep CreateMeeting x -> CreateMeeting)
-> Generic CreateMeeting
forall x. Rep CreateMeeting x -> CreateMeeting
forall x. CreateMeeting -> Rep CreateMeeting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateMeeting x -> CreateMeeting
$cfrom :: forall x. CreateMeeting -> Rep CreateMeeting x
Prelude.Generic)

-- |
-- Create a value of 'CreateMeeting' 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', 'createMeeting_mediaRegion' - The Region in which to create the meeting. Default: @us-east-1@.
--
-- 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@ .
--
-- 'meetingHostId', 'createMeeting_meetingHostId' - Reserved.
--
-- 'notificationsConfiguration', 'createMeeting_notificationsConfiguration' - The configuration for resource targets to receive notifications when
-- meeting and attendee events occur.
--
-- 'externalMeetingId', 'createMeeting_externalMeetingId' - The external meeting ID.
--
-- 'tags', 'createMeeting_tags' - The tag key-value pairs.
--
-- 'clientRequestToken', 'createMeeting_clientRequestToken' - The unique identifier for the client request. Use a different token for
-- different meetings.
newCreateMeeting ::
  -- | 'clientRequestToken'
  Prelude.Text ->
  CreateMeeting
newCreateMeeting :: Text -> CreateMeeting
newCreateMeeting Text
pClientRequestToken_ =
  CreateMeeting' :: Maybe Text
-> Maybe (Sensitive Text)
-> Maybe MeetingNotificationConfiguration
-> Maybe (Sensitive Text)
-> Maybe (NonEmpty Tag)
-> Sensitive Text
-> CreateMeeting
CreateMeeting'
    { $sel:mediaRegion:CreateMeeting' :: Maybe Text
mediaRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:meetingHostId:CreateMeeting' :: Maybe (Sensitive Text)
meetingHostId = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:notificationsConfiguration:CreateMeeting' :: Maybe MeetingNotificationConfiguration
notificationsConfiguration = Maybe MeetingNotificationConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:externalMeetingId:CreateMeeting' :: Maybe (Sensitive Text)
externalMeetingId = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateMeeting' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:CreateMeeting' :: Sensitive Text
clientRequestToken =
        Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pClientRequestToken_
    }

-- | The Region in which to create the meeting. Default: @us-east-1@.
--
-- 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@ .
createMeeting_mediaRegion :: Lens.Lens' CreateMeeting (Prelude.Maybe Prelude.Text)
createMeeting_mediaRegion :: (Maybe Text -> f (Maybe Text)) -> CreateMeeting -> f CreateMeeting
createMeeting_mediaRegion = (CreateMeeting -> Maybe Text)
-> (CreateMeeting -> Maybe Text -> CreateMeeting)
-> Lens CreateMeeting CreateMeeting (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMeeting' {Maybe Text
mediaRegion :: Maybe Text
$sel:mediaRegion:CreateMeeting' :: CreateMeeting -> Maybe Text
mediaRegion} -> Maybe Text
mediaRegion) (\s :: CreateMeeting
s@CreateMeeting' {} Maybe Text
a -> CreateMeeting
s {$sel:mediaRegion:CreateMeeting' :: Maybe Text
mediaRegion = Maybe Text
a} :: CreateMeeting)

-- | Reserved.
createMeeting_meetingHostId :: Lens.Lens' CreateMeeting (Prelude.Maybe Prelude.Text)
createMeeting_meetingHostId :: (Maybe Text -> f (Maybe Text)) -> CreateMeeting -> f CreateMeeting
createMeeting_meetingHostId = (CreateMeeting -> Maybe (Sensitive Text))
-> (CreateMeeting -> Maybe (Sensitive Text) -> CreateMeeting)
-> Lens
     CreateMeeting
     CreateMeeting
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMeeting' {Maybe (Sensitive Text)
meetingHostId :: Maybe (Sensitive Text)
$sel:meetingHostId:CreateMeeting' :: CreateMeeting -> Maybe (Sensitive Text)
meetingHostId} -> Maybe (Sensitive Text)
meetingHostId) (\s :: CreateMeeting
s@CreateMeeting' {} Maybe (Sensitive Text)
a -> CreateMeeting
s {$sel:meetingHostId:CreateMeeting' :: Maybe (Sensitive Text)
meetingHostId = Maybe (Sensitive Text)
a} :: CreateMeeting) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CreateMeeting -> f CreateMeeting)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateMeeting
-> f CreateMeeting
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 configuration for resource targets to receive notifications when
-- meeting and attendee events occur.
createMeeting_notificationsConfiguration :: Lens.Lens' CreateMeeting (Prelude.Maybe MeetingNotificationConfiguration)
createMeeting_notificationsConfiguration :: (Maybe MeetingNotificationConfiguration
 -> f (Maybe MeetingNotificationConfiguration))
-> CreateMeeting -> f CreateMeeting
createMeeting_notificationsConfiguration = (CreateMeeting -> Maybe MeetingNotificationConfiguration)
-> (CreateMeeting
    -> Maybe MeetingNotificationConfiguration -> CreateMeeting)
-> Lens
     CreateMeeting
     CreateMeeting
     (Maybe MeetingNotificationConfiguration)
     (Maybe MeetingNotificationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMeeting' {Maybe MeetingNotificationConfiguration
notificationsConfiguration :: Maybe MeetingNotificationConfiguration
$sel:notificationsConfiguration:CreateMeeting' :: CreateMeeting -> Maybe MeetingNotificationConfiguration
notificationsConfiguration} -> Maybe MeetingNotificationConfiguration
notificationsConfiguration) (\s :: CreateMeeting
s@CreateMeeting' {} Maybe MeetingNotificationConfiguration
a -> CreateMeeting
s {$sel:notificationsConfiguration:CreateMeeting' :: Maybe MeetingNotificationConfiguration
notificationsConfiguration = Maybe MeetingNotificationConfiguration
a} :: CreateMeeting)

-- | The external meeting ID.
createMeeting_externalMeetingId :: Lens.Lens' CreateMeeting (Prelude.Maybe Prelude.Text)
createMeeting_externalMeetingId :: (Maybe Text -> f (Maybe Text)) -> CreateMeeting -> f CreateMeeting
createMeeting_externalMeetingId = (CreateMeeting -> Maybe (Sensitive Text))
-> (CreateMeeting -> Maybe (Sensitive Text) -> CreateMeeting)
-> Lens
     CreateMeeting
     CreateMeeting
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMeeting' {Maybe (Sensitive Text)
externalMeetingId :: Maybe (Sensitive Text)
$sel:externalMeetingId:CreateMeeting' :: CreateMeeting -> Maybe (Sensitive Text)
externalMeetingId} -> Maybe (Sensitive Text)
externalMeetingId) (\s :: CreateMeeting
s@CreateMeeting' {} Maybe (Sensitive Text)
a -> CreateMeeting
s {$sel:externalMeetingId:CreateMeeting' :: Maybe (Sensitive Text)
externalMeetingId = Maybe (Sensitive Text)
a} :: CreateMeeting) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CreateMeeting -> f CreateMeeting)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateMeeting
-> f CreateMeeting
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 tag key-value pairs.
createMeeting_tags :: Lens.Lens' CreateMeeting (Prelude.Maybe (Prelude.NonEmpty Tag))
createMeeting_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateMeeting -> f CreateMeeting
createMeeting_tags = (CreateMeeting -> Maybe (NonEmpty Tag))
-> (CreateMeeting -> Maybe (NonEmpty Tag) -> CreateMeeting)
-> Lens
     CreateMeeting
     CreateMeeting
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMeeting' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateMeeting' :: CreateMeeting -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateMeeting
s@CreateMeeting' {} Maybe (NonEmpty Tag)
a -> CreateMeeting
s {$sel:tags:CreateMeeting' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateMeeting) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateMeeting -> f CreateMeeting)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateMeeting
-> f CreateMeeting
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unique identifier for the client request. Use a different token for
-- different meetings.
createMeeting_clientRequestToken :: Lens.Lens' CreateMeeting Prelude.Text
createMeeting_clientRequestToken :: (Text -> f Text) -> CreateMeeting -> f CreateMeeting
createMeeting_clientRequestToken = (CreateMeeting -> Sensitive Text)
-> (CreateMeeting -> Sensitive Text -> CreateMeeting)
-> Lens
     CreateMeeting CreateMeeting (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMeeting' {Sensitive Text
clientRequestToken :: Sensitive Text
$sel:clientRequestToken:CreateMeeting' :: CreateMeeting -> Sensitive Text
clientRequestToken} -> Sensitive Text
clientRequestToken) (\s :: CreateMeeting
s@CreateMeeting' {} Sensitive Text
a -> CreateMeeting
s {$sel:clientRequestToken:CreateMeeting' :: Sensitive Text
clientRequestToken = Sensitive Text
a} :: CreateMeeting) ((Sensitive Text -> f (Sensitive Text))
 -> CreateMeeting -> f CreateMeeting)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateMeeting
-> f CreateMeeting
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

instance Core.AWSRequest CreateMeeting where
  type
    AWSResponse CreateMeeting =
      CreateMeetingResponse
  request :: CreateMeeting -> Request CreateMeeting
request = Service -> CreateMeeting -> Request CreateMeeting
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateMeeting
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateMeeting)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateMeeting))
-> Logger
-> Service
-> Proxy CreateMeeting
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateMeeting)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Meeting -> Int -> CreateMeetingResponse
CreateMeetingResponse'
            (Maybe Meeting -> Int -> CreateMeetingResponse)
-> Either String (Maybe Meeting)
-> Either String (Int -> CreateMeetingResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Meeting)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Meeting")
            Either String (Int -> CreateMeetingResponse)
-> Either String Int -> Either String CreateMeetingResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateMeeting

instance Prelude.NFData CreateMeeting

instance Core.ToHeaders CreateMeeting where
  toHeaders :: CreateMeeting -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateMeeting -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON CreateMeeting where
  toJSON :: CreateMeeting -> Value
toJSON CreateMeeting' {Maybe (NonEmpty Tag)
Maybe Text
Maybe (Sensitive Text)
Maybe MeetingNotificationConfiguration
Sensitive Text
clientRequestToken :: Sensitive Text
tags :: Maybe (NonEmpty Tag)
externalMeetingId :: Maybe (Sensitive Text)
notificationsConfiguration :: Maybe MeetingNotificationConfiguration
meetingHostId :: Maybe (Sensitive Text)
mediaRegion :: Maybe Text
$sel:clientRequestToken:CreateMeeting' :: CreateMeeting -> Sensitive Text
$sel:tags:CreateMeeting' :: CreateMeeting -> Maybe (NonEmpty Tag)
$sel:externalMeetingId:CreateMeeting' :: CreateMeeting -> Maybe (Sensitive Text)
$sel:notificationsConfiguration:CreateMeeting' :: CreateMeeting -> Maybe MeetingNotificationConfiguration
$sel:meetingHostId:CreateMeeting' :: CreateMeeting -> Maybe (Sensitive Text)
$sel:mediaRegion:CreateMeeting' :: CreateMeeting -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"MediaRegion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
mediaRegion,
            (Text
"MeetingHostId" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
meetingHostId,
            (Text
"NotificationsConfiguration" Text -> MeetingNotificationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MeetingNotificationConfiguration -> Pair)
-> Maybe MeetingNotificationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MeetingNotificationConfiguration
notificationsConfiguration,
            (Text
"ExternalMeetingId" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
externalMeetingId,
            (Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ClientRequestToken" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
clientRequestToken)
          ]
      )

instance Core.ToPath CreateMeeting where
  toPath :: CreateMeeting -> ByteString
toPath = ByteString -> CreateMeeting -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/meetings"

instance Core.ToQuery CreateMeeting where
  toQuery :: CreateMeeting -> QueryString
toQuery = QueryString -> CreateMeeting -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateMeetingResponse' smart constructor.
data CreateMeetingResponse = CreateMeetingResponse'
  { -- | The meeting information, including the meeting ID and @MediaPlacement@ .
    CreateMeetingResponse -> Maybe Meeting
meeting :: Prelude.Maybe Meeting,
    -- | The response's http status code.
    CreateMeetingResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateMeetingResponse -> CreateMeetingResponse -> Bool
(CreateMeetingResponse -> CreateMeetingResponse -> Bool)
-> (CreateMeetingResponse -> CreateMeetingResponse -> Bool)
-> Eq CreateMeetingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateMeetingResponse -> CreateMeetingResponse -> Bool
$c/= :: CreateMeetingResponse -> CreateMeetingResponse -> Bool
== :: CreateMeetingResponse -> CreateMeetingResponse -> Bool
$c== :: CreateMeetingResponse -> CreateMeetingResponse -> Bool
Prelude.Eq, Int -> CreateMeetingResponse -> ShowS
[CreateMeetingResponse] -> ShowS
CreateMeetingResponse -> String
(Int -> CreateMeetingResponse -> ShowS)
-> (CreateMeetingResponse -> String)
-> ([CreateMeetingResponse] -> ShowS)
-> Show CreateMeetingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateMeetingResponse] -> ShowS
$cshowList :: [CreateMeetingResponse] -> ShowS
show :: CreateMeetingResponse -> String
$cshow :: CreateMeetingResponse -> String
showsPrec :: Int -> CreateMeetingResponse -> ShowS
$cshowsPrec :: Int -> CreateMeetingResponse -> ShowS
Prelude.Show, (forall x. CreateMeetingResponse -> Rep CreateMeetingResponse x)
-> (forall x. Rep CreateMeetingResponse x -> CreateMeetingResponse)
-> Generic CreateMeetingResponse
forall x. Rep CreateMeetingResponse x -> CreateMeetingResponse
forall x. CreateMeetingResponse -> Rep CreateMeetingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateMeetingResponse x -> CreateMeetingResponse
$cfrom :: forall x. CreateMeetingResponse -> Rep CreateMeetingResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateMeetingResponse' 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:
--
-- 'meeting', 'createMeetingResponse_meeting' - The meeting information, including the meeting ID and @MediaPlacement@ .
--
-- 'httpStatus', 'createMeetingResponse_httpStatus' - The response's http status code.
newCreateMeetingResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateMeetingResponse
newCreateMeetingResponse :: Int -> CreateMeetingResponse
newCreateMeetingResponse Int
pHttpStatus_ =
  CreateMeetingResponse' :: Maybe Meeting -> Int -> CreateMeetingResponse
CreateMeetingResponse'
    { $sel:meeting:CreateMeetingResponse' :: Maybe Meeting
meeting = Maybe Meeting
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateMeetingResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The meeting information, including the meeting ID and @MediaPlacement@ .
createMeetingResponse_meeting :: Lens.Lens' CreateMeetingResponse (Prelude.Maybe Meeting)
createMeetingResponse_meeting :: (Maybe Meeting -> f (Maybe Meeting))
-> CreateMeetingResponse -> f CreateMeetingResponse
createMeetingResponse_meeting = (CreateMeetingResponse -> Maybe Meeting)
-> (CreateMeetingResponse
    -> Maybe Meeting -> CreateMeetingResponse)
-> Lens
     CreateMeetingResponse
     CreateMeetingResponse
     (Maybe Meeting)
     (Maybe Meeting)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMeetingResponse' {Maybe Meeting
meeting :: Maybe Meeting
$sel:meeting:CreateMeetingResponse' :: CreateMeetingResponse -> Maybe Meeting
meeting} -> Maybe Meeting
meeting) (\s :: CreateMeetingResponse
s@CreateMeetingResponse' {} Maybe Meeting
a -> CreateMeetingResponse
s {$sel:meeting:CreateMeetingResponse' :: Maybe Meeting
meeting = Maybe Meeting
a} :: CreateMeetingResponse)

-- | The response's http status code.
createMeetingResponse_httpStatus :: Lens.Lens' CreateMeetingResponse Prelude.Int
createMeetingResponse_httpStatus :: (Int -> f Int) -> CreateMeetingResponse -> f CreateMeetingResponse
createMeetingResponse_httpStatus = (CreateMeetingResponse -> Int)
-> (CreateMeetingResponse -> Int -> CreateMeetingResponse)
-> Lens CreateMeetingResponse CreateMeetingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateMeetingResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateMeetingResponse' :: CreateMeetingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateMeetingResponse
s@CreateMeetingResponse' {} Int
a -> CreateMeetingResponse
s {$sel:httpStatus:CreateMeetingResponse' :: Int
httpStatus = Int
a} :: CreateMeetingResponse)

instance Prelude.NFData CreateMeetingResponse