{-# 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.ChimeSdkVoice.GetVoiceConnectorEmergencyCallingConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- -- | Undocumented operation.
module Amazonka.ChimeSdkVoice.GetVoiceConnectorEmergencyCallingConfiguration
  ( -- * Creating a Request
    GetVoiceConnectorEmergencyCallingConfiguration (..),
    newGetVoiceConnectorEmergencyCallingConfiguration,

    -- * Request Lenses
    getVoiceConnectorEmergencyCallingConfiguration_voiceConnectorId,

    -- * Destructuring the Response
    GetVoiceConnectorEmergencyCallingConfigurationResponse (..),
    newGetVoiceConnectorEmergencyCallingConfigurationResponse,

    -- * Response Lenses
    getVoiceConnectorEmergencyCallingConfigurationResponse_emergencyCallingConfiguration,
    getVoiceConnectorEmergencyCallingConfigurationResponse_httpStatus,
  )
where

import Amazonka.ChimeSdkVoice.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:/ 'newGetVoiceConnectorEmergencyCallingConfiguration' smart constructor.
data GetVoiceConnectorEmergencyCallingConfiguration = GetVoiceConnectorEmergencyCallingConfiguration'
  { GetVoiceConnectorEmergencyCallingConfiguration -> Text
voiceConnectorId :: Prelude.Text
  }
  deriving (GetVoiceConnectorEmergencyCallingConfiguration
-> GetVoiceConnectorEmergencyCallingConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVoiceConnectorEmergencyCallingConfiguration
-> GetVoiceConnectorEmergencyCallingConfiguration -> Bool
$c/= :: GetVoiceConnectorEmergencyCallingConfiguration
-> GetVoiceConnectorEmergencyCallingConfiguration -> Bool
== :: GetVoiceConnectorEmergencyCallingConfiguration
-> GetVoiceConnectorEmergencyCallingConfiguration -> Bool
$c== :: GetVoiceConnectorEmergencyCallingConfiguration
-> GetVoiceConnectorEmergencyCallingConfiguration -> Bool
Prelude.Eq, ReadPrec [GetVoiceConnectorEmergencyCallingConfiguration]
ReadPrec GetVoiceConnectorEmergencyCallingConfiguration
Int -> ReadS GetVoiceConnectorEmergencyCallingConfiguration
ReadS [GetVoiceConnectorEmergencyCallingConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVoiceConnectorEmergencyCallingConfiguration]
$creadListPrec :: ReadPrec [GetVoiceConnectorEmergencyCallingConfiguration]
readPrec :: ReadPrec GetVoiceConnectorEmergencyCallingConfiguration
$creadPrec :: ReadPrec GetVoiceConnectorEmergencyCallingConfiguration
readList :: ReadS [GetVoiceConnectorEmergencyCallingConfiguration]
$creadList :: ReadS [GetVoiceConnectorEmergencyCallingConfiguration]
readsPrec :: Int -> ReadS GetVoiceConnectorEmergencyCallingConfiguration
$creadsPrec :: Int -> ReadS GetVoiceConnectorEmergencyCallingConfiguration
Prelude.Read, Int -> GetVoiceConnectorEmergencyCallingConfiguration -> ShowS
[GetVoiceConnectorEmergencyCallingConfiguration] -> ShowS
GetVoiceConnectorEmergencyCallingConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVoiceConnectorEmergencyCallingConfiguration] -> ShowS
$cshowList :: [GetVoiceConnectorEmergencyCallingConfiguration] -> ShowS
show :: GetVoiceConnectorEmergencyCallingConfiguration -> String
$cshow :: GetVoiceConnectorEmergencyCallingConfiguration -> String
showsPrec :: Int -> GetVoiceConnectorEmergencyCallingConfiguration -> ShowS
$cshowsPrec :: Int -> GetVoiceConnectorEmergencyCallingConfiguration -> ShowS
Prelude.Show, forall x.
Rep GetVoiceConnectorEmergencyCallingConfiguration x
-> GetVoiceConnectorEmergencyCallingConfiguration
forall x.
GetVoiceConnectorEmergencyCallingConfiguration
-> Rep GetVoiceConnectorEmergencyCallingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetVoiceConnectorEmergencyCallingConfiguration x
-> GetVoiceConnectorEmergencyCallingConfiguration
$cfrom :: forall x.
GetVoiceConnectorEmergencyCallingConfiguration
-> Rep GetVoiceConnectorEmergencyCallingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'GetVoiceConnectorEmergencyCallingConfiguration' 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', 'getVoiceConnectorEmergencyCallingConfiguration_voiceConnectorId' - Undocumented member.
newGetVoiceConnectorEmergencyCallingConfiguration ::
  -- | 'voiceConnectorId'
  Prelude.Text ->
  GetVoiceConnectorEmergencyCallingConfiguration
newGetVoiceConnectorEmergencyCallingConfiguration :: Text -> GetVoiceConnectorEmergencyCallingConfiguration
newGetVoiceConnectorEmergencyCallingConfiguration
  Text
pVoiceConnectorId_ =
    GetVoiceConnectorEmergencyCallingConfiguration'
      { $sel:voiceConnectorId:GetVoiceConnectorEmergencyCallingConfiguration' :: Text
voiceConnectorId =
          Text
pVoiceConnectorId_
      }

-- | Undocumented member.
getVoiceConnectorEmergencyCallingConfiguration_voiceConnectorId :: Lens.Lens' GetVoiceConnectorEmergencyCallingConfiguration Prelude.Text
getVoiceConnectorEmergencyCallingConfiguration_voiceConnectorId :: Lens' GetVoiceConnectorEmergencyCallingConfiguration Text
getVoiceConnectorEmergencyCallingConfiguration_voiceConnectorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVoiceConnectorEmergencyCallingConfiguration' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:GetVoiceConnectorEmergencyCallingConfiguration' :: GetVoiceConnectorEmergencyCallingConfiguration -> Text
voiceConnectorId} -> Text
voiceConnectorId) (\s :: GetVoiceConnectorEmergencyCallingConfiguration
s@GetVoiceConnectorEmergencyCallingConfiguration' {} Text
a -> GetVoiceConnectorEmergencyCallingConfiguration
s {$sel:voiceConnectorId:GetVoiceConnectorEmergencyCallingConfiguration' :: Text
voiceConnectorId = Text
a} :: GetVoiceConnectorEmergencyCallingConfiguration)

instance
  Core.AWSRequest
    GetVoiceConnectorEmergencyCallingConfiguration
  where
  type
    AWSResponse
      GetVoiceConnectorEmergencyCallingConfiguration =
      GetVoiceConnectorEmergencyCallingConfigurationResponse
  request :: (Service -> Service)
-> GetVoiceConnectorEmergencyCallingConfiguration
-> Request GetVoiceConnectorEmergencyCallingConfiguration
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 GetVoiceConnectorEmergencyCallingConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetVoiceConnectorEmergencyCallingConfiguration)))
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 EmergencyCallingConfiguration
-> Int -> GetVoiceConnectorEmergencyCallingConfigurationResponse
GetVoiceConnectorEmergencyCallingConfigurationResponse'
            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
"EmergencyCallingConfiguration")
            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
    GetVoiceConnectorEmergencyCallingConfiguration
  where
  hashWithSalt :: Int -> GetVoiceConnectorEmergencyCallingConfiguration -> Int
hashWithSalt
    Int
_salt
    GetVoiceConnectorEmergencyCallingConfiguration' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:GetVoiceConnectorEmergencyCallingConfiguration' :: GetVoiceConnectorEmergencyCallingConfiguration -> Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
voiceConnectorId

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

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

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

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

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

-- |
-- Create a value of 'GetVoiceConnectorEmergencyCallingConfigurationResponse' 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:
--
-- 'emergencyCallingConfiguration', 'getVoiceConnectorEmergencyCallingConfigurationResponse_emergencyCallingConfiguration' - Undocumented member.
--
-- 'httpStatus', 'getVoiceConnectorEmergencyCallingConfigurationResponse_httpStatus' - The response's http status code.
newGetVoiceConnectorEmergencyCallingConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetVoiceConnectorEmergencyCallingConfigurationResponse
newGetVoiceConnectorEmergencyCallingConfigurationResponse :: Int -> GetVoiceConnectorEmergencyCallingConfigurationResponse
newGetVoiceConnectorEmergencyCallingConfigurationResponse
  Int
pHttpStatus_ =
    GetVoiceConnectorEmergencyCallingConfigurationResponse'
      { $sel:emergencyCallingConfiguration:GetVoiceConnectorEmergencyCallingConfigurationResponse' :: Maybe EmergencyCallingConfiguration
emergencyCallingConfiguration =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetVoiceConnectorEmergencyCallingConfigurationResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | Undocumented member.
getVoiceConnectorEmergencyCallingConfigurationResponse_emergencyCallingConfiguration :: Lens.Lens' GetVoiceConnectorEmergencyCallingConfigurationResponse (Prelude.Maybe EmergencyCallingConfiguration)
getVoiceConnectorEmergencyCallingConfigurationResponse_emergencyCallingConfiguration :: Lens'
  GetVoiceConnectorEmergencyCallingConfigurationResponse
  (Maybe EmergencyCallingConfiguration)
getVoiceConnectorEmergencyCallingConfigurationResponse_emergencyCallingConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVoiceConnectorEmergencyCallingConfigurationResponse' {Maybe EmergencyCallingConfiguration
emergencyCallingConfiguration :: Maybe EmergencyCallingConfiguration
$sel:emergencyCallingConfiguration:GetVoiceConnectorEmergencyCallingConfigurationResponse' :: GetVoiceConnectorEmergencyCallingConfigurationResponse
-> Maybe EmergencyCallingConfiguration
emergencyCallingConfiguration} -> Maybe EmergencyCallingConfiguration
emergencyCallingConfiguration) (\s :: GetVoiceConnectorEmergencyCallingConfigurationResponse
s@GetVoiceConnectorEmergencyCallingConfigurationResponse' {} Maybe EmergencyCallingConfiguration
a -> GetVoiceConnectorEmergencyCallingConfigurationResponse
s {$sel:emergencyCallingConfiguration:GetVoiceConnectorEmergencyCallingConfigurationResponse' :: Maybe EmergencyCallingConfiguration
emergencyCallingConfiguration = Maybe EmergencyCallingConfiguration
a} :: GetVoiceConnectorEmergencyCallingConfigurationResponse)

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

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