{-# 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.GetVoiceConnectorOrigination
(
GetVoiceConnectorOrigination (..),
newGetVoiceConnectorOrigination,
getVoiceConnectorOrigination_voiceConnectorId,
GetVoiceConnectorOriginationResponse (..),
newGetVoiceConnectorOriginationResponse,
getVoiceConnectorOriginationResponse_origination,
getVoiceConnectorOriginationResponse_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 GetVoiceConnectorOrigination = GetVoiceConnectorOrigination'
{
GetVoiceConnectorOrigination -> Text
voiceConnectorId :: Prelude.Text
}
deriving (GetVoiceConnectorOrigination
-> GetVoiceConnectorOrigination -> Bool
(GetVoiceConnectorOrigination
-> GetVoiceConnectorOrigination -> Bool)
-> (GetVoiceConnectorOrigination
-> GetVoiceConnectorOrigination -> Bool)
-> Eq GetVoiceConnectorOrigination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVoiceConnectorOrigination
-> GetVoiceConnectorOrigination -> Bool
$c/= :: GetVoiceConnectorOrigination
-> GetVoiceConnectorOrigination -> Bool
== :: GetVoiceConnectorOrigination
-> GetVoiceConnectorOrigination -> Bool
$c== :: GetVoiceConnectorOrigination
-> GetVoiceConnectorOrigination -> Bool
Prelude.Eq, ReadPrec [GetVoiceConnectorOrigination]
ReadPrec GetVoiceConnectorOrigination
Int -> ReadS GetVoiceConnectorOrigination
ReadS [GetVoiceConnectorOrigination]
(Int -> ReadS GetVoiceConnectorOrigination)
-> ReadS [GetVoiceConnectorOrigination]
-> ReadPrec GetVoiceConnectorOrigination
-> ReadPrec [GetVoiceConnectorOrigination]
-> Read GetVoiceConnectorOrigination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVoiceConnectorOrigination]
$creadListPrec :: ReadPrec [GetVoiceConnectorOrigination]
readPrec :: ReadPrec GetVoiceConnectorOrigination
$creadPrec :: ReadPrec GetVoiceConnectorOrigination
readList :: ReadS [GetVoiceConnectorOrigination]
$creadList :: ReadS [GetVoiceConnectorOrigination]
readsPrec :: Int -> ReadS GetVoiceConnectorOrigination
$creadsPrec :: Int -> ReadS GetVoiceConnectorOrigination
Prelude.Read, Int -> GetVoiceConnectorOrigination -> ShowS
[GetVoiceConnectorOrigination] -> ShowS
GetVoiceConnectorOrigination -> String
(Int -> GetVoiceConnectorOrigination -> ShowS)
-> (GetVoiceConnectorOrigination -> String)
-> ([GetVoiceConnectorOrigination] -> ShowS)
-> Show GetVoiceConnectorOrigination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVoiceConnectorOrigination] -> ShowS
$cshowList :: [GetVoiceConnectorOrigination] -> ShowS
show :: GetVoiceConnectorOrigination -> String
$cshow :: GetVoiceConnectorOrigination -> String
showsPrec :: Int -> GetVoiceConnectorOrigination -> ShowS
$cshowsPrec :: Int -> GetVoiceConnectorOrigination -> ShowS
Prelude.Show, (forall x.
GetVoiceConnectorOrigination -> Rep GetVoiceConnectorOrigination x)
-> (forall x.
Rep GetVoiceConnectorOrigination x -> GetVoiceConnectorOrigination)
-> Generic GetVoiceConnectorOrigination
forall x.
Rep GetVoiceConnectorOrigination x -> GetVoiceConnectorOrigination
forall x.
GetVoiceConnectorOrigination -> Rep GetVoiceConnectorOrigination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetVoiceConnectorOrigination x -> GetVoiceConnectorOrigination
$cfrom :: forall x.
GetVoiceConnectorOrigination -> Rep GetVoiceConnectorOrigination x
Prelude.Generic)
newGetVoiceConnectorOrigination ::
Prelude.Text ->
GetVoiceConnectorOrigination
newGetVoiceConnectorOrigination :: Text -> GetVoiceConnectorOrigination
newGetVoiceConnectorOrigination Text
pVoiceConnectorId_ =
GetVoiceConnectorOrigination' :: Text -> GetVoiceConnectorOrigination
GetVoiceConnectorOrigination'
{ $sel:voiceConnectorId:GetVoiceConnectorOrigination' :: Text
voiceConnectorId =
Text
pVoiceConnectorId_
}
getVoiceConnectorOrigination_voiceConnectorId :: Lens.Lens' GetVoiceConnectorOrigination Prelude.Text
getVoiceConnectorOrigination_voiceConnectorId :: (Text -> f Text)
-> GetVoiceConnectorOrigination -> f GetVoiceConnectorOrigination
getVoiceConnectorOrigination_voiceConnectorId = (GetVoiceConnectorOrigination -> Text)
-> (GetVoiceConnectorOrigination
-> Text -> GetVoiceConnectorOrigination)
-> Lens
GetVoiceConnectorOrigination GetVoiceConnectorOrigination Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVoiceConnectorOrigination' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:GetVoiceConnectorOrigination' :: GetVoiceConnectorOrigination -> Text
voiceConnectorId} -> Text
voiceConnectorId) (\s :: GetVoiceConnectorOrigination
s@GetVoiceConnectorOrigination' {} Text
a -> GetVoiceConnectorOrigination
s {$sel:voiceConnectorId:GetVoiceConnectorOrigination' :: Text
voiceConnectorId = Text
a} :: GetVoiceConnectorOrigination)
instance Core.AWSRequest GetVoiceConnectorOrigination where
type
AWSResponse GetVoiceConnectorOrigination =
GetVoiceConnectorOriginationResponse
request :: GetVoiceConnectorOrigination
-> Request GetVoiceConnectorOrigination
request = Service
-> GetVoiceConnectorOrigination
-> Request GetVoiceConnectorOrigination
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetVoiceConnectorOrigination
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetVoiceConnectorOrigination)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetVoiceConnectorOrigination))
-> Logger
-> Service
-> Proxy GetVoiceConnectorOrigination
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetVoiceConnectorOrigination)))
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 Origination -> Int -> GetVoiceConnectorOriginationResponse
GetVoiceConnectorOriginationResponse'
(Maybe Origination -> Int -> GetVoiceConnectorOriginationResponse)
-> Either String (Maybe Origination)
-> Either String (Int -> GetVoiceConnectorOriginationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Origination)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Origination")
Either String (Int -> GetVoiceConnectorOriginationResponse)
-> Either String Int
-> Either String GetVoiceConnectorOriginationResponse
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
GetVoiceConnectorOrigination
instance Prelude.NFData GetVoiceConnectorOrigination
instance Core.ToHeaders GetVoiceConnectorOrigination where
toHeaders :: GetVoiceConnectorOrigination -> ResponseHeaders
toHeaders = ResponseHeaders -> GetVoiceConnectorOrigination -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetVoiceConnectorOrigination where
toPath :: GetVoiceConnectorOrigination -> ByteString
toPath GetVoiceConnectorOrigination' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:GetVoiceConnectorOrigination' :: GetVoiceConnectorOrigination -> Text
..} =
[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
"/origination"
]
instance Core.ToQuery GetVoiceConnectorOrigination where
toQuery :: GetVoiceConnectorOrigination -> QueryString
toQuery = QueryString -> GetVoiceConnectorOrigination -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetVoiceConnectorOriginationResponse = GetVoiceConnectorOriginationResponse'
{
GetVoiceConnectorOriginationResponse -> Maybe Origination
origination :: Prelude.Maybe Origination,
GetVoiceConnectorOriginationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetVoiceConnectorOriginationResponse
-> GetVoiceConnectorOriginationResponse -> Bool
(GetVoiceConnectorOriginationResponse
-> GetVoiceConnectorOriginationResponse -> Bool)
-> (GetVoiceConnectorOriginationResponse
-> GetVoiceConnectorOriginationResponse -> Bool)
-> Eq GetVoiceConnectorOriginationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVoiceConnectorOriginationResponse
-> GetVoiceConnectorOriginationResponse -> Bool
$c/= :: GetVoiceConnectorOriginationResponse
-> GetVoiceConnectorOriginationResponse -> Bool
== :: GetVoiceConnectorOriginationResponse
-> GetVoiceConnectorOriginationResponse -> Bool
$c== :: GetVoiceConnectorOriginationResponse
-> GetVoiceConnectorOriginationResponse -> Bool
Prelude.Eq, ReadPrec [GetVoiceConnectorOriginationResponse]
ReadPrec GetVoiceConnectorOriginationResponse
Int -> ReadS GetVoiceConnectorOriginationResponse
ReadS [GetVoiceConnectorOriginationResponse]
(Int -> ReadS GetVoiceConnectorOriginationResponse)
-> ReadS [GetVoiceConnectorOriginationResponse]
-> ReadPrec GetVoiceConnectorOriginationResponse
-> ReadPrec [GetVoiceConnectorOriginationResponse]
-> Read GetVoiceConnectorOriginationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVoiceConnectorOriginationResponse]
$creadListPrec :: ReadPrec [GetVoiceConnectorOriginationResponse]
readPrec :: ReadPrec GetVoiceConnectorOriginationResponse
$creadPrec :: ReadPrec GetVoiceConnectorOriginationResponse
readList :: ReadS [GetVoiceConnectorOriginationResponse]
$creadList :: ReadS [GetVoiceConnectorOriginationResponse]
readsPrec :: Int -> ReadS GetVoiceConnectorOriginationResponse
$creadsPrec :: Int -> ReadS GetVoiceConnectorOriginationResponse
Prelude.Read, Int -> GetVoiceConnectorOriginationResponse -> ShowS
[GetVoiceConnectorOriginationResponse] -> ShowS
GetVoiceConnectorOriginationResponse -> String
(Int -> GetVoiceConnectorOriginationResponse -> ShowS)
-> (GetVoiceConnectorOriginationResponse -> String)
-> ([GetVoiceConnectorOriginationResponse] -> ShowS)
-> Show GetVoiceConnectorOriginationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVoiceConnectorOriginationResponse] -> ShowS
$cshowList :: [GetVoiceConnectorOriginationResponse] -> ShowS
show :: GetVoiceConnectorOriginationResponse -> String
$cshow :: GetVoiceConnectorOriginationResponse -> String
showsPrec :: Int -> GetVoiceConnectorOriginationResponse -> ShowS
$cshowsPrec :: Int -> GetVoiceConnectorOriginationResponse -> ShowS
Prelude.Show, (forall x.
GetVoiceConnectorOriginationResponse
-> Rep GetVoiceConnectorOriginationResponse x)
-> (forall x.
Rep GetVoiceConnectorOriginationResponse x
-> GetVoiceConnectorOriginationResponse)
-> Generic GetVoiceConnectorOriginationResponse
forall x.
Rep GetVoiceConnectorOriginationResponse x
-> GetVoiceConnectorOriginationResponse
forall x.
GetVoiceConnectorOriginationResponse
-> Rep GetVoiceConnectorOriginationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetVoiceConnectorOriginationResponse x
-> GetVoiceConnectorOriginationResponse
$cfrom :: forall x.
GetVoiceConnectorOriginationResponse
-> Rep GetVoiceConnectorOriginationResponse x
Prelude.Generic)
newGetVoiceConnectorOriginationResponse ::
Prelude.Int ->
GetVoiceConnectorOriginationResponse
newGetVoiceConnectorOriginationResponse :: Int -> GetVoiceConnectorOriginationResponse
newGetVoiceConnectorOriginationResponse Int
pHttpStatus_ =
GetVoiceConnectorOriginationResponse' :: Maybe Origination -> Int -> GetVoiceConnectorOriginationResponse
GetVoiceConnectorOriginationResponse'
{ $sel:origination:GetVoiceConnectorOriginationResponse' :: Maybe Origination
origination =
Maybe Origination
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetVoiceConnectorOriginationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getVoiceConnectorOriginationResponse_origination :: Lens.Lens' GetVoiceConnectorOriginationResponse (Prelude.Maybe Origination)
getVoiceConnectorOriginationResponse_origination :: (Maybe Origination -> f (Maybe Origination))
-> GetVoiceConnectorOriginationResponse
-> f GetVoiceConnectorOriginationResponse
getVoiceConnectorOriginationResponse_origination = (GetVoiceConnectorOriginationResponse -> Maybe Origination)
-> (GetVoiceConnectorOriginationResponse
-> Maybe Origination -> GetVoiceConnectorOriginationResponse)
-> Lens
GetVoiceConnectorOriginationResponse
GetVoiceConnectorOriginationResponse
(Maybe Origination)
(Maybe Origination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVoiceConnectorOriginationResponse' {Maybe Origination
origination :: Maybe Origination
$sel:origination:GetVoiceConnectorOriginationResponse' :: GetVoiceConnectorOriginationResponse -> Maybe Origination
origination} -> Maybe Origination
origination) (\s :: GetVoiceConnectorOriginationResponse
s@GetVoiceConnectorOriginationResponse' {} Maybe Origination
a -> GetVoiceConnectorOriginationResponse
s {$sel:origination:GetVoiceConnectorOriginationResponse' :: Maybe Origination
origination = Maybe Origination
a} :: GetVoiceConnectorOriginationResponse)
getVoiceConnectorOriginationResponse_httpStatus :: Lens.Lens' GetVoiceConnectorOriginationResponse Prelude.Int
getVoiceConnectorOriginationResponse_httpStatus :: (Int -> f Int)
-> GetVoiceConnectorOriginationResponse
-> f GetVoiceConnectorOriginationResponse
getVoiceConnectorOriginationResponse_httpStatus = (GetVoiceConnectorOriginationResponse -> Int)
-> (GetVoiceConnectorOriginationResponse
-> Int -> GetVoiceConnectorOriginationResponse)
-> Lens
GetVoiceConnectorOriginationResponse
GetVoiceConnectorOriginationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVoiceConnectorOriginationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetVoiceConnectorOriginationResponse' :: GetVoiceConnectorOriginationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetVoiceConnectorOriginationResponse
s@GetVoiceConnectorOriginationResponse' {} Int
a -> GetVoiceConnectorOriginationResponse
s {$sel:httpStatus:GetVoiceConnectorOriginationResponse' :: Int
httpStatus = Int
a} :: GetVoiceConnectorOriginationResponse)
instance
Prelude.NFData
GetVoiceConnectorOriginationResponse