{-# 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.DescribeRoutingProfile
-- 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 specified routing profile.
module Amazonka.Connect.DescribeRoutingProfile
  ( -- * Creating a Request
    DescribeRoutingProfile (..),
    newDescribeRoutingProfile,

    -- * Request Lenses
    describeRoutingProfile_instanceId,
    describeRoutingProfile_routingProfileId,

    -- * Destructuring the Response
    DescribeRoutingProfileResponse (..),
    newDescribeRoutingProfileResponse,

    -- * Response Lenses
    describeRoutingProfileResponse_routingProfile,
    describeRoutingProfileResponse_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:/ 'newDescribeRoutingProfile' smart constructor.
data DescribeRoutingProfile = DescribeRoutingProfile'
  { -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    DescribeRoutingProfile -> Text
instanceId :: Prelude.Text,
    -- | The identifier of the routing profile.
    DescribeRoutingProfile -> Text
routingProfileId :: Prelude.Text
  }
  deriving (DescribeRoutingProfile -> DescribeRoutingProfile -> Bool
(DescribeRoutingProfile -> DescribeRoutingProfile -> Bool)
-> (DescribeRoutingProfile -> DescribeRoutingProfile -> Bool)
-> Eq DescribeRoutingProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRoutingProfile -> DescribeRoutingProfile -> Bool
$c/= :: DescribeRoutingProfile -> DescribeRoutingProfile -> Bool
== :: DescribeRoutingProfile -> DescribeRoutingProfile -> Bool
$c== :: DescribeRoutingProfile -> DescribeRoutingProfile -> Bool
Prelude.Eq, ReadPrec [DescribeRoutingProfile]
ReadPrec DescribeRoutingProfile
Int -> ReadS DescribeRoutingProfile
ReadS [DescribeRoutingProfile]
(Int -> ReadS DescribeRoutingProfile)
-> ReadS [DescribeRoutingProfile]
-> ReadPrec DescribeRoutingProfile
-> ReadPrec [DescribeRoutingProfile]
-> Read DescribeRoutingProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRoutingProfile]
$creadListPrec :: ReadPrec [DescribeRoutingProfile]
readPrec :: ReadPrec DescribeRoutingProfile
$creadPrec :: ReadPrec DescribeRoutingProfile
readList :: ReadS [DescribeRoutingProfile]
$creadList :: ReadS [DescribeRoutingProfile]
readsPrec :: Int -> ReadS DescribeRoutingProfile
$creadsPrec :: Int -> ReadS DescribeRoutingProfile
Prelude.Read, Int -> DescribeRoutingProfile -> ShowS
[DescribeRoutingProfile] -> ShowS
DescribeRoutingProfile -> String
(Int -> DescribeRoutingProfile -> ShowS)
-> (DescribeRoutingProfile -> String)
-> ([DescribeRoutingProfile] -> ShowS)
-> Show DescribeRoutingProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRoutingProfile] -> ShowS
$cshowList :: [DescribeRoutingProfile] -> ShowS
show :: DescribeRoutingProfile -> String
$cshow :: DescribeRoutingProfile -> String
showsPrec :: Int -> DescribeRoutingProfile -> ShowS
$cshowsPrec :: Int -> DescribeRoutingProfile -> ShowS
Prelude.Show, (forall x. DescribeRoutingProfile -> Rep DescribeRoutingProfile x)
-> (forall x.
    Rep DescribeRoutingProfile x -> DescribeRoutingProfile)
-> Generic DescribeRoutingProfile
forall x. Rep DescribeRoutingProfile x -> DescribeRoutingProfile
forall x. DescribeRoutingProfile -> Rep DescribeRoutingProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeRoutingProfile x -> DescribeRoutingProfile
$cfrom :: forall x. DescribeRoutingProfile -> Rep DescribeRoutingProfile x
Prelude.Generic)

-- |
-- Create a value of 'DescribeRoutingProfile' 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', 'describeRoutingProfile_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'routingProfileId', 'describeRoutingProfile_routingProfileId' - The identifier of the routing profile.
newDescribeRoutingProfile ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'routingProfileId'
  Prelude.Text ->
  DescribeRoutingProfile
newDescribeRoutingProfile :: Text -> Text -> DescribeRoutingProfile
newDescribeRoutingProfile
  Text
pInstanceId_
  Text
pRoutingProfileId_ =
    DescribeRoutingProfile' :: Text -> Text -> DescribeRoutingProfile
DescribeRoutingProfile'
      { $sel:instanceId:DescribeRoutingProfile' :: Text
instanceId = Text
pInstanceId_,
        $sel:routingProfileId:DescribeRoutingProfile' :: Text
routingProfileId = Text
pRoutingProfileId_
      }

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

-- | The identifier of the routing profile.
describeRoutingProfile_routingProfileId :: Lens.Lens' DescribeRoutingProfile Prelude.Text
describeRoutingProfile_routingProfileId :: (Text -> f Text)
-> DescribeRoutingProfile -> f DescribeRoutingProfile
describeRoutingProfile_routingProfileId = (DescribeRoutingProfile -> Text)
-> (DescribeRoutingProfile -> Text -> DescribeRoutingProfile)
-> Lens DescribeRoutingProfile DescribeRoutingProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRoutingProfile' {Text
routingProfileId :: Text
$sel:routingProfileId:DescribeRoutingProfile' :: DescribeRoutingProfile -> Text
routingProfileId} -> Text
routingProfileId) (\s :: DescribeRoutingProfile
s@DescribeRoutingProfile' {} Text
a -> DescribeRoutingProfile
s {$sel:routingProfileId:DescribeRoutingProfile' :: Text
routingProfileId = Text
a} :: DescribeRoutingProfile)

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

instance Prelude.NFData DescribeRoutingProfile

instance Core.ToHeaders DescribeRoutingProfile where
  toHeaders :: DescribeRoutingProfile -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeRoutingProfile -> 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 DescribeRoutingProfile where
  toPath :: DescribeRoutingProfile -> ByteString
toPath DescribeRoutingProfile' {Text
routingProfileId :: Text
instanceId :: Text
$sel:routingProfileId:DescribeRoutingProfile' :: DescribeRoutingProfile -> Text
$sel:instanceId:DescribeRoutingProfile' :: DescribeRoutingProfile -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/routing-profiles/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
        ByteString
"/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
routingProfileId
      ]

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

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

-- |
-- Create a value of 'DescribeRoutingProfileResponse' 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:
--
-- 'routingProfile', 'describeRoutingProfileResponse_routingProfile' - The routing profile.
--
-- 'httpStatus', 'describeRoutingProfileResponse_httpStatus' - The response's http status code.
newDescribeRoutingProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeRoutingProfileResponse
newDescribeRoutingProfileResponse :: Int -> DescribeRoutingProfileResponse
newDescribeRoutingProfileResponse Int
pHttpStatus_ =
  DescribeRoutingProfileResponse' :: Maybe RoutingProfile -> Int -> DescribeRoutingProfileResponse
DescribeRoutingProfileResponse'
    { $sel:routingProfile:DescribeRoutingProfileResponse' :: Maybe RoutingProfile
routingProfile =
        Maybe RoutingProfile
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeRoutingProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The routing profile.
describeRoutingProfileResponse_routingProfile :: Lens.Lens' DescribeRoutingProfileResponse (Prelude.Maybe RoutingProfile)
describeRoutingProfileResponse_routingProfile :: (Maybe RoutingProfile -> f (Maybe RoutingProfile))
-> DescribeRoutingProfileResponse
-> f DescribeRoutingProfileResponse
describeRoutingProfileResponse_routingProfile = (DescribeRoutingProfileResponse -> Maybe RoutingProfile)
-> (DescribeRoutingProfileResponse
    -> Maybe RoutingProfile -> DescribeRoutingProfileResponse)
-> Lens
     DescribeRoutingProfileResponse
     DescribeRoutingProfileResponse
     (Maybe RoutingProfile)
     (Maybe RoutingProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRoutingProfileResponse' {Maybe RoutingProfile
routingProfile :: Maybe RoutingProfile
$sel:routingProfile:DescribeRoutingProfileResponse' :: DescribeRoutingProfileResponse -> Maybe RoutingProfile
routingProfile} -> Maybe RoutingProfile
routingProfile) (\s :: DescribeRoutingProfileResponse
s@DescribeRoutingProfileResponse' {} Maybe RoutingProfile
a -> DescribeRoutingProfileResponse
s {$sel:routingProfile:DescribeRoutingProfileResponse' :: Maybe RoutingProfile
routingProfile = Maybe RoutingProfile
a} :: DescribeRoutingProfileResponse)

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

instance
  Prelude.NFData
    DescribeRoutingProfileResponse