{-# 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.ConnectParticipant.CreateParticipantConnection
-- 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 the participant\'s connection. Note that ParticipantToken is
-- used for invoking this API instead of ConnectionToken.
--
-- The participant token is valid for the lifetime of the participant –
-- until they are part of a contact.
--
-- The response URL for @WEBSOCKET@ Type has a connect expiry timeout of
-- 100s. Clients must manually connect to the returned websocket URL and
-- subscribe to the desired topic.
--
-- For chat, you need to publish the following on the established websocket
-- connection:
--
-- @{\"topic\":\"aws\/subscribe\",\"content\":{\"topics\":[\"aws\/chat\"]}}@
--
-- Upon websocket URL expiry, as specified in the response ConnectionExpiry
-- parameter, clients need to call this API again to obtain a new websocket
-- URL and perform the same steps as before.
--
-- The Amazon Connect Participant Service APIs do not use
-- <https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html Signature Version 4 authentication>.
module Amazonka.ConnectParticipant.CreateParticipantConnection
  ( -- * Creating a Request
    CreateParticipantConnection (..),
    newCreateParticipantConnection,

    -- * Request Lenses
    createParticipantConnection_type,
    createParticipantConnection_participantToken,

    -- * Destructuring the Response
    CreateParticipantConnectionResponse (..),
    newCreateParticipantConnectionResponse,

    -- * Response Lenses
    createParticipantConnectionResponse_connectionCredentials,
    createParticipantConnectionResponse_websocket,
    createParticipantConnectionResponse_httpStatus,
  )
where

import Amazonka.ConnectParticipant.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:/ 'newCreateParticipantConnection' smart constructor.
data CreateParticipantConnection = CreateParticipantConnection'
  { -- | Type of connection information required.
    CreateParticipantConnection -> NonEmpty ConnectionType
type' :: Prelude.NonEmpty ConnectionType,
    -- | This is a header parameter.
    --
    -- The Participant Token as obtained from
    -- <https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html StartChatContact>
    -- API response.
    CreateParticipantConnection -> Text
participantToken :: Prelude.Text
  }
  deriving (CreateParticipantConnection -> CreateParticipantConnection -> Bool
(CreateParticipantConnection
 -> CreateParticipantConnection -> Bool)
-> (CreateParticipantConnection
    -> CreateParticipantConnection -> Bool)
-> Eq CreateParticipantConnection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateParticipantConnection -> CreateParticipantConnection -> Bool
$c/= :: CreateParticipantConnection -> CreateParticipantConnection -> Bool
== :: CreateParticipantConnection -> CreateParticipantConnection -> Bool
$c== :: CreateParticipantConnection -> CreateParticipantConnection -> Bool
Prelude.Eq, ReadPrec [CreateParticipantConnection]
ReadPrec CreateParticipantConnection
Int -> ReadS CreateParticipantConnection
ReadS [CreateParticipantConnection]
(Int -> ReadS CreateParticipantConnection)
-> ReadS [CreateParticipantConnection]
-> ReadPrec CreateParticipantConnection
-> ReadPrec [CreateParticipantConnection]
-> Read CreateParticipantConnection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateParticipantConnection]
$creadListPrec :: ReadPrec [CreateParticipantConnection]
readPrec :: ReadPrec CreateParticipantConnection
$creadPrec :: ReadPrec CreateParticipantConnection
readList :: ReadS [CreateParticipantConnection]
$creadList :: ReadS [CreateParticipantConnection]
readsPrec :: Int -> ReadS CreateParticipantConnection
$creadsPrec :: Int -> ReadS CreateParticipantConnection
Prelude.Read, Int -> CreateParticipantConnection -> ShowS
[CreateParticipantConnection] -> ShowS
CreateParticipantConnection -> String
(Int -> CreateParticipantConnection -> ShowS)
-> (CreateParticipantConnection -> String)
-> ([CreateParticipantConnection] -> ShowS)
-> Show CreateParticipantConnection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateParticipantConnection] -> ShowS
$cshowList :: [CreateParticipantConnection] -> ShowS
show :: CreateParticipantConnection -> String
$cshow :: CreateParticipantConnection -> String
showsPrec :: Int -> CreateParticipantConnection -> ShowS
$cshowsPrec :: Int -> CreateParticipantConnection -> ShowS
Prelude.Show, (forall x.
 CreateParticipantConnection -> Rep CreateParticipantConnection x)
-> (forall x.
    Rep CreateParticipantConnection x -> CreateParticipantConnection)
-> Generic CreateParticipantConnection
forall x.
Rep CreateParticipantConnection x -> CreateParticipantConnection
forall x.
CreateParticipantConnection -> Rep CreateParticipantConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateParticipantConnection x -> CreateParticipantConnection
$cfrom :: forall x.
CreateParticipantConnection -> Rep CreateParticipantConnection x
Prelude.Generic)

-- |
-- Create a value of 'CreateParticipantConnection' 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:
--
-- 'type'', 'createParticipantConnection_type' - Type of connection information required.
--
-- 'participantToken', 'createParticipantConnection_participantToken' - This is a header parameter.
--
-- The Participant Token as obtained from
-- <https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html StartChatContact>
-- API response.
newCreateParticipantConnection ::
  -- | 'type''
  Prelude.NonEmpty ConnectionType ->
  -- | 'participantToken'
  Prelude.Text ->
  CreateParticipantConnection
newCreateParticipantConnection :: NonEmpty ConnectionType -> Text -> CreateParticipantConnection
newCreateParticipantConnection
  NonEmpty ConnectionType
pType_
  Text
pParticipantToken_ =
    CreateParticipantConnection' :: NonEmpty ConnectionType -> Text -> CreateParticipantConnection
CreateParticipantConnection'
      { $sel:type':CreateParticipantConnection' :: NonEmpty ConnectionType
type' =
          Tagged
  (NonEmpty ConnectionType) (Identity (NonEmpty ConnectionType))
-> Tagged
     (NonEmpty ConnectionType) (Identity (NonEmpty ConnectionType))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty ConnectionType) (Identity (NonEmpty ConnectionType))
 -> Tagged
      (NonEmpty ConnectionType) (Identity (NonEmpty ConnectionType)))
-> NonEmpty ConnectionType -> NonEmpty ConnectionType
forall t b. AReview t b -> b -> t
Lens.# NonEmpty ConnectionType
pType_,
        $sel:participantToken:CreateParticipantConnection' :: Text
participantToken = Text
pParticipantToken_
      }

-- | Type of connection information required.
createParticipantConnection_type :: Lens.Lens' CreateParticipantConnection (Prelude.NonEmpty ConnectionType)
createParticipantConnection_type :: (NonEmpty ConnectionType -> f (NonEmpty ConnectionType))
-> CreateParticipantConnection -> f CreateParticipantConnection
createParticipantConnection_type = (CreateParticipantConnection -> NonEmpty ConnectionType)
-> (CreateParticipantConnection
    -> NonEmpty ConnectionType -> CreateParticipantConnection)
-> Lens
     CreateParticipantConnection
     CreateParticipantConnection
     (NonEmpty ConnectionType)
     (NonEmpty ConnectionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateParticipantConnection' {NonEmpty ConnectionType
type' :: NonEmpty ConnectionType
$sel:type':CreateParticipantConnection' :: CreateParticipantConnection -> NonEmpty ConnectionType
type'} -> NonEmpty ConnectionType
type') (\s :: CreateParticipantConnection
s@CreateParticipantConnection' {} NonEmpty ConnectionType
a -> CreateParticipantConnection
s {$sel:type':CreateParticipantConnection' :: NonEmpty ConnectionType
type' = NonEmpty ConnectionType
a} :: CreateParticipantConnection) ((NonEmpty ConnectionType -> f (NonEmpty ConnectionType))
 -> CreateParticipantConnection -> f CreateParticipantConnection)
-> ((NonEmpty ConnectionType -> f (NonEmpty ConnectionType))
    -> NonEmpty ConnectionType -> f (NonEmpty ConnectionType))
-> (NonEmpty ConnectionType -> f (NonEmpty ConnectionType))
-> CreateParticipantConnection
-> f CreateParticipantConnection
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty ConnectionType -> f (NonEmpty ConnectionType))
-> NonEmpty ConnectionType -> f (NonEmpty ConnectionType)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | This is a header parameter.
--
-- The Participant Token as obtained from
-- <https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html StartChatContact>
-- API response.
createParticipantConnection_participantToken :: Lens.Lens' CreateParticipantConnection Prelude.Text
createParticipantConnection_participantToken :: (Text -> f Text)
-> CreateParticipantConnection -> f CreateParticipantConnection
createParticipantConnection_participantToken = (CreateParticipantConnection -> Text)
-> (CreateParticipantConnection
    -> Text -> CreateParticipantConnection)
-> Lens
     CreateParticipantConnection CreateParticipantConnection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateParticipantConnection' {Text
participantToken :: Text
$sel:participantToken:CreateParticipantConnection' :: CreateParticipantConnection -> Text
participantToken} -> Text
participantToken) (\s :: CreateParticipantConnection
s@CreateParticipantConnection' {} Text
a -> CreateParticipantConnection
s {$sel:participantToken:CreateParticipantConnection' :: Text
participantToken = Text
a} :: CreateParticipantConnection)

instance Core.AWSRequest CreateParticipantConnection where
  type
    AWSResponse CreateParticipantConnection =
      CreateParticipantConnectionResponse
  request :: CreateParticipantConnection -> Request CreateParticipantConnection
request = Service
-> CreateParticipantConnection
-> Request CreateParticipantConnection
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateParticipantConnection
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateParticipantConnection)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateParticipantConnection))
-> Logger
-> Service
-> Proxy CreateParticipantConnection
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateParticipantConnection)))
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 ConnectionCredentials
-> Maybe Websocket -> Int -> CreateParticipantConnectionResponse
CreateParticipantConnectionResponse'
            (Maybe ConnectionCredentials
 -> Maybe Websocket -> Int -> CreateParticipantConnectionResponse)
-> Either String (Maybe ConnectionCredentials)
-> Either
     String
     (Maybe Websocket -> Int -> CreateParticipantConnectionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ConnectionCredentials)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConnectionCredentials")
            Either
  String
  (Maybe Websocket -> Int -> CreateParticipantConnectionResponse)
-> Either String (Maybe Websocket)
-> Either String (Int -> CreateParticipantConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Websocket)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Websocket")
            Either String (Int -> CreateParticipantConnectionResponse)
-> Either String Int
-> Either String CreateParticipantConnectionResponse
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 CreateParticipantConnection

instance Prelude.NFData CreateParticipantConnection

instance Core.ToHeaders CreateParticipantConnection where
  toHeaders :: CreateParticipantConnection -> ResponseHeaders
toHeaders CreateParticipantConnection' {NonEmpty ConnectionType
Text
participantToken :: Text
type' :: NonEmpty ConnectionType
$sel:participantToken:CreateParticipantConnection' :: CreateParticipantConnection -> Text
$sel:type':CreateParticipantConnection' :: CreateParticipantConnection -> NonEmpty ConnectionType
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"X-Amz-Bearer" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
participantToken,
        HeaderName
"Content-Type"
          HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/x-amz-json-1.1" :: Prelude.ByteString)
      ]

instance Core.ToJSON CreateParticipantConnection where
  toJSON :: CreateParticipantConnection -> Value
toJSON CreateParticipantConnection' {NonEmpty ConnectionType
Text
participantToken :: Text
type' :: NonEmpty ConnectionType
$sel:participantToken:CreateParticipantConnection' :: CreateParticipantConnection -> Text
$sel:type':CreateParticipantConnection' :: CreateParticipantConnection -> NonEmpty ConnectionType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> NonEmpty ConnectionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty ConnectionType
type')]
      )

instance Core.ToPath CreateParticipantConnection where
  toPath :: CreateParticipantConnection -> ByteString
toPath = ByteString -> CreateParticipantConnection -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/participant/connection"

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

-- | /See:/ 'newCreateParticipantConnectionResponse' smart constructor.
data CreateParticipantConnectionResponse = CreateParticipantConnectionResponse'
  { -- | Creates the participant\'s connection credentials. The authentication
    -- token associated with the participant\'s connection.
    CreateParticipantConnectionResponse -> Maybe ConnectionCredentials
connectionCredentials :: Prelude.Maybe ConnectionCredentials,
    -- | Creates the participant\'s websocket connection.
    CreateParticipantConnectionResponse -> Maybe Websocket
websocket :: Prelude.Maybe Websocket,
    -- | The response's http status code.
    CreateParticipantConnectionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateParticipantConnectionResponse
-> CreateParticipantConnectionResponse -> Bool
(CreateParticipantConnectionResponse
 -> CreateParticipantConnectionResponse -> Bool)
-> (CreateParticipantConnectionResponse
    -> CreateParticipantConnectionResponse -> Bool)
-> Eq CreateParticipantConnectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateParticipantConnectionResponse
-> CreateParticipantConnectionResponse -> Bool
$c/= :: CreateParticipantConnectionResponse
-> CreateParticipantConnectionResponse -> Bool
== :: CreateParticipantConnectionResponse
-> CreateParticipantConnectionResponse -> Bool
$c== :: CreateParticipantConnectionResponse
-> CreateParticipantConnectionResponse -> Bool
Prelude.Eq, ReadPrec [CreateParticipantConnectionResponse]
ReadPrec CreateParticipantConnectionResponse
Int -> ReadS CreateParticipantConnectionResponse
ReadS [CreateParticipantConnectionResponse]
(Int -> ReadS CreateParticipantConnectionResponse)
-> ReadS [CreateParticipantConnectionResponse]
-> ReadPrec CreateParticipantConnectionResponse
-> ReadPrec [CreateParticipantConnectionResponse]
-> Read CreateParticipantConnectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateParticipantConnectionResponse]
$creadListPrec :: ReadPrec [CreateParticipantConnectionResponse]
readPrec :: ReadPrec CreateParticipantConnectionResponse
$creadPrec :: ReadPrec CreateParticipantConnectionResponse
readList :: ReadS [CreateParticipantConnectionResponse]
$creadList :: ReadS [CreateParticipantConnectionResponse]
readsPrec :: Int -> ReadS CreateParticipantConnectionResponse
$creadsPrec :: Int -> ReadS CreateParticipantConnectionResponse
Prelude.Read, Int -> CreateParticipantConnectionResponse -> ShowS
[CreateParticipantConnectionResponse] -> ShowS
CreateParticipantConnectionResponse -> String
(Int -> CreateParticipantConnectionResponse -> ShowS)
-> (CreateParticipantConnectionResponse -> String)
-> ([CreateParticipantConnectionResponse] -> ShowS)
-> Show CreateParticipantConnectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateParticipantConnectionResponse] -> ShowS
$cshowList :: [CreateParticipantConnectionResponse] -> ShowS
show :: CreateParticipantConnectionResponse -> String
$cshow :: CreateParticipantConnectionResponse -> String
showsPrec :: Int -> CreateParticipantConnectionResponse -> ShowS
$cshowsPrec :: Int -> CreateParticipantConnectionResponse -> ShowS
Prelude.Show, (forall x.
 CreateParticipantConnectionResponse
 -> Rep CreateParticipantConnectionResponse x)
-> (forall x.
    Rep CreateParticipantConnectionResponse x
    -> CreateParticipantConnectionResponse)
-> Generic CreateParticipantConnectionResponse
forall x.
Rep CreateParticipantConnectionResponse x
-> CreateParticipantConnectionResponse
forall x.
CreateParticipantConnectionResponse
-> Rep CreateParticipantConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateParticipantConnectionResponse x
-> CreateParticipantConnectionResponse
$cfrom :: forall x.
CreateParticipantConnectionResponse
-> Rep CreateParticipantConnectionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateParticipantConnectionResponse' 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:
--
-- 'connectionCredentials', 'createParticipantConnectionResponse_connectionCredentials' - Creates the participant\'s connection credentials. The authentication
-- token associated with the participant\'s connection.
--
-- 'websocket', 'createParticipantConnectionResponse_websocket' - Creates the participant\'s websocket connection.
--
-- 'httpStatus', 'createParticipantConnectionResponse_httpStatus' - The response's http status code.
newCreateParticipantConnectionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateParticipantConnectionResponse
newCreateParticipantConnectionResponse :: Int -> CreateParticipantConnectionResponse
newCreateParticipantConnectionResponse Int
pHttpStatus_ =
  CreateParticipantConnectionResponse' :: Maybe ConnectionCredentials
-> Maybe Websocket -> Int -> CreateParticipantConnectionResponse
CreateParticipantConnectionResponse'
    { $sel:connectionCredentials:CreateParticipantConnectionResponse' :: Maybe ConnectionCredentials
connectionCredentials =
        Maybe ConnectionCredentials
forall a. Maybe a
Prelude.Nothing,
      $sel:websocket:CreateParticipantConnectionResponse' :: Maybe Websocket
websocket = Maybe Websocket
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateParticipantConnectionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Creates the participant\'s connection credentials. The authentication
-- token associated with the participant\'s connection.
createParticipantConnectionResponse_connectionCredentials :: Lens.Lens' CreateParticipantConnectionResponse (Prelude.Maybe ConnectionCredentials)
createParticipantConnectionResponse_connectionCredentials :: (Maybe ConnectionCredentials -> f (Maybe ConnectionCredentials))
-> CreateParticipantConnectionResponse
-> f CreateParticipantConnectionResponse
createParticipantConnectionResponse_connectionCredentials = (CreateParticipantConnectionResponse
 -> Maybe ConnectionCredentials)
-> (CreateParticipantConnectionResponse
    -> Maybe ConnectionCredentials
    -> CreateParticipantConnectionResponse)
-> Lens
     CreateParticipantConnectionResponse
     CreateParticipantConnectionResponse
     (Maybe ConnectionCredentials)
     (Maybe ConnectionCredentials)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateParticipantConnectionResponse' {Maybe ConnectionCredentials
connectionCredentials :: Maybe ConnectionCredentials
$sel:connectionCredentials:CreateParticipantConnectionResponse' :: CreateParticipantConnectionResponse -> Maybe ConnectionCredentials
connectionCredentials} -> Maybe ConnectionCredentials
connectionCredentials) (\s :: CreateParticipantConnectionResponse
s@CreateParticipantConnectionResponse' {} Maybe ConnectionCredentials
a -> CreateParticipantConnectionResponse
s {$sel:connectionCredentials:CreateParticipantConnectionResponse' :: Maybe ConnectionCredentials
connectionCredentials = Maybe ConnectionCredentials
a} :: CreateParticipantConnectionResponse)

-- | Creates the participant\'s websocket connection.
createParticipantConnectionResponse_websocket :: Lens.Lens' CreateParticipantConnectionResponse (Prelude.Maybe Websocket)
createParticipantConnectionResponse_websocket :: (Maybe Websocket -> f (Maybe Websocket))
-> CreateParticipantConnectionResponse
-> f CreateParticipantConnectionResponse
createParticipantConnectionResponse_websocket = (CreateParticipantConnectionResponse -> Maybe Websocket)
-> (CreateParticipantConnectionResponse
    -> Maybe Websocket -> CreateParticipantConnectionResponse)
-> Lens
     CreateParticipantConnectionResponse
     CreateParticipantConnectionResponse
     (Maybe Websocket)
     (Maybe Websocket)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateParticipantConnectionResponse' {Maybe Websocket
websocket :: Maybe Websocket
$sel:websocket:CreateParticipantConnectionResponse' :: CreateParticipantConnectionResponse -> Maybe Websocket
websocket} -> Maybe Websocket
websocket) (\s :: CreateParticipantConnectionResponse
s@CreateParticipantConnectionResponse' {} Maybe Websocket
a -> CreateParticipantConnectionResponse
s {$sel:websocket:CreateParticipantConnectionResponse' :: Maybe Websocket
websocket = Maybe Websocket
a} :: CreateParticipantConnectionResponse)

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

instance
  Prelude.NFData
    CreateParticipantConnectionResponse