{-# 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.Connect.DescribeQuickConnect
-- 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)
--
-- Describes the quick connect.
module Amazonka.Connect.DescribeQuickConnect
  ( -- * Creating a Request
    DescribeQuickConnect (..),
    newDescribeQuickConnect,

    -- * Request Lenses
    describeQuickConnect_instanceId,
    describeQuickConnect_quickConnectId,

    -- * Destructuring the Response
    DescribeQuickConnectResponse (..),
    newDescribeQuickConnectResponse,

    -- * Response Lenses
    describeQuickConnectResponse_quickConnect,
    describeQuickConnectResponse_httpStatus,
  )
where

import Amazonka.Connect.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:/ 'newDescribeQuickConnect' smart constructor.
data DescribeQuickConnect = DescribeQuickConnect'
  { -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    DescribeQuickConnect -> Text
instanceId :: Prelude.Text,
    -- | The identifier for the quick connect.
    DescribeQuickConnect -> Text
quickConnectId :: Prelude.Text
  }
  deriving (DescribeQuickConnect -> DescribeQuickConnect -> Bool
(DescribeQuickConnect -> DescribeQuickConnect -> Bool)
-> (DescribeQuickConnect -> DescribeQuickConnect -> Bool)
-> Eq DescribeQuickConnect
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeQuickConnect -> DescribeQuickConnect -> Bool
$c/= :: DescribeQuickConnect -> DescribeQuickConnect -> Bool
== :: DescribeQuickConnect -> DescribeQuickConnect -> Bool
$c== :: DescribeQuickConnect -> DescribeQuickConnect -> Bool
Prelude.Eq, ReadPrec [DescribeQuickConnect]
ReadPrec DescribeQuickConnect
Int -> ReadS DescribeQuickConnect
ReadS [DescribeQuickConnect]
(Int -> ReadS DescribeQuickConnect)
-> ReadS [DescribeQuickConnect]
-> ReadPrec DescribeQuickConnect
-> ReadPrec [DescribeQuickConnect]
-> Read DescribeQuickConnect
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeQuickConnect]
$creadListPrec :: ReadPrec [DescribeQuickConnect]
readPrec :: ReadPrec DescribeQuickConnect
$creadPrec :: ReadPrec DescribeQuickConnect
readList :: ReadS [DescribeQuickConnect]
$creadList :: ReadS [DescribeQuickConnect]
readsPrec :: Int -> ReadS DescribeQuickConnect
$creadsPrec :: Int -> ReadS DescribeQuickConnect
Prelude.Read, Int -> DescribeQuickConnect -> ShowS
[DescribeQuickConnect] -> ShowS
DescribeQuickConnect -> String
(Int -> DescribeQuickConnect -> ShowS)
-> (DescribeQuickConnect -> String)
-> ([DescribeQuickConnect] -> ShowS)
-> Show DescribeQuickConnect
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeQuickConnect] -> ShowS
$cshowList :: [DescribeQuickConnect] -> ShowS
show :: DescribeQuickConnect -> String
$cshow :: DescribeQuickConnect -> String
showsPrec :: Int -> DescribeQuickConnect -> ShowS
$cshowsPrec :: Int -> DescribeQuickConnect -> ShowS
Prelude.Show, (forall x. DescribeQuickConnect -> Rep DescribeQuickConnect x)
-> (forall x. Rep DescribeQuickConnect x -> DescribeQuickConnect)
-> Generic DescribeQuickConnect
forall x. Rep DescribeQuickConnect x -> DescribeQuickConnect
forall x. DescribeQuickConnect -> Rep DescribeQuickConnect x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeQuickConnect x -> DescribeQuickConnect
$cfrom :: forall x. DescribeQuickConnect -> Rep DescribeQuickConnect x
Prelude.Generic)

-- |
-- Create a value of 'DescribeQuickConnect' 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:
--
-- 'instanceId', 'describeQuickConnect_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'quickConnectId', 'describeQuickConnect_quickConnectId' - The identifier for the quick connect.
newDescribeQuickConnect ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'quickConnectId'
  Prelude.Text ->
  DescribeQuickConnect
newDescribeQuickConnect :: Text -> Text -> DescribeQuickConnect
newDescribeQuickConnect Text
pInstanceId_ Text
pQuickConnectId_ =
  DescribeQuickConnect' :: Text -> Text -> DescribeQuickConnect
DescribeQuickConnect'
    { $sel:instanceId:DescribeQuickConnect' :: Text
instanceId = Text
pInstanceId_,
      $sel:quickConnectId:DescribeQuickConnect' :: Text
quickConnectId = Text
pQuickConnectId_
    }

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
describeQuickConnect_instanceId :: Lens.Lens' DescribeQuickConnect Prelude.Text
describeQuickConnect_instanceId :: (Text -> f Text) -> DescribeQuickConnect -> f DescribeQuickConnect
describeQuickConnect_instanceId = (DescribeQuickConnect -> Text)
-> (DescribeQuickConnect -> Text -> DescribeQuickConnect)
-> Lens DescribeQuickConnect DescribeQuickConnect Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeQuickConnect' {Text
instanceId :: Text
$sel:instanceId:DescribeQuickConnect' :: DescribeQuickConnect -> Text
instanceId} -> Text
instanceId) (\s :: DescribeQuickConnect
s@DescribeQuickConnect' {} Text
a -> DescribeQuickConnect
s {$sel:instanceId:DescribeQuickConnect' :: Text
instanceId = Text
a} :: DescribeQuickConnect)

-- | The identifier for the quick connect.
describeQuickConnect_quickConnectId :: Lens.Lens' DescribeQuickConnect Prelude.Text
describeQuickConnect_quickConnectId :: (Text -> f Text) -> DescribeQuickConnect -> f DescribeQuickConnect
describeQuickConnect_quickConnectId = (DescribeQuickConnect -> Text)
-> (DescribeQuickConnect -> Text -> DescribeQuickConnect)
-> Lens DescribeQuickConnect DescribeQuickConnect Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeQuickConnect' {Text
quickConnectId :: Text
$sel:quickConnectId:DescribeQuickConnect' :: DescribeQuickConnect -> Text
quickConnectId} -> Text
quickConnectId) (\s :: DescribeQuickConnect
s@DescribeQuickConnect' {} Text
a -> DescribeQuickConnect
s {$sel:quickConnectId:DescribeQuickConnect' :: Text
quickConnectId = Text
a} :: DescribeQuickConnect)

instance Core.AWSRequest DescribeQuickConnect where
  type
    AWSResponse DescribeQuickConnect =
      DescribeQuickConnectResponse
  request :: DescribeQuickConnect -> Request DescribeQuickConnect
request = Service -> DescribeQuickConnect -> Request DescribeQuickConnect
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeQuickConnect
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeQuickConnect)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeQuickConnect))
-> Logger
-> Service
-> Proxy DescribeQuickConnect
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeQuickConnect)))
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 QuickConnect -> Int -> DescribeQuickConnectResponse
DescribeQuickConnectResponse'
            (Maybe QuickConnect -> Int -> DescribeQuickConnectResponse)
-> Either String (Maybe QuickConnect)
-> Either String (Int -> DescribeQuickConnectResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe QuickConnect)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"QuickConnect")
            Either String (Int -> DescribeQuickConnectResponse)
-> Either String Int -> Either String DescribeQuickConnectResponse
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 DescribeQuickConnect

instance Prelude.NFData DescribeQuickConnect

instance Core.ToHeaders DescribeQuickConnect where
  toHeaders :: DescribeQuickConnect -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeQuickConnect -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath DescribeQuickConnect where
  toPath :: DescribeQuickConnect -> ByteString
toPath DescribeQuickConnect' {Text
quickConnectId :: Text
instanceId :: Text
$sel:quickConnectId:DescribeQuickConnect' :: DescribeQuickConnect -> Text
$sel:instanceId:DescribeQuickConnect' :: DescribeQuickConnect -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/quick-connects/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
        ByteString
"/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
quickConnectId
      ]

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

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

-- |
-- Create a value of 'DescribeQuickConnectResponse' 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:
--
-- 'quickConnect', 'describeQuickConnectResponse_quickConnect' - Information about the quick connect.
--
-- 'httpStatus', 'describeQuickConnectResponse_httpStatus' - The response's http status code.
newDescribeQuickConnectResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeQuickConnectResponse
newDescribeQuickConnectResponse :: Int -> DescribeQuickConnectResponse
newDescribeQuickConnectResponse Int
pHttpStatus_ =
  DescribeQuickConnectResponse' :: Maybe QuickConnect -> Int -> DescribeQuickConnectResponse
DescribeQuickConnectResponse'
    { $sel:quickConnect:DescribeQuickConnectResponse' :: Maybe QuickConnect
quickConnect =
        Maybe QuickConnect
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeQuickConnectResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the quick connect.
describeQuickConnectResponse_quickConnect :: Lens.Lens' DescribeQuickConnectResponse (Prelude.Maybe QuickConnect)
describeQuickConnectResponse_quickConnect :: (Maybe QuickConnect -> f (Maybe QuickConnect))
-> DescribeQuickConnectResponse -> f DescribeQuickConnectResponse
describeQuickConnectResponse_quickConnect = (DescribeQuickConnectResponse -> Maybe QuickConnect)
-> (DescribeQuickConnectResponse
    -> Maybe QuickConnect -> DescribeQuickConnectResponse)
-> Lens
     DescribeQuickConnectResponse
     DescribeQuickConnectResponse
     (Maybe QuickConnect)
     (Maybe QuickConnect)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeQuickConnectResponse' {Maybe QuickConnect
quickConnect :: Maybe QuickConnect
$sel:quickConnect:DescribeQuickConnectResponse' :: DescribeQuickConnectResponse -> Maybe QuickConnect
quickConnect} -> Maybe QuickConnect
quickConnect) (\s :: DescribeQuickConnectResponse
s@DescribeQuickConnectResponse' {} Maybe QuickConnect
a -> DescribeQuickConnectResponse
s {$sel:quickConnect:DescribeQuickConnectResponse' :: Maybe QuickConnect
quickConnect = Maybe QuickConnect
a} :: DescribeQuickConnectResponse)

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

instance Prelude.NFData DescribeQuickConnectResponse