{-# 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.GetVoiceConnectorLoggingConfiguration
-- 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.GetVoiceConnectorLoggingConfiguration
  ( -- * Creating a Request
    GetVoiceConnectorLoggingConfiguration (..),
    newGetVoiceConnectorLoggingConfiguration,

    -- * Request Lenses
    getVoiceConnectorLoggingConfiguration_voiceConnectorId,

    -- * Destructuring the Response
    GetVoiceConnectorLoggingConfigurationResponse (..),
    newGetVoiceConnectorLoggingConfigurationResponse,

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

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

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

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

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

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

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

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

-- | /See:/ 'newGetVoiceConnectorLoggingConfigurationResponse' smart constructor.
data GetVoiceConnectorLoggingConfigurationResponse = GetVoiceConnectorLoggingConfigurationResponse'
  { GetVoiceConnectorLoggingConfigurationResponse
-> Maybe LoggingConfiguration
loggingConfiguration :: Prelude.Maybe LoggingConfiguration,
    -- | The response's http status code.
    GetVoiceConnectorLoggingConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetVoiceConnectorLoggingConfigurationResponse
-> GetVoiceConnectorLoggingConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetVoiceConnectorLoggingConfigurationResponse
-> GetVoiceConnectorLoggingConfigurationResponse -> Bool
$c/= :: GetVoiceConnectorLoggingConfigurationResponse
-> GetVoiceConnectorLoggingConfigurationResponse -> Bool
== :: GetVoiceConnectorLoggingConfigurationResponse
-> GetVoiceConnectorLoggingConfigurationResponse -> Bool
$c== :: GetVoiceConnectorLoggingConfigurationResponse
-> GetVoiceConnectorLoggingConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetVoiceConnectorLoggingConfigurationResponse]
ReadPrec GetVoiceConnectorLoggingConfigurationResponse
Int -> ReadS GetVoiceConnectorLoggingConfigurationResponse
ReadS [GetVoiceConnectorLoggingConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetVoiceConnectorLoggingConfigurationResponse]
$creadListPrec :: ReadPrec [GetVoiceConnectorLoggingConfigurationResponse]
readPrec :: ReadPrec GetVoiceConnectorLoggingConfigurationResponse
$creadPrec :: ReadPrec GetVoiceConnectorLoggingConfigurationResponse
readList :: ReadS [GetVoiceConnectorLoggingConfigurationResponse]
$creadList :: ReadS [GetVoiceConnectorLoggingConfigurationResponse]
readsPrec :: Int -> ReadS GetVoiceConnectorLoggingConfigurationResponse
$creadsPrec :: Int -> ReadS GetVoiceConnectorLoggingConfigurationResponse
Prelude.Read, Int -> GetVoiceConnectorLoggingConfigurationResponse -> ShowS
[GetVoiceConnectorLoggingConfigurationResponse] -> ShowS
GetVoiceConnectorLoggingConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetVoiceConnectorLoggingConfigurationResponse] -> ShowS
$cshowList :: [GetVoiceConnectorLoggingConfigurationResponse] -> ShowS
show :: GetVoiceConnectorLoggingConfigurationResponse -> String
$cshow :: GetVoiceConnectorLoggingConfigurationResponse -> String
showsPrec :: Int -> GetVoiceConnectorLoggingConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetVoiceConnectorLoggingConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep GetVoiceConnectorLoggingConfigurationResponse x
-> GetVoiceConnectorLoggingConfigurationResponse
forall x.
GetVoiceConnectorLoggingConfigurationResponse
-> Rep GetVoiceConnectorLoggingConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetVoiceConnectorLoggingConfigurationResponse x
-> GetVoiceConnectorLoggingConfigurationResponse
$cfrom :: forall x.
GetVoiceConnectorLoggingConfigurationResponse
-> Rep GetVoiceConnectorLoggingConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetVoiceConnectorLoggingConfigurationResponse' 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:
--
-- 'loggingConfiguration', 'getVoiceConnectorLoggingConfigurationResponse_loggingConfiguration' - Undocumented member.
--
-- 'httpStatus', 'getVoiceConnectorLoggingConfigurationResponse_httpStatus' - The response's http status code.
newGetVoiceConnectorLoggingConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetVoiceConnectorLoggingConfigurationResponse
newGetVoiceConnectorLoggingConfigurationResponse :: Int -> GetVoiceConnectorLoggingConfigurationResponse
newGetVoiceConnectorLoggingConfigurationResponse
  Int
pHttpStatus_ =
    GetVoiceConnectorLoggingConfigurationResponse'
      { $sel:loggingConfiguration:GetVoiceConnectorLoggingConfigurationResponse' :: Maybe LoggingConfiguration
loggingConfiguration =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetVoiceConnectorLoggingConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Undocumented member.
getVoiceConnectorLoggingConfigurationResponse_loggingConfiguration :: Lens.Lens' GetVoiceConnectorLoggingConfigurationResponse (Prelude.Maybe LoggingConfiguration)
getVoiceConnectorLoggingConfigurationResponse_loggingConfiguration :: Lens'
  GetVoiceConnectorLoggingConfigurationResponse
  (Maybe LoggingConfiguration)
getVoiceConnectorLoggingConfigurationResponse_loggingConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetVoiceConnectorLoggingConfigurationResponse' {Maybe LoggingConfiguration
loggingConfiguration :: Maybe LoggingConfiguration
$sel:loggingConfiguration:GetVoiceConnectorLoggingConfigurationResponse' :: GetVoiceConnectorLoggingConfigurationResponse
-> Maybe LoggingConfiguration
loggingConfiguration} -> Maybe LoggingConfiguration
loggingConfiguration) (\s :: GetVoiceConnectorLoggingConfigurationResponse
s@GetVoiceConnectorLoggingConfigurationResponse' {} Maybe LoggingConfiguration
a -> GetVoiceConnectorLoggingConfigurationResponse
s {$sel:loggingConfiguration:GetVoiceConnectorLoggingConfigurationResponse' :: Maybe LoggingConfiguration
loggingConfiguration = Maybe LoggingConfiguration
a} :: GetVoiceConnectorLoggingConfigurationResponse)

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

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