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

    -- * Destructuring the Response
    GetGlobalSettingsResponse (..),
    newGetGlobalSettingsResponse,

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

-- |
-- Create a value of 'GetGlobalSettings' 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.
newGetGlobalSettings ::
  GetGlobalSettings
newGetGlobalSettings :: GetGlobalSettings
newGetGlobalSettings = GetGlobalSettings
GetGlobalSettings'

instance Core.AWSRequest GetGlobalSettings where
  type
    AWSResponse GetGlobalSettings =
      GetGlobalSettingsResponse
  request :: (Service -> Service)
-> GetGlobalSettings -> Request GetGlobalSettings
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 GetGlobalSettings
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetGlobalSettings)))
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 VoiceConnectorSettings -> Int -> GetGlobalSettingsResponse
GetGlobalSettingsResponse'
            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
"VoiceConnector")
            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 GetGlobalSettings where
  hashWithSalt :: Int -> GetGlobalSettings -> Int
hashWithSalt Int
_salt GetGlobalSettings
_ =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()

instance Prelude.NFData GetGlobalSettings where
  rnf :: GetGlobalSettings -> ()
rnf GetGlobalSettings
_ = ()

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

instance Data.ToPath GetGlobalSettings where
  toPath :: GetGlobalSettings -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/settings"

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

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

-- |
-- Create a value of 'GetGlobalSettingsResponse' 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:
--
-- 'voiceConnector', 'getGlobalSettingsResponse_voiceConnector' - Undocumented member.
--
-- 'httpStatus', 'getGlobalSettingsResponse_httpStatus' - The response's http status code.
newGetGlobalSettingsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetGlobalSettingsResponse
newGetGlobalSettingsResponse :: Int -> GetGlobalSettingsResponse
newGetGlobalSettingsResponse Int
pHttpStatus_ =
  GetGlobalSettingsResponse'
    { $sel:voiceConnector:GetGlobalSettingsResponse' :: Maybe VoiceConnectorSettings
voiceConnector =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetGlobalSettingsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
getGlobalSettingsResponse_voiceConnector :: Lens.Lens' GetGlobalSettingsResponse (Prelude.Maybe VoiceConnectorSettings)
getGlobalSettingsResponse_voiceConnector :: Lens' GetGlobalSettingsResponse (Maybe VoiceConnectorSettings)
getGlobalSettingsResponse_voiceConnector = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetGlobalSettingsResponse' {Maybe VoiceConnectorSettings
voiceConnector :: Maybe VoiceConnectorSettings
$sel:voiceConnector:GetGlobalSettingsResponse' :: GetGlobalSettingsResponse -> Maybe VoiceConnectorSettings
voiceConnector} -> Maybe VoiceConnectorSettings
voiceConnector) (\s :: GetGlobalSettingsResponse
s@GetGlobalSettingsResponse' {} Maybe VoiceConnectorSettings
a -> GetGlobalSettingsResponse
s {$sel:voiceConnector:GetGlobalSettingsResponse' :: Maybe VoiceConnectorSettings
voiceConnector = Maybe VoiceConnectorSettings
a} :: GetGlobalSettingsResponse)

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

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