{-# 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.AlexaBusiness.GetConferencePreference
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves the existing conference preferences.
module Amazonka.AlexaBusiness.GetConferencePreference
  ( -- * Creating a Request
    GetConferencePreference (..),
    newGetConferencePreference,

    -- * Destructuring the Response
    GetConferencePreferenceResponse (..),
    newGetConferencePreferenceResponse,

    -- * Response Lenses
    getConferencePreferenceResponse_preference,
    getConferencePreferenceResponse_httpStatus,
  )
where

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

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

instance Core.AWSRequest GetConferencePreference where
  type
    AWSResponse GetConferencePreference =
      GetConferencePreferenceResponse
  request :: (Service -> Service)
-> GetConferencePreference -> Request GetConferencePreference
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetConferencePreference
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetConferencePreference)))
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 ConferencePreference
-> Int -> GetConferencePreferenceResponse
GetConferencePreferenceResponse'
            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
"Preference")
            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 GetConferencePreference where
  hashWithSalt :: Int -> GetConferencePreference -> Int
hashWithSalt Int
_salt GetConferencePreference
_ =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()

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

instance Data.ToHeaders GetConferencePreference where
  toHeaders :: GetConferencePreference -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AlexaForBusiness.GetConferencePreference" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON GetConferencePreference where
  toJSON :: GetConferencePreference -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)

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

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

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

-- |
-- Create a value of 'GetConferencePreferenceResponse' 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:
--
-- 'preference', 'getConferencePreferenceResponse_preference' - The conference preference.
--
-- 'httpStatus', 'getConferencePreferenceResponse_httpStatus' - The response's http status code.
newGetConferencePreferenceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetConferencePreferenceResponse
newGetConferencePreferenceResponse :: Int -> GetConferencePreferenceResponse
newGetConferencePreferenceResponse Int
pHttpStatus_ =
  GetConferencePreferenceResponse'
    { $sel:preference:GetConferencePreferenceResponse' :: Maybe ConferencePreference
preference =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetConferencePreferenceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The conference preference.
getConferencePreferenceResponse_preference :: Lens.Lens' GetConferencePreferenceResponse (Prelude.Maybe ConferencePreference)
getConferencePreferenceResponse_preference :: Lens' GetConferencePreferenceResponse (Maybe ConferencePreference)
getConferencePreferenceResponse_preference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConferencePreferenceResponse' {Maybe ConferencePreference
preference :: Maybe ConferencePreference
$sel:preference:GetConferencePreferenceResponse' :: GetConferencePreferenceResponse -> Maybe ConferencePreference
preference} -> Maybe ConferencePreference
preference) (\s :: GetConferencePreferenceResponse
s@GetConferencePreferenceResponse' {} Maybe ConferencePreference
a -> GetConferencePreferenceResponse
s {$sel:preference:GetConferencePreferenceResponse' :: Maybe ConferencePreference
preference = Maybe ConferencePreference
a} :: GetConferencePreferenceResponse)

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

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