{-# 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 #-}
module Amazonka.Chime.CreateProxySession
(
CreateProxySession (..),
newCreateProxySession,
createProxySession_numberSelectionBehavior,
createProxySession_geoMatchParams,
createProxySession_expiryMinutes,
createProxySession_name,
createProxySession_geoMatchLevel,
createProxySession_participantPhoneNumbers,
createProxySession_capabilities,
createProxySession_voiceConnectorId,
CreateProxySessionResponse (..),
newCreateProxySessionResponse,
createProxySessionResponse_proxySession,
createProxySessionResponse_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
data CreateProxySession = CreateProxySession'
{
CreateProxySession -> Maybe NumberSelectionBehavior
numberSelectionBehavior :: Prelude.Maybe NumberSelectionBehavior,
CreateProxySession -> Maybe GeoMatchParams
geoMatchParams :: Prelude.Maybe GeoMatchParams,
CreateProxySession -> Maybe Natural
expiryMinutes :: Prelude.Maybe Prelude.Natural,
CreateProxySession -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Core.Sensitive Prelude.Text),
CreateProxySession -> Maybe GeoMatchLevel
geoMatchLevel :: Prelude.Maybe GeoMatchLevel,
CreateProxySession -> NonEmpty (Sensitive Text)
participantPhoneNumbers :: Prelude.NonEmpty (Core.Sensitive Prelude.Text),
CreateProxySession -> [Capability]
capabilities :: [Capability],
CreateProxySession -> Text
voiceConnectorId :: Prelude.Text
}
deriving (CreateProxySession -> CreateProxySession -> Bool
(CreateProxySession -> CreateProxySession -> Bool)
-> (CreateProxySession -> CreateProxySession -> Bool)
-> Eq CreateProxySession
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProxySession -> CreateProxySession -> Bool
$c/= :: CreateProxySession -> CreateProxySession -> Bool
== :: CreateProxySession -> CreateProxySession -> Bool
$c== :: CreateProxySession -> CreateProxySession -> Bool
Prelude.Eq, Int -> CreateProxySession -> ShowS
[CreateProxySession] -> ShowS
CreateProxySession -> String
(Int -> CreateProxySession -> ShowS)
-> (CreateProxySession -> String)
-> ([CreateProxySession] -> ShowS)
-> Show CreateProxySession
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProxySession] -> ShowS
$cshowList :: [CreateProxySession] -> ShowS
show :: CreateProxySession -> String
$cshow :: CreateProxySession -> String
showsPrec :: Int -> CreateProxySession -> ShowS
$cshowsPrec :: Int -> CreateProxySession -> ShowS
Prelude.Show, (forall x. CreateProxySession -> Rep CreateProxySession x)
-> (forall x. Rep CreateProxySession x -> CreateProxySession)
-> Generic CreateProxySession
forall x. Rep CreateProxySession x -> CreateProxySession
forall x. CreateProxySession -> Rep CreateProxySession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateProxySession x -> CreateProxySession
$cfrom :: forall x. CreateProxySession -> Rep CreateProxySession x
Prelude.Generic)
newCreateProxySession ::
Prelude.NonEmpty Prelude.Text ->
Prelude.Text ->
CreateProxySession
newCreateProxySession :: NonEmpty Text -> Text -> CreateProxySession
newCreateProxySession
NonEmpty Text
pParticipantPhoneNumbers_
Text
pVoiceConnectorId_ =
CreateProxySession' :: Maybe NumberSelectionBehavior
-> Maybe GeoMatchParams
-> Maybe Natural
-> Maybe (Sensitive Text)
-> Maybe GeoMatchLevel
-> NonEmpty (Sensitive Text)
-> [Capability]
-> Text
-> CreateProxySession
CreateProxySession'
{ $sel:numberSelectionBehavior:CreateProxySession' :: Maybe NumberSelectionBehavior
numberSelectionBehavior =
Maybe NumberSelectionBehavior
forall a. Maybe a
Prelude.Nothing,
$sel:geoMatchParams:CreateProxySession' :: Maybe GeoMatchParams
geoMatchParams = Maybe GeoMatchParams
forall a. Maybe a
Prelude.Nothing,
$sel:expiryMinutes:CreateProxySession' :: Maybe Natural
expiryMinutes = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateProxySession' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:geoMatchLevel:CreateProxySession' :: Maybe GeoMatchLevel
geoMatchLevel = Maybe GeoMatchLevel
forall a. Maybe a
Prelude.Nothing,
$sel:participantPhoneNumbers:CreateProxySession' :: NonEmpty (Sensitive Text)
participantPhoneNumbers =
Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged
(NonEmpty (Sensitive Text)) (Identity (NonEmpty (Sensitive Text)))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged
(NonEmpty (Sensitive Text)) (Identity (NonEmpty (Sensitive Text))))
-> NonEmpty Text -> NonEmpty (Sensitive Text)
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pParticipantPhoneNumbers_,
$sel:capabilities:CreateProxySession' :: [Capability]
capabilities = [Capability]
forall a. Monoid a => a
Prelude.mempty,
$sel:voiceConnectorId:CreateProxySession' :: Text
voiceConnectorId = Text
pVoiceConnectorId_
}
createProxySession_numberSelectionBehavior :: Lens.Lens' CreateProxySession (Prelude.Maybe NumberSelectionBehavior)
createProxySession_numberSelectionBehavior :: (Maybe NumberSelectionBehavior
-> f (Maybe NumberSelectionBehavior))
-> CreateProxySession -> f CreateProxySession
createProxySession_numberSelectionBehavior = (CreateProxySession -> Maybe NumberSelectionBehavior)
-> (CreateProxySession
-> Maybe NumberSelectionBehavior -> CreateProxySession)
-> Lens
CreateProxySession
CreateProxySession
(Maybe NumberSelectionBehavior)
(Maybe NumberSelectionBehavior)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProxySession' {Maybe NumberSelectionBehavior
numberSelectionBehavior :: Maybe NumberSelectionBehavior
$sel:numberSelectionBehavior:CreateProxySession' :: CreateProxySession -> Maybe NumberSelectionBehavior
numberSelectionBehavior} -> Maybe NumberSelectionBehavior
numberSelectionBehavior) (\s :: CreateProxySession
s@CreateProxySession' {} Maybe NumberSelectionBehavior
a -> CreateProxySession
s {$sel:numberSelectionBehavior:CreateProxySession' :: Maybe NumberSelectionBehavior
numberSelectionBehavior = Maybe NumberSelectionBehavior
a} :: CreateProxySession)
createProxySession_geoMatchParams :: Lens.Lens' CreateProxySession (Prelude.Maybe GeoMatchParams)
createProxySession_geoMatchParams :: (Maybe GeoMatchParams -> f (Maybe GeoMatchParams))
-> CreateProxySession -> f CreateProxySession
createProxySession_geoMatchParams = (CreateProxySession -> Maybe GeoMatchParams)
-> (CreateProxySession
-> Maybe GeoMatchParams -> CreateProxySession)
-> Lens
CreateProxySession
CreateProxySession
(Maybe GeoMatchParams)
(Maybe GeoMatchParams)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProxySession' {Maybe GeoMatchParams
geoMatchParams :: Maybe GeoMatchParams
$sel:geoMatchParams:CreateProxySession' :: CreateProxySession -> Maybe GeoMatchParams
geoMatchParams} -> Maybe GeoMatchParams
geoMatchParams) (\s :: CreateProxySession
s@CreateProxySession' {} Maybe GeoMatchParams
a -> CreateProxySession
s {$sel:geoMatchParams:CreateProxySession' :: Maybe GeoMatchParams
geoMatchParams = Maybe GeoMatchParams
a} :: CreateProxySession)
createProxySession_expiryMinutes :: Lens.Lens' CreateProxySession (Prelude.Maybe Prelude.Natural)
createProxySession_expiryMinutes :: (Maybe Natural -> f (Maybe Natural))
-> CreateProxySession -> f CreateProxySession
createProxySession_expiryMinutes = (CreateProxySession -> Maybe Natural)
-> (CreateProxySession -> Maybe Natural -> CreateProxySession)
-> Lens
CreateProxySession
CreateProxySession
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProxySession' {Maybe Natural
expiryMinutes :: Maybe Natural
$sel:expiryMinutes:CreateProxySession' :: CreateProxySession -> Maybe Natural
expiryMinutes} -> Maybe Natural
expiryMinutes) (\s :: CreateProxySession
s@CreateProxySession' {} Maybe Natural
a -> CreateProxySession
s {$sel:expiryMinutes:CreateProxySession' :: Maybe Natural
expiryMinutes = Maybe Natural
a} :: CreateProxySession)
createProxySession_name :: Lens.Lens' CreateProxySession (Prelude.Maybe Prelude.Text)
createProxySession_name :: (Maybe Text -> f (Maybe Text))
-> CreateProxySession -> f CreateProxySession
createProxySession_name = (CreateProxySession -> Maybe (Sensitive Text))
-> (CreateProxySession
-> Maybe (Sensitive Text) -> CreateProxySession)
-> Lens
CreateProxySession
CreateProxySession
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProxySession' {Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:name:CreateProxySession' :: CreateProxySession -> Maybe (Sensitive Text)
name} -> Maybe (Sensitive Text)
name) (\s :: CreateProxySession
s@CreateProxySession' {} Maybe (Sensitive Text)
a -> CreateProxySession
s {$sel:name:CreateProxySession' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
a} :: CreateProxySession) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> CreateProxySession -> f CreateProxySession)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateProxySession
-> f CreateProxySession
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
createProxySession_geoMatchLevel :: Lens.Lens' CreateProxySession (Prelude.Maybe GeoMatchLevel)
createProxySession_geoMatchLevel :: (Maybe GeoMatchLevel -> f (Maybe GeoMatchLevel))
-> CreateProxySession -> f CreateProxySession
createProxySession_geoMatchLevel = (CreateProxySession -> Maybe GeoMatchLevel)
-> (CreateProxySession
-> Maybe GeoMatchLevel -> CreateProxySession)
-> Lens
CreateProxySession
CreateProxySession
(Maybe GeoMatchLevel)
(Maybe GeoMatchLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProxySession' {Maybe GeoMatchLevel
geoMatchLevel :: Maybe GeoMatchLevel
$sel:geoMatchLevel:CreateProxySession' :: CreateProxySession -> Maybe GeoMatchLevel
geoMatchLevel} -> Maybe GeoMatchLevel
geoMatchLevel) (\s :: CreateProxySession
s@CreateProxySession' {} Maybe GeoMatchLevel
a -> CreateProxySession
s {$sel:geoMatchLevel:CreateProxySession' :: Maybe GeoMatchLevel
geoMatchLevel = Maybe GeoMatchLevel
a} :: CreateProxySession)
createProxySession_participantPhoneNumbers :: Lens.Lens' CreateProxySession (Prelude.NonEmpty Prelude.Text)
createProxySession_participantPhoneNumbers :: (NonEmpty Text -> f (NonEmpty Text))
-> CreateProxySession -> f CreateProxySession
createProxySession_participantPhoneNumbers = (CreateProxySession -> NonEmpty (Sensitive Text))
-> (CreateProxySession
-> NonEmpty (Sensitive Text) -> CreateProxySession)
-> Lens
CreateProxySession
CreateProxySession
(NonEmpty (Sensitive Text))
(NonEmpty (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProxySession' {NonEmpty (Sensitive Text)
participantPhoneNumbers :: NonEmpty (Sensitive Text)
$sel:participantPhoneNumbers:CreateProxySession' :: CreateProxySession -> NonEmpty (Sensitive Text)
participantPhoneNumbers} -> NonEmpty (Sensitive Text)
participantPhoneNumbers) (\s :: CreateProxySession
s@CreateProxySession' {} NonEmpty (Sensitive Text)
a -> CreateProxySession
s {$sel:participantPhoneNumbers:CreateProxySession' :: NonEmpty (Sensitive Text)
participantPhoneNumbers = NonEmpty (Sensitive Text)
a} :: CreateProxySession) ((NonEmpty (Sensitive Text) -> f (NonEmpty (Sensitive Text)))
-> CreateProxySession -> f CreateProxySession)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty (Sensitive Text) -> f (NonEmpty (Sensitive Text)))
-> (NonEmpty Text -> f (NonEmpty Text))
-> CreateProxySession
-> f CreateProxySession
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty (Sensitive Text) -> f (NonEmpty (Sensitive Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createProxySession_capabilities :: Lens.Lens' CreateProxySession [Capability]
createProxySession_capabilities :: ([Capability] -> f [Capability])
-> CreateProxySession -> f CreateProxySession
createProxySession_capabilities = (CreateProxySession -> [Capability])
-> (CreateProxySession -> [Capability] -> CreateProxySession)
-> Lens
CreateProxySession CreateProxySession [Capability] [Capability]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProxySession' {[Capability]
capabilities :: [Capability]
$sel:capabilities:CreateProxySession' :: CreateProxySession -> [Capability]
capabilities} -> [Capability]
capabilities) (\s :: CreateProxySession
s@CreateProxySession' {} [Capability]
a -> CreateProxySession
s {$sel:capabilities:CreateProxySession' :: [Capability]
capabilities = [Capability]
a} :: CreateProxySession) (([Capability] -> f [Capability])
-> CreateProxySession -> f CreateProxySession)
-> (([Capability] -> f [Capability])
-> [Capability] -> f [Capability])
-> ([Capability] -> f [Capability])
-> CreateProxySession
-> f CreateProxySession
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Capability] -> f [Capability]) -> [Capability] -> f [Capability]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createProxySession_voiceConnectorId :: Lens.Lens' CreateProxySession Prelude.Text
createProxySession_voiceConnectorId :: (Text -> f Text) -> CreateProxySession -> f CreateProxySession
createProxySession_voiceConnectorId = (CreateProxySession -> Text)
-> (CreateProxySession -> Text -> CreateProxySession)
-> Lens CreateProxySession CreateProxySession Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProxySession' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:CreateProxySession' :: CreateProxySession -> Text
voiceConnectorId} -> Text
voiceConnectorId) (\s :: CreateProxySession
s@CreateProxySession' {} Text
a -> CreateProxySession
s {$sel:voiceConnectorId:CreateProxySession' :: Text
voiceConnectorId = Text
a} :: CreateProxySession)
instance Core.AWSRequest CreateProxySession where
type
AWSResponse CreateProxySession =
CreateProxySessionResponse
request :: CreateProxySession -> Request CreateProxySession
request = Service -> CreateProxySession -> Request CreateProxySession
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateProxySession
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateProxySession)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateProxySession))
-> Logger
-> Service
-> Proxy CreateProxySession
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateProxySession)))
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 ProxySession -> Int -> CreateProxySessionResponse
CreateProxySessionResponse'
(Maybe ProxySession -> Int -> CreateProxySessionResponse)
-> Either String (Maybe ProxySession)
-> Either String (Int -> CreateProxySessionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ProxySession)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProxySession")
Either String (Int -> CreateProxySessionResponse)
-> Either String Int -> Either String CreateProxySessionResponse
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 CreateProxySession
instance Prelude.NFData CreateProxySession
instance Core.ToHeaders CreateProxySession where
toHeaders :: CreateProxySession -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateProxySession -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON CreateProxySession where
toJSON :: CreateProxySession -> Value
toJSON CreateProxySession' {[Capability]
Maybe Natural
Maybe (Sensitive Text)
Maybe GeoMatchLevel
Maybe GeoMatchParams
Maybe NumberSelectionBehavior
NonEmpty (Sensitive Text)
Text
voiceConnectorId :: Text
capabilities :: [Capability]
participantPhoneNumbers :: NonEmpty (Sensitive Text)
geoMatchLevel :: Maybe GeoMatchLevel
name :: Maybe (Sensitive Text)
expiryMinutes :: Maybe Natural
geoMatchParams :: Maybe GeoMatchParams
numberSelectionBehavior :: Maybe NumberSelectionBehavior
$sel:voiceConnectorId:CreateProxySession' :: CreateProxySession -> Text
$sel:capabilities:CreateProxySession' :: CreateProxySession -> [Capability]
$sel:participantPhoneNumbers:CreateProxySession' :: CreateProxySession -> NonEmpty (Sensitive Text)
$sel:geoMatchLevel:CreateProxySession' :: CreateProxySession -> Maybe GeoMatchLevel
$sel:name:CreateProxySession' :: CreateProxySession -> Maybe (Sensitive Text)
$sel:expiryMinutes:CreateProxySession' :: CreateProxySession -> Maybe Natural
$sel:geoMatchParams:CreateProxySession' :: CreateProxySession -> Maybe GeoMatchParams
$sel:numberSelectionBehavior:CreateProxySession' :: CreateProxySession -> Maybe NumberSelectionBehavior
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NumberSelectionBehavior" Text -> NumberSelectionBehavior -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NumberSelectionBehavior -> Pair)
-> Maybe NumberSelectionBehavior -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NumberSelectionBehavior
numberSelectionBehavior,
(Text
"GeoMatchParams" Text -> GeoMatchParams -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(GeoMatchParams -> Pair) -> Maybe GeoMatchParams -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe GeoMatchParams
geoMatchParams,
(Text
"ExpiryMinutes" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
expiryMinutes,
(Text
"Name" 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)
name,
(Text
"GeoMatchLevel" Text -> GeoMatchLevel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (GeoMatchLevel -> Pair) -> Maybe GeoMatchLevel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe GeoMatchLevel
geoMatchLevel,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ParticipantPhoneNumbers"
Text -> NonEmpty (Sensitive Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty (Sensitive Text)
participantPhoneNumbers
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Capabilities" Text -> [Capability] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Capability]
capabilities)
]
)
instance Core.ToPath CreateProxySession where
toPath :: CreateProxySession -> ByteString
toPath CreateProxySession' {[Capability]
Maybe Natural
Maybe (Sensitive Text)
Maybe GeoMatchLevel
Maybe GeoMatchParams
Maybe NumberSelectionBehavior
NonEmpty (Sensitive Text)
Text
voiceConnectorId :: Text
capabilities :: [Capability]
participantPhoneNumbers :: NonEmpty (Sensitive Text)
geoMatchLevel :: Maybe GeoMatchLevel
name :: Maybe (Sensitive Text)
expiryMinutes :: Maybe Natural
geoMatchParams :: Maybe GeoMatchParams
numberSelectionBehavior :: Maybe NumberSelectionBehavior
$sel:voiceConnectorId:CreateProxySession' :: CreateProxySession -> Text
$sel:capabilities:CreateProxySession' :: CreateProxySession -> [Capability]
$sel:participantPhoneNumbers:CreateProxySession' :: CreateProxySession -> NonEmpty (Sensitive Text)
$sel:geoMatchLevel:CreateProxySession' :: CreateProxySession -> Maybe GeoMatchLevel
$sel:name:CreateProxySession' :: CreateProxySession -> Maybe (Sensitive Text)
$sel:expiryMinutes:CreateProxySession' :: CreateProxySession -> Maybe Natural
$sel:geoMatchParams:CreateProxySession' :: CreateProxySession -> Maybe GeoMatchParams
$sel:numberSelectionBehavior:CreateProxySession' :: CreateProxySession -> Maybe NumberSelectionBehavior
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/voice-connectors/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
voiceConnectorId,
ByteString
"/proxy-sessions"
]
instance Core.ToQuery CreateProxySession where
toQuery :: CreateProxySession -> QueryString
toQuery = QueryString -> CreateProxySession -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateProxySessionResponse = CreateProxySessionResponse'
{
CreateProxySessionResponse -> Maybe ProxySession
proxySession :: Prelude.Maybe ProxySession,
CreateProxySessionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateProxySessionResponse -> CreateProxySessionResponse -> Bool
(CreateProxySessionResponse -> CreateProxySessionResponse -> Bool)
-> (CreateProxySessionResponse
-> CreateProxySessionResponse -> Bool)
-> Eq CreateProxySessionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProxySessionResponse -> CreateProxySessionResponse -> Bool
$c/= :: CreateProxySessionResponse -> CreateProxySessionResponse -> Bool
== :: CreateProxySessionResponse -> CreateProxySessionResponse -> Bool
$c== :: CreateProxySessionResponse -> CreateProxySessionResponse -> Bool
Prelude.Eq, Int -> CreateProxySessionResponse -> ShowS
[CreateProxySessionResponse] -> ShowS
CreateProxySessionResponse -> String
(Int -> CreateProxySessionResponse -> ShowS)
-> (CreateProxySessionResponse -> String)
-> ([CreateProxySessionResponse] -> ShowS)
-> Show CreateProxySessionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProxySessionResponse] -> ShowS
$cshowList :: [CreateProxySessionResponse] -> ShowS
show :: CreateProxySessionResponse -> String
$cshow :: CreateProxySessionResponse -> String
showsPrec :: Int -> CreateProxySessionResponse -> ShowS
$cshowsPrec :: Int -> CreateProxySessionResponse -> ShowS
Prelude.Show, (forall x.
CreateProxySessionResponse -> Rep CreateProxySessionResponse x)
-> (forall x.
Rep CreateProxySessionResponse x -> CreateProxySessionResponse)
-> Generic CreateProxySessionResponse
forall x.
Rep CreateProxySessionResponse x -> CreateProxySessionResponse
forall x.
CreateProxySessionResponse -> Rep CreateProxySessionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateProxySessionResponse x -> CreateProxySessionResponse
$cfrom :: forall x.
CreateProxySessionResponse -> Rep CreateProxySessionResponse x
Prelude.Generic)
newCreateProxySessionResponse ::
Prelude.Int ->
CreateProxySessionResponse
newCreateProxySessionResponse :: Int -> CreateProxySessionResponse
newCreateProxySessionResponse Int
pHttpStatus_ =
CreateProxySessionResponse' :: Maybe ProxySession -> Int -> CreateProxySessionResponse
CreateProxySessionResponse'
{ $sel:proxySession:CreateProxySessionResponse' :: Maybe ProxySession
proxySession =
Maybe ProxySession
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateProxySessionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createProxySessionResponse_proxySession :: Lens.Lens' CreateProxySessionResponse (Prelude.Maybe ProxySession)
createProxySessionResponse_proxySession :: (Maybe ProxySession -> f (Maybe ProxySession))
-> CreateProxySessionResponse -> f CreateProxySessionResponse
createProxySessionResponse_proxySession = (CreateProxySessionResponse -> Maybe ProxySession)
-> (CreateProxySessionResponse
-> Maybe ProxySession -> CreateProxySessionResponse)
-> Lens
CreateProxySessionResponse
CreateProxySessionResponse
(Maybe ProxySession)
(Maybe ProxySession)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProxySessionResponse' {Maybe ProxySession
proxySession :: Maybe ProxySession
$sel:proxySession:CreateProxySessionResponse' :: CreateProxySessionResponse -> Maybe ProxySession
proxySession} -> Maybe ProxySession
proxySession) (\s :: CreateProxySessionResponse
s@CreateProxySessionResponse' {} Maybe ProxySession
a -> CreateProxySessionResponse
s {$sel:proxySession:CreateProxySessionResponse' :: Maybe ProxySession
proxySession = Maybe ProxySession
a} :: CreateProxySessionResponse)
createProxySessionResponse_httpStatus :: Lens.Lens' CreateProxySessionResponse Prelude.Int
createProxySessionResponse_httpStatus :: (Int -> f Int)
-> CreateProxySessionResponse -> f CreateProxySessionResponse
createProxySessionResponse_httpStatus = (CreateProxySessionResponse -> Int)
-> (CreateProxySessionResponse
-> Int -> CreateProxySessionResponse)
-> Lens
CreateProxySessionResponse CreateProxySessionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProxySessionResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateProxySessionResponse' :: CreateProxySessionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateProxySessionResponse
s@CreateProxySessionResponse' {} Int
a -> CreateProxySessionResponse
s {$sel:httpStatus:CreateProxySessionResponse' :: Int
httpStatus = Int
a} :: CreateProxySessionResponse)
instance Prelude.NFData CreateProxySessionResponse