{-# 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.CloudWatchEvents.DescribeConnection
-- 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)
--
-- Retrieves details about a connection.
module Amazonka.CloudWatchEvents.DescribeConnection
  ( -- * Creating a Request
    DescribeConnection (..),
    newDescribeConnection,

    -- * Request Lenses
    describeConnection_name,

    -- * Destructuring the Response
    DescribeConnectionResponse (..),
    newDescribeConnectionResponse,

    -- * Response Lenses
    describeConnectionResponse_creationTime,
    describeConnectionResponse_lastModifiedTime,
    describeConnectionResponse_name,
    describeConnectionResponse_authParameters,
    describeConnectionResponse_lastAuthorizedTime,
    describeConnectionResponse_authorizationType,
    describeConnectionResponse_connectionArn,
    describeConnectionResponse_stateReason,
    describeConnectionResponse_secretArn,
    describeConnectionResponse_description,
    describeConnectionResponse_connectionState,
    describeConnectionResponse_httpStatus,
  )
where

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

-- |
-- Create a value of 'DescribeConnection' 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:
--
-- 'name', 'describeConnection_name' - The name of the connection to retrieve.
newDescribeConnection ::
  -- | 'name'
  Prelude.Text ->
  DescribeConnection
newDescribeConnection :: Text -> DescribeConnection
newDescribeConnection Text
pName_ =
  DescribeConnection' :: Text -> DescribeConnection
DescribeConnection' {$sel:name:DescribeConnection' :: Text
name = Text
pName_}

-- | The name of the connection to retrieve.
describeConnection_name :: Lens.Lens' DescribeConnection Prelude.Text
describeConnection_name :: (Text -> f Text) -> DescribeConnection -> f DescribeConnection
describeConnection_name = (DescribeConnection -> Text)
-> (DescribeConnection -> Text -> DescribeConnection)
-> Lens DescribeConnection DescribeConnection Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnection' {Text
name :: Text
$sel:name:DescribeConnection' :: DescribeConnection -> Text
name} -> Text
name) (\s :: DescribeConnection
s@DescribeConnection' {} Text
a -> DescribeConnection
s {$sel:name:DescribeConnection' :: Text
name = Text
a} :: DescribeConnection)

instance Core.AWSRequest DescribeConnection where
  type
    AWSResponse DescribeConnection =
      DescribeConnectionResponse
  request :: DescribeConnection -> Request DescribeConnection
request = Service -> DescribeConnection -> Request DescribeConnection
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeConnection
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeConnection)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeConnection))
-> Logger
-> Service
-> Proxy DescribeConnection
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeConnection)))
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 POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ConnectionAuthResponseParameters
-> Maybe POSIX
-> Maybe ConnectionAuthorizationType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ConnectionState
-> Int
-> DescribeConnectionResponse
DescribeConnectionResponse'
            (Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe ConnectionAuthResponseParameters
 -> Maybe POSIX
 -> Maybe ConnectionAuthorizationType
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ConnectionState
 -> Int
 -> DescribeConnectionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe ConnectionAuthResponseParameters
      -> Maybe POSIX
      -> Maybe ConnectionAuthorizationType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Int
      -> DescribeConnectionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationTime")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe ConnectionAuthResponseParameters
   -> Maybe POSIX
   -> Maybe ConnectionAuthorizationType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Int
   -> DescribeConnectionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe ConnectionAuthResponseParameters
      -> Maybe POSIX
      -> Maybe ConnectionAuthorizationType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Int
      -> DescribeConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastModifiedTime")
            Either
  String
  (Maybe Text
   -> Maybe ConnectionAuthResponseParameters
   -> Maybe POSIX
   -> Maybe ConnectionAuthorizationType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Int
   -> DescribeConnectionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ConnectionAuthResponseParameters
      -> Maybe POSIX
      -> Maybe ConnectionAuthorizationType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Int
      -> DescribeConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Name")
            Either
  String
  (Maybe ConnectionAuthResponseParameters
   -> Maybe POSIX
   -> Maybe ConnectionAuthorizationType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Int
   -> DescribeConnectionResponse)
-> Either String (Maybe ConnectionAuthResponseParameters)
-> Either
     String
     (Maybe POSIX
      -> Maybe ConnectionAuthorizationType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Int
      -> DescribeConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe ConnectionAuthResponseParameters)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AuthParameters")
            Either
  String
  (Maybe POSIX
   -> Maybe ConnectionAuthorizationType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Int
   -> DescribeConnectionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe ConnectionAuthorizationType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Int
      -> DescribeConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastAuthorizedTime")
            Either
  String
  (Maybe ConnectionAuthorizationType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Int
   -> DescribeConnectionResponse)
-> Either String (Maybe ConnectionAuthorizationType)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Int
      -> DescribeConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ConnectionAuthorizationType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AuthorizationType")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Int
   -> DescribeConnectionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Int
      -> DescribeConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConnectionArn")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Int
   -> DescribeConnectionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Int
      -> DescribeConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"StateReason")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Int
   -> DescribeConnectionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ConnectionState -> Int -> DescribeConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SecretArn")
            Either
  String
  (Maybe Text
   -> Maybe ConnectionState -> Int -> DescribeConnectionResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe ConnectionState -> Int -> DescribeConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Description")
            Either
  String (Maybe ConnectionState -> Int -> DescribeConnectionResponse)
-> Either String (Maybe ConnectionState)
-> Either String (Int -> DescribeConnectionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ConnectionState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConnectionState")
            Either String (Int -> DescribeConnectionResponse)
-> Either String Int -> Either String DescribeConnectionResponse
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 DescribeConnection

instance Prelude.NFData DescribeConnection

instance Core.ToHeaders DescribeConnection where
  toHeaders :: DescribeConnection -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeConnection -> 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
"AWSEvents.DescribeConnection" ::
                          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 DescribeConnection where
  toJSON :: DescribeConnection -> Value
toJSON DescribeConnection' {Text
name :: Text
$sel:name:DescribeConnection' :: DescribeConnection -> 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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
      )

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

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

-- | /See:/ 'newDescribeConnectionResponse' smart constructor.
data DescribeConnectionResponse = DescribeConnectionResponse'
  { -- | A time stamp for the time that the connection was created.
    DescribeConnectionResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | A time stamp for the time that the connection was last modified.
    DescribeConnectionResponse -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the connection retrieved.
    DescribeConnectionResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The parameters to use for authorization for the connection.
    DescribeConnectionResponse
-> Maybe ConnectionAuthResponseParameters
authParameters :: Prelude.Maybe ConnectionAuthResponseParameters,
    -- | A time stamp for the time that the connection was last authorized.
    DescribeConnectionResponse -> Maybe POSIX
lastAuthorizedTime :: Prelude.Maybe Core.POSIX,
    -- | The type of authorization specified for the connection.
    DescribeConnectionResponse -> Maybe ConnectionAuthorizationType
authorizationType :: Prelude.Maybe ConnectionAuthorizationType,
    -- | The ARN of the connection retrieved.
    DescribeConnectionResponse -> Maybe Text
connectionArn :: Prelude.Maybe Prelude.Text,
    -- | The reason that the connection is in the current connection state.
    DescribeConnectionResponse -> Maybe Text
stateReason :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the secret created from the authorization parameters
    -- specified for the connection.
    DescribeConnectionResponse -> Maybe Text
secretArn :: Prelude.Maybe Prelude.Text,
    -- | The description for the connection retrieved.
    DescribeConnectionResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The state of the connection retrieved.
    DescribeConnectionResponse -> Maybe ConnectionState
connectionState :: Prelude.Maybe ConnectionState,
    -- | The response's http status code.
    DescribeConnectionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeConnectionResponse -> DescribeConnectionResponse -> Bool
(DescribeConnectionResponse -> DescribeConnectionResponse -> Bool)
-> (DescribeConnectionResponse
    -> DescribeConnectionResponse -> Bool)
-> Eq DescribeConnectionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeConnectionResponse -> DescribeConnectionResponse -> Bool
$c/= :: DescribeConnectionResponse -> DescribeConnectionResponse -> Bool
== :: DescribeConnectionResponse -> DescribeConnectionResponse -> Bool
$c== :: DescribeConnectionResponse -> DescribeConnectionResponse -> Bool
Prelude.Eq, ReadPrec [DescribeConnectionResponse]
ReadPrec DescribeConnectionResponse
Int -> ReadS DescribeConnectionResponse
ReadS [DescribeConnectionResponse]
(Int -> ReadS DescribeConnectionResponse)
-> ReadS [DescribeConnectionResponse]
-> ReadPrec DescribeConnectionResponse
-> ReadPrec [DescribeConnectionResponse]
-> Read DescribeConnectionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeConnectionResponse]
$creadListPrec :: ReadPrec [DescribeConnectionResponse]
readPrec :: ReadPrec DescribeConnectionResponse
$creadPrec :: ReadPrec DescribeConnectionResponse
readList :: ReadS [DescribeConnectionResponse]
$creadList :: ReadS [DescribeConnectionResponse]
readsPrec :: Int -> ReadS DescribeConnectionResponse
$creadsPrec :: Int -> ReadS DescribeConnectionResponse
Prelude.Read, Int -> DescribeConnectionResponse -> ShowS
[DescribeConnectionResponse] -> ShowS
DescribeConnectionResponse -> String
(Int -> DescribeConnectionResponse -> ShowS)
-> (DescribeConnectionResponse -> String)
-> ([DescribeConnectionResponse] -> ShowS)
-> Show DescribeConnectionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeConnectionResponse] -> ShowS
$cshowList :: [DescribeConnectionResponse] -> ShowS
show :: DescribeConnectionResponse -> String
$cshow :: DescribeConnectionResponse -> String
showsPrec :: Int -> DescribeConnectionResponse -> ShowS
$cshowsPrec :: Int -> DescribeConnectionResponse -> ShowS
Prelude.Show, (forall x.
 DescribeConnectionResponse -> Rep DescribeConnectionResponse x)
-> (forall x.
    Rep DescribeConnectionResponse x -> DescribeConnectionResponse)
-> Generic DescribeConnectionResponse
forall x.
Rep DescribeConnectionResponse x -> DescribeConnectionResponse
forall x.
DescribeConnectionResponse -> Rep DescribeConnectionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeConnectionResponse x -> DescribeConnectionResponse
$cfrom :: forall x.
DescribeConnectionResponse -> Rep DescribeConnectionResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeConnectionResponse' 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:
--
-- 'creationTime', 'describeConnectionResponse_creationTime' - A time stamp for the time that the connection was created.
--
-- 'lastModifiedTime', 'describeConnectionResponse_lastModifiedTime' - A time stamp for the time that the connection was last modified.
--
-- 'name', 'describeConnectionResponse_name' - The name of the connection retrieved.
--
-- 'authParameters', 'describeConnectionResponse_authParameters' - The parameters to use for authorization for the connection.
--
-- 'lastAuthorizedTime', 'describeConnectionResponse_lastAuthorizedTime' - A time stamp for the time that the connection was last authorized.
--
-- 'authorizationType', 'describeConnectionResponse_authorizationType' - The type of authorization specified for the connection.
--
-- 'connectionArn', 'describeConnectionResponse_connectionArn' - The ARN of the connection retrieved.
--
-- 'stateReason', 'describeConnectionResponse_stateReason' - The reason that the connection is in the current connection state.
--
-- 'secretArn', 'describeConnectionResponse_secretArn' - The ARN of the secret created from the authorization parameters
-- specified for the connection.
--
-- 'description', 'describeConnectionResponse_description' - The description for the connection retrieved.
--
-- 'connectionState', 'describeConnectionResponse_connectionState' - The state of the connection retrieved.
--
-- 'httpStatus', 'describeConnectionResponse_httpStatus' - The response's http status code.
newDescribeConnectionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeConnectionResponse
newDescribeConnectionResponse :: Int -> DescribeConnectionResponse
newDescribeConnectionResponse Int
pHttpStatus_ =
  DescribeConnectionResponse' :: Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe ConnectionAuthResponseParameters
-> Maybe POSIX
-> Maybe ConnectionAuthorizationType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ConnectionState
-> Int
-> DescribeConnectionResponse
DescribeConnectionResponse'
    { $sel:creationTime:DescribeConnectionResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:DescribeConnectionResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeConnectionResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authParameters:DescribeConnectionResponse' :: Maybe ConnectionAuthResponseParameters
authParameters = Maybe ConnectionAuthResponseParameters
forall a. Maybe a
Prelude.Nothing,
      $sel:lastAuthorizedTime:DescribeConnectionResponse' :: Maybe POSIX
lastAuthorizedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:authorizationType:DescribeConnectionResponse' :: Maybe ConnectionAuthorizationType
authorizationType = Maybe ConnectionAuthorizationType
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionArn:DescribeConnectionResponse' :: Maybe Text
connectionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stateReason:DescribeConnectionResponse' :: Maybe Text
stateReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:secretArn:DescribeConnectionResponse' :: Maybe Text
secretArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:DescribeConnectionResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionState:DescribeConnectionResponse' :: Maybe ConnectionState
connectionState = Maybe ConnectionState
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeConnectionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A time stamp for the time that the connection was created.
describeConnectionResponse_creationTime :: Lens.Lens' DescribeConnectionResponse (Prelude.Maybe Prelude.UTCTime)
describeConnectionResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeConnectionResponse -> f DescribeConnectionResponse
describeConnectionResponse_creationTime = (DescribeConnectionResponse -> Maybe POSIX)
-> (DescribeConnectionResponse
    -> Maybe POSIX -> DescribeConnectionResponse)
-> Lens
     DescribeConnectionResponse
     DescribeConnectionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DescribeConnectionResponse' :: DescribeConnectionResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DescribeConnectionResponse
s@DescribeConnectionResponse' {} Maybe POSIX
a -> DescribeConnectionResponse
s {$sel:creationTime:DescribeConnectionResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DescribeConnectionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeConnectionResponse -> f DescribeConnectionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeConnectionResponse
-> f DescribeConnectionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A time stamp for the time that the connection was last modified.
describeConnectionResponse_lastModifiedTime :: Lens.Lens' DescribeConnectionResponse (Prelude.Maybe Prelude.UTCTime)
describeConnectionResponse_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeConnectionResponse -> f DescribeConnectionResponse
describeConnectionResponse_lastModifiedTime = (DescribeConnectionResponse -> Maybe POSIX)
-> (DescribeConnectionResponse
    -> Maybe POSIX -> DescribeConnectionResponse)
-> Lens
     DescribeConnectionResponse
     DescribeConnectionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:DescribeConnectionResponse' :: DescribeConnectionResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: DescribeConnectionResponse
s@DescribeConnectionResponse' {} Maybe POSIX
a -> DescribeConnectionResponse
s {$sel:lastModifiedTime:DescribeConnectionResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: DescribeConnectionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeConnectionResponse -> f DescribeConnectionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeConnectionResponse
-> f DescribeConnectionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the connection retrieved.
describeConnectionResponse_name :: Lens.Lens' DescribeConnectionResponse (Prelude.Maybe Prelude.Text)
describeConnectionResponse_name :: (Maybe Text -> f (Maybe Text))
-> DescribeConnectionResponse -> f DescribeConnectionResponse
describeConnectionResponse_name = (DescribeConnectionResponse -> Maybe Text)
-> (DescribeConnectionResponse
    -> Maybe Text -> DescribeConnectionResponse)
-> Lens
     DescribeConnectionResponse
     DescribeConnectionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionResponse' {Maybe Text
name :: Maybe Text
$sel:name:DescribeConnectionResponse' :: DescribeConnectionResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: DescribeConnectionResponse
s@DescribeConnectionResponse' {} Maybe Text
a -> DescribeConnectionResponse
s {$sel:name:DescribeConnectionResponse' :: Maybe Text
name = Maybe Text
a} :: DescribeConnectionResponse)

-- | The parameters to use for authorization for the connection.
describeConnectionResponse_authParameters :: Lens.Lens' DescribeConnectionResponse (Prelude.Maybe ConnectionAuthResponseParameters)
describeConnectionResponse_authParameters :: (Maybe ConnectionAuthResponseParameters
 -> f (Maybe ConnectionAuthResponseParameters))
-> DescribeConnectionResponse -> f DescribeConnectionResponse
describeConnectionResponse_authParameters = (DescribeConnectionResponse
 -> Maybe ConnectionAuthResponseParameters)
-> (DescribeConnectionResponse
    -> Maybe ConnectionAuthResponseParameters
    -> DescribeConnectionResponse)
-> Lens
     DescribeConnectionResponse
     DescribeConnectionResponse
     (Maybe ConnectionAuthResponseParameters)
     (Maybe ConnectionAuthResponseParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionResponse' {Maybe ConnectionAuthResponseParameters
authParameters :: Maybe ConnectionAuthResponseParameters
$sel:authParameters:DescribeConnectionResponse' :: DescribeConnectionResponse
-> Maybe ConnectionAuthResponseParameters
authParameters} -> Maybe ConnectionAuthResponseParameters
authParameters) (\s :: DescribeConnectionResponse
s@DescribeConnectionResponse' {} Maybe ConnectionAuthResponseParameters
a -> DescribeConnectionResponse
s {$sel:authParameters:DescribeConnectionResponse' :: Maybe ConnectionAuthResponseParameters
authParameters = Maybe ConnectionAuthResponseParameters
a} :: DescribeConnectionResponse)

-- | A time stamp for the time that the connection was last authorized.
describeConnectionResponse_lastAuthorizedTime :: Lens.Lens' DescribeConnectionResponse (Prelude.Maybe Prelude.UTCTime)
describeConnectionResponse_lastAuthorizedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeConnectionResponse -> f DescribeConnectionResponse
describeConnectionResponse_lastAuthorizedTime = (DescribeConnectionResponse -> Maybe POSIX)
-> (DescribeConnectionResponse
    -> Maybe POSIX -> DescribeConnectionResponse)
-> Lens
     DescribeConnectionResponse
     DescribeConnectionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionResponse' {Maybe POSIX
lastAuthorizedTime :: Maybe POSIX
$sel:lastAuthorizedTime:DescribeConnectionResponse' :: DescribeConnectionResponse -> Maybe POSIX
lastAuthorizedTime} -> Maybe POSIX
lastAuthorizedTime) (\s :: DescribeConnectionResponse
s@DescribeConnectionResponse' {} Maybe POSIX
a -> DescribeConnectionResponse
s {$sel:lastAuthorizedTime:DescribeConnectionResponse' :: Maybe POSIX
lastAuthorizedTime = Maybe POSIX
a} :: DescribeConnectionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeConnectionResponse -> f DescribeConnectionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeConnectionResponse
-> f DescribeConnectionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The type of authorization specified for the connection.
describeConnectionResponse_authorizationType :: Lens.Lens' DescribeConnectionResponse (Prelude.Maybe ConnectionAuthorizationType)
describeConnectionResponse_authorizationType :: (Maybe ConnectionAuthorizationType
 -> f (Maybe ConnectionAuthorizationType))
-> DescribeConnectionResponse -> f DescribeConnectionResponse
describeConnectionResponse_authorizationType = (DescribeConnectionResponse -> Maybe ConnectionAuthorizationType)
-> (DescribeConnectionResponse
    -> Maybe ConnectionAuthorizationType -> DescribeConnectionResponse)
-> Lens
     DescribeConnectionResponse
     DescribeConnectionResponse
     (Maybe ConnectionAuthorizationType)
     (Maybe ConnectionAuthorizationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionResponse' {Maybe ConnectionAuthorizationType
authorizationType :: Maybe ConnectionAuthorizationType
$sel:authorizationType:DescribeConnectionResponse' :: DescribeConnectionResponse -> Maybe ConnectionAuthorizationType
authorizationType} -> Maybe ConnectionAuthorizationType
authorizationType) (\s :: DescribeConnectionResponse
s@DescribeConnectionResponse' {} Maybe ConnectionAuthorizationType
a -> DescribeConnectionResponse
s {$sel:authorizationType:DescribeConnectionResponse' :: Maybe ConnectionAuthorizationType
authorizationType = Maybe ConnectionAuthorizationType
a} :: DescribeConnectionResponse)

-- | The ARN of the connection retrieved.
describeConnectionResponse_connectionArn :: Lens.Lens' DescribeConnectionResponse (Prelude.Maybe Prelude.Text)
describeConnectionResponse_connectionArn :: (Maybe Text -> f (Maybe Text))
-> DescribeConnectionResponse -> f DescribeConnectionResponse
describeConnectionResponse_connectionArn = (DescribeConnectionResponse -> Maybe Text)
-> (DescribeConnectionResponse
    -> Maybe Text -> DescribeConnectionResponse)
-> Lens
     DescribeConnectionResponse
     DescribeConnectionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionResponse' {Maybe Text
connectionArn :: Maybe Text
$sel:connectionArn:DescribeConnectionResponse' :: DescribeConnectionResponse -> Maybe Text
connectionArn} -> Maybe Text
connectionArn) (\s :: DescribeConnectionResponse
s@DescribeConnectionResponse' {} Maybe Text
a -> DescribeConnectionResponse
s {$sel:connectionArn:DescribeConnectionResponse' :: Maybe Text
connectionArn = Maybe Text
a} :: DescribeConnectionResponse)

-- | The reason that the connection is in the current connection state.
describeConnectionResponse_stateReason :: Lens.Lens' DescribeConnectionResponse (Prelude.Maybe Prelude.Text)
describeConnectionResponse_stateReason :: (Maybe Text -> f (Maybe Text))
-> DescribeConnectionResponse -> f DescribeConnectionResponse
describeConnectionResponse_stateReason = (DescribeConnectionResponse -> Maybe Text)
-> (DescribeConnectionResponse
    -> Maybe Text -> DescribeConnectionResponse)
-> Lens
     DescribeConnectionResponse
     DescribeConnectionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionResponse' {Maybe Text
stateReason :: Maybe Text
$sel:stateReason:DescribeConnectionResponse' :: DescribeConnectionResponse -> Maybe Text
stateReason} -> Maybe Text
stateReason) (\s :: DescribeConnectionResponse
s@DescribeConnectionResponse' {} Maybe Text
a -> DescribeConnectionResponse
s {$sel:stateReason:DescribeConnectionResponse' :: Maybe Text
stateReason = Maybe Text
a} :: DescribeConnectionResponse)

-- | The ARN of the secret created from the authorization parameters
-- specified for the connection.
describeConnectionResponse_secretArn :: Lens.Lens' DescribeConnectionResponse (Prelude.Maybe Prelude.Text)
describeConnectionResponse_secretArn :: (Maybe Text -> f (Maybe Text))
-> DescribeConnectionResponse -> f DescribeConnectionResponse
describeConnectionResponse_secretArn = (DescribeConnectionResponse -> Maybe Text)
-> (DescribeConnectionResponse
    -> Maybe Text -> DescribeConnectionResponse)
-> Lens
     DescribeConnectionResponse
     DescribeConnectionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionResponse' {Maybe Text
secretArn :: Maybe Text
$sel:secretArn:DescribeConnectionResponse' :: DescribeConnectionResponse -> Maybe Text
secretArn} -> Maybe Text
secretArn) (\s :: DescribeConnectionResponse
s@DescribeConnectionResponse' {} Maybe Text
a -> DescribeConnectionResponse
s {$sel:secretArn:DescribeConnectionResponse' :: Maybe Text
secretArn = Maybe Text
a} :: DescribeConnectionResponse)

-- | The description for the connection retrieved.
describeConnectionResponse_description :: Lens.Lens' DescribeConnectionResponse (Prelude.Maybe Prelude.Text)
describeConnectionResponse_description :: (Maybe Text -> f (Maybe Text))
-> DescribeConnectionResponse -> f DescribeConnectionResponse
describeConnectionResponse_description = (DescribeConnectionResponse -> Maybe Text)
-> (DescribeConnectionResponse
    -> Maybe Text -> DescribeConnectionResponse)
-> Lens
     DescribeConnectionResponse
     DescribeConnectionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionResponse' {Maybe Text
description :: Maybe Text
$sel:description:DescribeConnectionResponse' :: DescribeConnectionResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: DescribeConnectionResponse
s@DescribeConnectionResponse' {} Maybe Text
a -> DescribeConnectionResponse
s {$sel:description:DescribeConnectionResponse' :: Maybe Text
description = Maybe Text
a} :: DescribeConnectionResponse)

-- | The state of the connection retrieved.
describeConnectionResponse_connectionState :: Lens.Lens' DescribeConnectionResponse (Prelude.Maybe ConnectionState)
describeConnectionResponse_connectionState :: (Maybe ConnectionState -> f (Maybe ConnectionState))
-> DescribeConnectionResponse -> f DescribeConnectionResponse
describeConnectionResponse_connectionState = (DescribeConnectionResponse -> Maybe ConnectionState)
-> (DescribeConnectionResponse
    -> Maybe ConnectionState -> DescribeConnectionResponse)
-> Lens
     DescribeConnectionResponse
     DescribeConnectionResponse
     (Maybe ConnectionState)
     (Maybe ConnectionState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionResponse' {Maybe ConnectionState
connectionState :: Maybe ConnectionState
$sel:connectionState:DescribeConnectionResponse' :: DescribeConnectionResponse -> Maybe ConnectionState
connectionState} -> Maybe ConnectionState
connectionState) (\s :: DescribeConnectionResponse
s@DescribeConnectionResponse' {} Maybe ConnectionState
a -> DescribeConnectionResponse
s {$sel:connectionState:DescribeConnectionResponse' :: Maybe ConnectionState
connectionState = Maybe ConnectionState
a} :: DescribeConnectionResponse)

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

instance Prelude.NFData DescribeConnectionResponse