{-# 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.GetConferenceProvider
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets details about a specific conference provider.
module Amazonka.AlexaBusiness.GetConferenceProvider
  ( -- * Creating a Request
    GetConferenceProvider (..),
    newGetConferenceProvider,

    -- * Request Lenses
    getConferenceProvider_conferenceProviderArn,

    -- * Destructuring the Response
    GetConferenceProviderResponse (..),
    newGetConferenceProviderResponse,

    -- * Response Lenses
    getConferenceProviderResponse_conferenceProvider,
    getConferenceProviderResponse_httpStatus,
  )
where

import Amazonka.AlexaBusiness.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetConferenceProvider' smart constructor.
data GetConferenceProvider = GetConferenceProvider'
  { -- | The ARN of the newly created conference provider.
    GetConferenceProvider -> Text
conferenceProviderArn :: Prelude.Text
  }
  deriving (GetConferenceProvider -> GetConferenceProvider -> Bool
(GetConferenceProvider -> GetConferenceProvider -> Bool)
-> (GetConferenceProvider -> GetConferenceProvider -> Bool)
-> Eq GetConferenceProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetConferenceProvider -> GetConferenceProvider -> Bool
$c/= :: GetConferenceProvider -> GetConferenceProvider -> Bool
== :: GetConferenceProvider -> GetConferenceProvider -> Bool
$c== :: GetConferenceProvider -> GetConferenceProvider -> Bool
Prelude.Eq, ReadPrec [GetConferenceProvider]
ReadPrec GetConferenceProvider
Int -> ReadS GetConferenceProvider
ReadS [GetConferenceProvider]
(Int -> ReadS GetConferenceProvider)
-> ReadS [GetConferenceProvider]
-> ReadPrec GetConferenceProvider
-> ReadPrec [GetConferenceProvider]
-> Read GetConferenceProvider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetConferenceProvider]
$creadListPrec :: ReadPrec [GetConferenceProvider]
readPrec :: ReadPrec GetConferenceProvider
$creadPrec :: ReadPrec GetConferenceProvider
readList :: ReadS [GetConferenceProvider]
$creadList :: ReadS [GetConferenceProvider]
readsPrec :: Int -> ReadS GetConferenceProvider
$creadsPrec :: Int -> ReadS GetConferenceProvider
Prelude.Read, Int -> GetConferenceProvider -> ShowS
[GetConferenceProvider] -> ShowS
GetConferenceProvider -> String
(Int -> GetConferenceProvider -> ShowS)
-> (GetConferenceProvider -> String)
-> ([GetConferenceProvider] -> ShowS)
-> Show GetConferenceProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetConferenceProvider] -> ShowS
$cshowList :: [GetConferenceProvider] -> ShowS
show :: GetConferenceProvider -> String
$cshow :: GetConferenceProvider -> String
showsPrec :: Int -> GetConferenceProvider -> ShowS
$cshowsPrec :: Int -> GetConferenceProvider -> ShowS
Prelude.Show, (forall x. GetConferenceProvider -> Rep GetConferenceProvider x)
-> (forall x. Rep GetConferenceProvider x -> GetConferenceProvider)
-> Generic GetConferenceProvider
forall x. Rep GetConferenceProvider x -> GetConferenceProvider
forall x. GetConferenceProvider -> Rep GetConferenceProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetConferenceProvider x -> GetConferenceProvider
$cfrom :: forall x. GetConferenceProvider -> Rep GetConferenceProvider x
Prelude.Generic)

-- |
-- Create a value of 'GetConferenceProvider' 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:
--
-- 'conferenceProviderArn', 'getConferenceProvider_conferenceProviderArn' - The ARN of the newly created conference provider.
newGetConferenceProvider ::
  -- | 'conferenceProviderArn'
  Prelude.Text ->
  GetConferenceProvider
newGetConferenceProvider :: Text -> GetConferenceProvider
newGetConferenceProvider Text
pConferenceProviderArn_ =
  GetConferenceProvider' :: Text -> GetConferenceProvider
GetConferenceProvider'
    { $sel:conferenceProviderArn:GetConferenceProvider' :: Text
conferenceProviderArn =
        Text
pConferenceProviderArn_
    }

-- | The ARN of the newly created conference provider.
getConferenceProvider_conferenceProviderArn :: Lens.Lens' GetConferenceProvider Prelude.Text
getConferenceProvider_conferenceProviderArn :: (Text -> f Text)
-> GetConferenceProvider -> f GetConferenceProvider
getConferenceProvider_conferenceProviderArn = (GetConferenceProvider -> Text)
-> (GetConferenceProvider -> Text -> GetConferenceProvider)
-> Lens GetConferenceProvider GetConferenceProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConferenceProvider' {Text
conferenceProviderArn :: Text
$sel:conferenceProviderArn:GetConferenceProvider' :: GetConferenceProvider -> Text
conferenceProviderArn} -> Text
conferenceProviderArn) (\s :: GetConferenceProvider
s@GetConferenceProvider' {} Text
a -> GetConferenceProvider
s {$sel:conferenceProviderArn:GetConferenceProvider' :: Text
conferenceProviderArn = Text
a} :: GetConferenceProvider)

instance Core.AWSRequest GetConferenceProvider where
  type
    AWSResponse GetConferenceProvider =
      GetConferenceProviderResponse
  request :: GetConferenceProvider -> Request GetConferenceProvider
request = Service -> GetConferenceProvider -> Request GetConferenceProvider
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetConferenceProvider
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetConferenceProvider)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetConferenceProvider))
-> Logger
-> Service
-> Proxy GetConferenceProvider
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetConferenceProvider)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe ConferenceProvider -> Int -> GetConferenceProviderResponse
GetConferenceProviderResponse'
            (Maybe ConferenceProvider -> Int -> GetConferenceProviderResponse)
-> Either String (Maybe ConferenceProvider)
-> Either String (Int -> GetConferenceProviderResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ConferenceProvider)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConferenceProvider")
            Either String (Int -> GetConferenceProviderResponse)
-> Either String Int -> Either String GetConferenceProviderResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetConferenceProvider

instance Prelude.NFData GetConferenceProvider

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

instance Core.ToJSON GetConferenceProvider where
  toJSON :: GetConferenceProvider -> Value
toJSON GetConferenceProvider' {Text
conferenceProviderArn :: Text
$sel:conferenceProviderArn:GetConferenceProvider' :: GetConferenceProvider -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ConferenceProviderArn"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
conferenceProviderArn
              )
          ]
      )

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

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

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

-- |
-- Create a value of 'GetConferenceProviderResponse' 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:
--
-- 'conferenceProvider', 'getConferenceProviderResponse_conferenceProvider' - The conference provider.
--
-- 'httpStatus', 'getConferenceProviderResponse_httpStatus' - The response's http status code.
newGetConferenceProviderResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetConferenceProviderResponse
newGetConferenceProviderResponse :: Int -> GetConferenceProviderResponse
newGetConferenceProviderResponse Int
pHttpStatus_ =
  GetConferenceProviderResponse' :: Maybe ConferenceProvider -> Int -> GetConferenceProviderResponse
GetConferenceProviderResponse'
    { $sel:conferenceProvider:GetConferenceProviderResponse' :: Maybe ConferenceProvider
conferenceProvider =
        Maybe ConferenceProvider
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetConferenceProviderResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The conference provider.
getConferenceProviderResponse_conferenceProvider :: Lens.Lens' GetConferenceProviderResponse (Prelude.Maybe ConferenceProvider)
getConferenceProviderResponse_conferenceProvider :: (Maybe ConferenceProvider -> f (Maybe ConferenceProvider))
-> GetConferenceProviderResponse -> f GetConferenceProviderResponse
getConferenceProviderResponse_conferenceProvider = (GetConferenceProviderResponse -> Maybe ConferenceProvider)
-> (GetConferenceProviderResponse
    -> Maybe ConferenceProvider -> GetConferenceProviderResponse)
-> Lens
     GetConferenceProviderResponse
     GetConferenceProviderResponse
     (Maybe ConferenceProvider)
     (Maybe ConferenceProvider)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConferenceProviderResponse' {Maybe ConferenceProvider
conferenceProvider :: Maybe ConferenceProvider
$sel:conferenceProvider:GetConferenceProviderResponse' :: GetConferenceProviderResponse -> Maybe ConferenceProvider
conferenceProvider} -> Maybe ConferenceProvider
conferenceProvider) (\s :: GetConferenceProviderResponse
s@GetConferenceProviderResponse' {} Maybe ConferenceProvider
a -> GetConferenceProviderResponse
s {$sel:conferenceProvider:GetConferenceProviderResponse' :: Maybe ConferenceProvider
conferenceProvider = Maybe ConferenceProvider
a} :: GetConferenceProviderResponse)

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

instance Prelude.NFData GetConferenceProviderResponse