{-# 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.GetVoiceConnectorProxy
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets the proxy configuration details for the specified Amazon Chime
-- Voice Connector.
module Amazonka.Chime.GetVoiceConnectorProxy
  ( -- * Creating a Request
    GetVoiceConnectorProxy (..),
    newGetVoiceConnectorProxy,

    -- * Request Lenses
    getVoiceConnectorProxy_voiceConnectorId,

    -- * Destructuring the Response
    GetVoiceConnectorProxyResponse (..),
    newGetVoiceConnectorProxyResponse,

    -- * Response Lenses
    getVoiceConnectorProxyResponse_proxy,
    getVoiceConnectorProxyResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetVoiceConnectorProxy' smart constructor.
data GetVoiceConnectorProxy = GetVoiceConnectorProxy'
  { -- | The Amazon Chime voice connector ID.
    GetVoiceConnectorProxy -> Text
voiceConnectorId :: Prelude.Text
  }
  deriving (GetVoiceConnectorProxy -> GetVoiceConnectorProxy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVoiceConnectorProxy -> GetVoiceConnectorProxy -> Bool
$c/= :: GetVoiceConnectorProxy -> GetVoiceConnectorProxy -> Bool
== :: GetVoiceConnectorProxy -> GetVoiceConnectorProxy -> Bool
$c== :: GetVoiceConnectorProxy -> GetVoiceConnectorProxy -> Bool
Prelude.Eq, ReadPrec [GetVoiceConnectorProxy]
ReadPrec GetVoiceConnectorProxy
Int -> ReadS GetVoiceConnectorProxy
ReadS [GetVoiceConnectorProxy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVoiceConnectorProxy]
$creadListPrec :: ReadPrec [GetVoiceConnectorProxy]
readPrec :: ReadPrec GetVoiceConnectorProxy
$creadPrec :: ReadPrec GetVoiceConnectorProxy
readList :: ReadS [GetVoiceConnectorProxy]
$creadList :: ReadS [GetVoiceConnectorProxy]
readsPrec :: Int -> ReadS GetVoiceConnectorProxy
$creadsPrec :: Int -> ReadS GetVoiceConnectorProxy
Prelude.Read, Int -> GetVoiceConnectorProxy -> ShowS
[GetVoiceConnectorProxy] -> ShowS
GetVoiceConnectorProxy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVoiceConnectorProxy] -> ShowS
$cshowList :: [GetVoiceConnectorProxy] -> ShowS
show :: GetVoiceConnectorProxy -> String
$cshow :: GetVoiceConnectorProxy -> String
showsPrec :: Int -> GetVoiceConnectorProxy -> ShowS
$cshowsPrec :: Int -> GetVoiceConnectorProxy -> ShowS
Prelude.Show, forall x. Rep GetVoiceConnectorProxy x -> GetVoiceConnectorProxy
forall x. GetVoiceConnectorProxy -> Rep GetVoiceConnectorProxy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetVoiceConnectorProxy x -> GetVoiceConnectorProxy
$cfrom :: forall x. GetVoiceConnectorProxy -> Rep GetVoiceConnectorProxy x
Prelude.Generic)

-- |
-- Create a value of 'GetVoiceConnectorProxy' 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:
--
-- 'voiceConnectorId', 'getVoiceConnectorProxy_voiceConnectorId' - The Amazon Chime voice connector ID.
newGetVoiceConnectorProxy ::
  -- | 'voiceConnectorId'
  Prelude.Text ->
  GetVoiceConnectorProxy
newGetVoiceConnectorProxy :: Text -> GetVoiceConnectorProxy
newGetVoiceConnectorProxy Text
pVoiceConnectorId_ =
  GetVoiceConnectorProxy'
    { $sel:voiceConnectorId:GetVoiceConnectorProxy' :: Text
voiceConnectorId =
        Text
pVoiceConnectorId_
    }

-- | The Amazon Chime voice connector ID.
getVoiceConnectorProxy_voiceConnectorId :: Lens.Lens' GetVoiceConnectorProxy Prelude.Text
getVoiceConnectorProxy_voiceConnectorId :: Lens' GetVoiceConnectorProxy Text
getVoiceConnectorProxy_voiceConnectorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVoiceConnectorProxy' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:GetVoiceConnectorProxy' :: GetVoiceConnectorProxy -> Text
voiceConnectorId} -> Text
voiceConnectorId) (\s :: GetVoiceConnectorProxy
s@GetVoiceConnectorProxy' {} Text
a -> GetVoiceConnectorProxy
s {$sel:voiceConnectorId:GetVoiceConnectorProxy' :: Text
voiceConnectorId = Text
a} :: GetVoiceConnectorProxy)

instance Core.AWSRequest GetVoiceConnectorProxy where
  type
    AWSResponse GetVoiceConnectorProxy =
      GetVoiceConnectorProxyResponse
  request :: (Service -> Service)
-> GetVoiceConnectorProxy -> Request GetVoiceConnectorProxy
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetVoiceConnectorProxy
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetVoiceConnectorProxy)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Proxy -> Int -> GetVoiceConnectorProxyResponse
GetVoiceConnectorProxyResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Proxy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetVoiceConnectorProxy where
  hashWithSalt :: Int -> GetVoiceConnectorProxy -> Int
hashWithSalt Int
_salt GetVoiceConnectorProxy' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:GetVoiceConnectorProxy' :: GetVoiceConnectorProxy -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
voiceConnectorId

instance Prelude.NFData GetVoiceConnectorProxy where
  rnf :: GetVoiceConnectorProxy -> ()
rnf GetVoiceConnectorProxy' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:GetVoiceConnectorProxy' :: GetVoiceConnectorProxy -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
voiceConnectorId

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

instance Data.ToPath GetVoiceConnectorProxy where
  toPath :: GetVoiceConnectorProxy -> ByteString
toPath GetVoiceConnectorProxy' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:GetVoiceConnectorProxy' :: GetVoiceConnectorProxy -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/voice-connectors/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
voiceConnectorId,
        ByteString
"/programmable-numbers/proxy"
      ]

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

-- | /See:/ 'newGetVoiceConnectorProxyResponse' smart constructor.
data GetVoiceConnectorProxyResponse = GetVoiceConnectorProxyResponse'
  { -- | The proxy configuration details.
    GetVoiceConnectorProxyResponse -> Maybe Proxy
proxy :: Prelude.Maybe Proxy,
    -- | The response's http status code.
    GetVoiceConnectorProxyResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetVoiceConnectorProxyResponse
-> GetVoiceConnectorProxyResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVoiceConnectorProxyResponse
-> GetVoiceConnectorProxyResponse -> Bool
$c/= :: GetVoiceConnectorProxyResponse
-> GetVoiceConnectorProxyResponse -> Bool
== :: GetVoiceConnectorProxyResponse
-> GetVoiceConnectorProxyResponse -> Bool
$c== :: GetVoiceConnectorProxyResponse
-> GetVoiceConnectorProxyResponse -> Bool
Prelude.Eq, Int -> GetVoiceConnectorProxyResponse -> ShowS
[GetVoiceConnectorProxyResponse] -> ShowS
GetVoiceConnectorProxyResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVoiceConnectorProxyResponse] -> ShowS
$cshowList :: [GetVoiceConnectorProxyResponse] -> ShowS
show :: GetVoiceConnectorProxyResponse -> String
$cshow :: GetVoiceConnectorProxyResponse -> String
showsPrec :: Int -> GetVoiceConnectorProxyResponse -> ShowS
$cshowsPrec :: Int -> GetVoiceConnectorProxyResponse -> ShowS
Prelude.Show, forall x.
Rep GetVoiceConnectorProxyResponse x
-> GetVoiceConnectorProxyResponse
forall x.
GetVoiceConnectorProxyResponse
-> Rep GetVoiceConnectorProxyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetVoiceConnectorProxyResponse x
-> GetVoiceConnectorProxyResponse
$cfrom :: forall x.
GetVoiceConnectorProxyResponse
-> Rep GetVoiceConnectorProxyResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetVoiceConnectorProxyResponse' 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:
--
-- 'proxy', 'getVoiceConnectorProxyResponse_proxy' - The proxy configuration details.
--
-- 'httpStatus', 'getVoiceConnectorProxyResponse_httpStatus' - The response's http status code.
newGetVoiceConnectorProxyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetVoiceConnectorProxyResponse
newGetVoiceConnectorProxyResponse :: Int -> GetVoiceConnectorProxyResponse
newGetVoiceConnectorProxyResponse Int
pHttpStatus_ =
  GetVoiceConnectorProxyResponse'
    { $sel:proxy:GetVoiceConnectorProxyResponse' :: Maybe Proxy
proxy =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetVoiceConnectorProxyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The proxy configuration details.
getVoiceConnectorProxyResponse_proxy :: Lens.Lens' GetVoiceConnectorProxyResponse (Prelude.Maybe Proxy)
getVoiceConnectorProxyResponse_proxy :: Lens' GetVoiceConnectorProxyResponse (Maybe Proxy)
getVoiceConnectorProxyResponse_proxy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVoiceConnectorProxyResponse' {Maybe Proxy
proxy :: Maybe Proxy
$sel:proxy:GetVoiceConnectorProxyResponse' :: GetVoiceConnectorProxyResponse -> Maybe Proxy
proxy} -> Maybe Proxy
proxy) (\s :: GetVoiceConnectorProxyResponse
s@GetVoiceConnectorProxyResponse' {} Maybe Proxy
a -> GetVoiceConnectorProxyResponse
s {$sel:proxy:GetVoiceConnectorProxyResponse' :: Maybe Proxy
proxy = Maybe Proxy
a} :: GetVoiceConnectorProxyResponse)

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

instance
  Prelude.NFData
    GetVoiceConnectorProxyResponse
  where
  rnf :: GetVoiceConnectorProxyResponse -> ()
rnf GetVoiceConnectorProxyResponse' {Int
Maybe Proxy
httpStatus :: Int
proxy :: Maybe Proxy
$sel:httpStatus:GetVoiceConnectorProxyResponse' :: GetVoiceConnectorProxyResponse -> Int
$sel:proxy:GetVoiceConnectorProxyResponse' :: GetVoiceConnectorProxyResponse -> Maybe Proxy
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Proxy
proxy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus