{-# 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.DescribeApiDestination
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves details about an API destination.
module Amazonka.CloudWatchEvents.DescribeApiDestination
  ( -- * Creating a Request
    DescribeApiDestination (..),
    newDescribeApiDestination,

    -- * Request Lenses
    describeApiDestination_name,

    -- * Destructuring the Response
    DescribeApiDestinationResponse (..),
    newDescribeApiDestinationResponse,

    -- * Response Lenses
    describeApiDestinationResponse_apiDestinationArn,
    describeApiDestinationResponse_apiDestinationState,
    describeApiDestinationResponse_connectionArn,
    describeApiDestinationResponse_creationTime,
    describeApiDestinationResponse_description,
    describeApiDestinationResponse_httpMethod,
    describeApiDestinationResponse_invocationEndpoint,
    describeApiDestinationResponse_invocationRateLimitPerSecond,
    describeApiDestinationResponse_lastModifiedTime,
    describeApiDestinationResponse_name,
    describeApiDestinationResponse_httpStatus,
  )
where

import Amazonka.CloudWatchEvents.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeApiDestination' smart constructor.
data DescribeApiDestination = DescribeApiDestination'
  { -- | The name of the API destination to retrieve.
    DescribeApiDestination -> Text
name :: Prelude.Text
  }
  deriving (DescribeApiDestination -> DescribeApiDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeApiDestination -> DescribeApiDestination -> Bool
$c/= :: DescribeApiDestination -> DescribeApiDestination -> Bool
== :: DescribeApiDestination -> DescribeApiDestination -> Bool
$c== :: DescribeApiDestination -> DescribeApiDestination -> Bool
Prelude.Eq, ReadPrec [DescribeApiDestination]
ReadPrec DescribeApiDestination
Int -> ReadS DescribeApiDestination
ReadS [DescribeApiDestination]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeApiDestination]
$creadListPrec :: ReadPrec [DescribeApiDestination]
readPrec :: ReadPrec DescribeApiDestination
$creadPrec :: ReadPrec DescribeApiDestination
readList :: ReadS [DescribeApiDestination]
$creadList :: ReadS [DescribeApiDestination]
readsPrec :: Int -> ReadS DescribeApiDestination
$creadsPrec :: Int -> ReadS DescribeApiDestination
Prelude.Read, Int -> DescribeApiDestination -> ShowS
[DescribeApiDestination] -> ShowS
DescribeApiDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeApiDestination] -> ShowS
$cshowList :: [DescribeApiDestination] -> ShowS
show :: DescribeApiDestination -> String
$cshow :: DescribeApiDestination -> String
showsPrec :: Int -> DescribeApiDestination -> ShowS
$cshowsPrec :: Int -> DescribeApiDestination -> ShowS
Prelude.Show, forall x. Rep DescribeApiDestination x -> DescribeApiDestination
forall x. DescribeApiDestination -> Rep DescribeApiDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeApiDestination x -> DescribeApiDestination
$cfrom :: forall x. DescribeApiDestination -> Rep DescribeApiDestination x
Prelude.Generic)

-- |
-- Create a value of 'DescribeApiDestination' 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', 'describeApiDestination_name' - The name of the API destination to retrieve.
newDescribeApiDestination ::
  -- | 'name'
  Prelude.Text ->
  DescribeApiDestination
newDescribeApiDestination :: Text -> DescribeApiDestination
newDescribeApiDestination Text
pName_ =
  DescribeApiDestination' {$sel:name:DescribeApiDestination' :: Text
name = Text
pName_}

-- | The name of the API destination to retrieve.
describeApiDestination_name :: Lens.Lens' DescribeApiDestination Prelude.Text
describeApiDestination_name :: Lens' DescribeApiDestination Text
describeApiDestination_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApiDestination' {Text
name :: Text
$sel:name:DescribeApiDestination' :: DescribeApiDestination -> Text
name} -> Text
name) (\s :: DescribeApiDestination
s@DescribeApiDestination' {} Text
a -> DescribeApiDestination
s {$sel:name:DescribeApiDestination' :: Text
name = Text
a} :: DescribeApiDestination)

instance Core.AWSRequest DescribeApiDestination where
  type
    AWSResponse DescribeApiDestination =
      DescribeApiDestinationResponse
  request :: (Service -> Service)
-> DescribeApiDestination -> Request DescribeApiDestination
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeApiDestination
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeApiDestination)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe ApiDestinationState
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe ApiDestinationHttpMethod
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Int
-> DescribeApiDestinationResponse
DescribeApiDestinationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ApiDestinationArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ApiDestinationState")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ConnectionArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"HttpMethod")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"InvocationEndpoint")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"InvocationRateLimitPerSecond")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastModifiedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeApiDestination where
  hashWithSalt :: Int -> DescribeApiDestination -> Int
hashWithSalt Int
_salt DescribeApiDestination' {Text
name :: Text
$sel:name:DescribeApiDestination' :: DescribeApiDestination -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData DescribeApiDestination where
  rnf :: DescribeApiDestination -> ()
rnf DescribeApiDestination' {Text
name :: Text
$sel:name:DescribeApiDestination' :: DescribeApiDestination -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
name

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

instance Data.ToJSON DescribeApiDestination where
  toJSON :: DescribeApiDestination -> Value
toJSON DescribeApiDestination' {Text
name :: Text
$sel:name:DescribeApiDestination' :: DescribeApiDestination -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)]
      )

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

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

-- | /See:/ 'newDescribeApiDestinationResponse' smart constructor.
data DescribeApiDestinationResponse = DescribeApiDestinationResponse'
  { -- | The ARN of the API destination retrieved.
    DescribeApiDestinationResponse -> Maybe Text
apiDestinationArn :: Prelude.Maybe Prelude.Text,
    -- | The state of the API destination retrieved.
    DescribeApiDestinationResponse -> Maybe ApiDestinationState
apiDestinationState :: Prelude.Maybe ApiDestinationState,
    -- | The ARN of the connection specified for the API destination retrieved.
    DescribeApiDestinationResponse -> Maybe Text
connectionArn :: Prelude.Maybe Prelude.Text,
    -- | A time stamp for the time that the API destination was created.
    DescribeApiDestinationResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
    -- | The description for the API destination retrieved.
    DescribeApiDestinationResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The method to use to connect to the HTTP endpoint.
    DescribeApiDestinationResponse -> Maybe ApiDestinationHttpMethod
httpMethod :: Prelude.Maybe ApiDestinationHttpMethod,
    -- | The URL to use to connect to the HTTP endpoint.
    DescribeApiDestinationResponse -> Maybe Text
invocationEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of invocations per second to specified for the API
    -- destination. Note that if you set the invocation rate maximum to a value
    -- lower the rate necessary to send all events received on to the
    -- destination HTTP endpoint, some events may not be delivered within the
    -- 24-hour retry window. If you plan to set the rate lower than the rate
    -- necessary to deliver all events, consider using a dead-letter queue to
    -- catch events that are not delivered within 24 hours.
    DescribeApiDestinationResponse -> Maybe Natural
invocationRateLimitPerSecond :: Prelude.Maybe Prelude.Natural,
    -- | A time stamp for the time that the API destination was last modified.
    DescribeApiDestinationResponse -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Data.POSIX,
    -- | The name of the API destination retrieved.
    DescribeApiDestinationResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeApiDestinationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeApiDestinationResponse
-> DescribeApiDestinationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeApiDestinationResponse
-> DescribeApiDestinationResponse -> Bool
$c/= :: DescribeApiDestinationResponse
-> DescribeApiDestinationResponse -> Bool
== :: DescribeApiDestinationResponse
-> DescribeApiDestinationResponse -> Bool
$c== :: DescribeApiDestinationResponse
-> DescribeApiDestinationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeApiDestinationResponse]
ReadPrec DescribeApiDestinationResponse
Int -> ReadS DescribeApiDestinationResponse
ReadS [DescribeApiDestinationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeApiDestinationResponse]
$creadListPrec :: ReadPrec [DescribeApiDestinationResponse]
readPrec :: ReadPrec DescribeApiDestinationResponse
$creadPrec :: ReadPrec DescribeApiDestinationResponse
readList :: ReadS [DescribeApiDestinationResponse]
$creadList :: ReadS [DescribeApiDestinationResponse]
readsPrec :: Int -> ReadS DescribeApiDestinationResponse
$creadsPrec :: Int -> ReadS DescribeApiDestinationResponse
Prelude.Read, Int -> DescribeApiDestinationResponse -> ShowS
[DescribeApiDestinationResponse] -> ShowS
DescribeApiDestinationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeApiDestinationResponse] -> ShowS
$cshowList :: [DescribeApiDestinationResponse] -> ShowS
show :: DescribeApiDestinationResponse -> String
$cshow :: DescribeApiDestinationResponse -> String
showsPrec :: Int -> DescribeApiDestinationResponse -> ShowS
$cshowsPrec :: Int -> DescribeApiDestinationResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeApiDestinationResponse x
-> DescribeApiDestinationResponse
forall x.
DescribeApiDestinationResponse
-> Rep DescribeApiDestinationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeApiDestinationResponse x
-> DescribeApiDestinationResponse
$cfrom :: forall x.
DescribeApiDestinationResponse
-> Rep DescribeApiDestinationResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeApiDestinationResponse' 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:
--
-- 'apiDestinationArn', 'describeApiDestinationResponse_apiDestinationArn' - The ARN of the API destination retrieved.
--
-- 'apiDestinationState', 'describeApiDestinationResponse_apiDestinationState' - The state of the API destination retrieved.
--
-- 'connectionArn', 'describeApiDestinationResponse_connectionArn' - The ARN of the connection specified for the API destination retrieved.
--
-- 'creationTime', 'describeApiDestinationResponse_creationTime' - A time stamp for the time that the API destination was created.
--
-- 'description', 'describeApiDestinationResponse_description' - The description for the API destination retrieved.
--
-- 'httpMethod', 'describeApiDestinationResponse_httpMethod' - The method to use to connect to the HTTP endpoint.
--
-- 'invocationEndpoint', 'describeApiDestinationResponse_invocationEndpoint' - The URL to use to connect to the HTTP endpoint.
--
-- 'invocationRateLimitPerSecond', 'describeApiDestinationResponse_invocationRateLimitPerSecond' - The maximum number of invocations per second to specified for the API
-- destination. Note that if you set the invocation rate maximum to a value
-- lower the rate necessary to send all events received on to the
-- destination HTTP endpoint, some events may not be delivered within the
-- 24-hour retry window. If you plan to set the rate lower than the rate
-- necessary to deliver all events, consider using a dead-letter queue to
-- catch events that are not delivered within 24 hours.
--
-- 'lastModifiedTime', 'describeApiDestinationResponse_lastModifiedTime' - A time stamp for the time that the API destination was last modified.
--
-- 'name', 'describeApiDestinationResponse_name' - The name of the API destination retrieved.
--
-- 'httpStatus', 'describeApiDestinationResponse_httpStatus' - The response's http status code.
newDescribeApiDestinationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeApiDestinationResponse
newDescribeApiDestinationResponse :: Int -> DescribeApiDestinationResponse
newDescribeApiDestinationResponse Int
pHttpStatus_ =
  DescribeApiDestinationResponse'
    { $sel:apiDestinationArn:DescribeApiDestinationResponse' :: Maybe Text
apiDestinationArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:apiDestinationState:DescribeApiDestinationResponse' :: Maybe ApiDestinationState
apiDestinationState = forall a. Maybe a
Prelude.Nothing,
      $sel:connectionArn:DescribeApiDestinationResponse' :: Maybe Text
connectionArn = forall a. Maybe a
Prelude.Nothing,
      $sel:creationTime:DescribeApiDestinationResponse' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:description:DescribeApiDestinationResponse' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:httpMethod:DescribeApiDestinationResponse' :: Maybe ApiDestinationHttpMethod
httpMethod = forall a. Maybe a
Prelude.Nothing,
      $sel:invocationEndpoint:DescribeApiDestinationResponse' :: Maybe Text
invocationEndpoint = forall a. Maybe a
Prelude.Nothing,
      $sel:invocationRateLimitPerSecond:DescribeApiDestinationResponse' :: Maybe Natural
invocationRateLimitPerSecond =
        forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:DescribeApiDestinationResponse' :: Maybe POSIX
lastModifiedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeApiDestinationResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeApiDestinationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the API destination retrieved.
describeApiDestinationResponse_apiDestinationArn :: Lens.Lens' DescribeApiDestinationResponse (Prelude.Maybe Prelude.Text)
describeApiDestinationResponse_apiDestinationArn :: Lens' DescribeApiDestinationResponse (Maybe Text)
describeApiDestinationResponse_apiDestinationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApiDestinationResponse' {Maybe Text
apiDestinationArn :: Maybe Text
$sel:apiDestinationArn:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe Text
apiDestinationArn} -> Maybe Text
apiDestinationArn) (\s :: DescribeApiDestinationResponse
s@DescribeApiDestinationResponse' {} Maybe Text
a -> DescribeApiDestinationResponse
s {$sel:apiDestinationArn:DescribeApiDestinationResponse' :: Maybe Text
apiDestinationArn = Maybe Text
a} :: DescribeApiDestinationResponse)

-- | The state of the API destination retrieved.
describeApiDestinationResponse_apiDestinationState :: Lens.Lens' DescribeApiDestinationResponse (Prelude.Maybe ApiDestinationState)
describeApiDestinationResponse_apiDestinationState :: Lens' DescribeApiDestinationResponse (Maybe ApiDestinationState)
describeApiDestinationResponse_apiDestinationState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApiDestinationResponse' {Maybe ApiDestinationState
apiDestinationState :: Maybe ApiDestinationState
$sel:apiDestinationState:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe ApiDestinationState
apiDestinationState} -> Maybe ApiDestinationState
apiDestinationState) (\s :: DescribeApiDestinationResponse
s@DescribeApiDestinationResponse' {} Maybe ApiDestinationState
a -> DescribeApiDestinationResponse
s {$sel:apiDestinationState:DescribeApiDestinationResponse' :: Maybe ApiDestinationState
apiDestinationState = Maybe ApiDestinationState
a} :: DescribeApiDestinationResponse)

-- | The ARN of the connection specified for the API destination retrieved.
describeApiDestinationResponse_connectionArn :: Lens.Lens' DescribeApiDestinationResponse (Prelude.Maybe Prelude.Text)
describeApiDestinationResponse_connectionArn :: Lens' DescribeApiDestinationResponse (Maybe Text)
describeApiDestinationResponse_connectionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApiDestinationResponse' {Maybe Text
connectionArn :: Maybe Text
$sel:connectionArn:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe Text
connectionArn} -> Maybe Text
connectionArn) (\s :: DescribeApiDestinationResponse
s@DescribeApiDestinationResponse' {} Maybe Text
a -> DescribeApiDestinationResponse
s {$sel:connectionArn:DescribeApiDestinationResponse' :: Maybe Text
connectionArn = Maybe Text
a} :: DescribeApiDestinationResponse)

-- | A time stamp for the time that the API destination was created.
describeApiDestinationResponse_creationTime :: Lens.Lens' DescribeApiDestinationResponse (Prelude.Maybe Prelude.UTCTime)
describeApiDestinationResponse_creationTime :: Lens' DescribeApiDestinationResponse (Maybe UTCTime)
describeApiDestinationResponse_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApiDestinationResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DescribeApiDestinationResponse
s@DescribeApiDestinationResponse' {} Maybe POSIX
a -> DescribeApiDestinationResponse
s {$sel:creationTime:DescribeApiDestinationResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DescribeApiDestinationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The description for the API destination retrieved.
describeApiDestinationResponse_description :: Lens.Lens' DescribeApiDestinationResponse (Prelude.Maybe Prelude.Text)
describeApiDestinationResponse_description :: Lens' DescribeApiDestinationResponse (Maybe Text)
describeApiDestinationResponse_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApiDestinationResponse' {Maybe Text
description :: Maybe Text
$sel:description:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: DescribeApiDestinationResponse
s@DescribeApiDestinationResponse' {} Maybe Text
a -> DescribeApiDestinationResponse
s {$sel:description:DescribeApiDestinationResponse' :: Maybe Text
description = Maybe Text
a} :: DescribeApiDestinationResponse)

-- | The method to use to connect to the HTTP endpoint.
describeApiDestinationResponse_httpMethod :: Lens.Lens' DescribeApiDestinationResponse (Prelude.Maybe ApiDestinationHttpMethod)
describeApiDestinationResponse_httpMethod :: Lens'
  DescribeApiDestinationResponse (Maybe ApiDestinationHttpMethod)
describeApiDestinationResponse_httpMethod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApiDestinationResponse' {Maybe ApiDestinationHttpMethod
httpMethod :: Maybe ApiDestinationHttpMethod
$sel:httpMethod:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe ApiDestinationHttpMethod
httpMethod} -> Maybe ApiDestinationHttpMethod
httpMethod) (\s :: DescribeApiDestinationResponse
s@DescribeApiDestinationResponse' {} Maybe ApiDestinationHttpMethod
a -> DescribeApiDestinationResponse
s {$sel:httpMethod:DescribeApiDestinationResponse' :: Maybe ApiDestinationHttpMethod
httpMethod = Maybe ApiDestinationHttpMethod
a} :: DescribeApiDestinationResponse)

-- | The URL to use to connect to the HTTP endpoint.
describeApiDestinationResponse_invocationEndpoint :: Lens.Lens' DescribeApiDestinationResponse (Prelude.Maybe Prelude.Text)
describeApiDestinationResponse_invocationEndpoint :: Lens' DescribeApiDestinationResponse (Maybe Text)
describeApiDestinationResponse_invocationEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApiDestinationResponse' {Maybe Text
invocationEndpoint :: Maybe Text
$sel:invocationEndpoint:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe Text
invocationEndpoint} -> Maybe Text
invocationEndpoint) (\s :: DescribeApiDestinationResponse
s@DescribeApiDestinationResponse' {} Maybe Text
a -> DescribeApiDestinationResponse
s {$sel:invocationEndpoint:DescribeApiDestinationResponse' :: Maybe Text
invocationEndpoint = Maybe Text
a} :: DescribeApiDestinationResponse)

-- | The maximum number of invocations per second to specified for the API
-- destination. Note that if you set the invocation rate maximum to a value
-- lower the rate necessary to send all events received on to the
-- destination HTTP endpoint, some events may not be delivered within the
-- 24-hour retry window. If you plan to set the rate lower than the rate
-- necessary to deliver all events, consider using a dead-letter queue to
-- catch events that are not delivered within 24 hours.
describeApiDestinationResponse_invocationRateLimitPerSecond :: Lens.Lens' DescribeApiDestinationResponse (Prelude.Maybe Prelude.Natural)
describeApiDestinationResponse_invocationRateLimitPerSecond :: Lens' DescribeApiDestinationResponse (Maybe Natural)
describeApiDestinationResponse_invocationRateLimitPerSecond = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApiDestinationResponse' {Maybe Natural
invocationRateLimitPerSecond :: Maybe Natural
$sel:invocationRateLimitPerSecond:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe Natural
invocationRateLimitPerSecond} -> Maybe Natural
invocationRateLimitPerSecond) (\s :: DescribeApiDestinationResponse
s@DescribeApiDestinationResponse' {} Maybe Natural
a -> DescribeApiDestinationResponse
s {$sel:invocationRateLimitPerSecond:DescribeApiDestinationResponse' :: Maybe Natural
invocationRateLimitPerSecond = Maybe Natural
a} :: DescribeApiDestinationResponse)

-- | A time stamp for the time that the API destination was last modified.
describeApiDestinationResponse_lastModifiedTime :: Lens.Lens' DescribeApiDestinationResponse (Prelude.Maybe Prelude.UTCTime)
describeApiDestinationResponse_lastModifiedTime :: Lens' DescribeApiDestinationResponse (Maybe UTCTime)
describeApiDestinationResponse_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApiDestinationResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: DescribeApiDestinationResponse
s@DescribeApiDestinationResponse' {} Maybe POSIX
a -> DescribeApiDestinationResponse
s {$sel:lastModifiedTime:DescribeApiDestinationResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: DescribeApiDestinationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The name of the API destination retrieved.
describeApiDestinationResponse_name :: Lens.Lens' DescribeApiDestinationResponse (Prelude.Maybe Prelude.Text)
describeApiDestinationResponse_name :: Lens' DescribeApiDestinationResponse (Maybe Text)
describeApiDestinationResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeApiDestinationResponse' {Maybe Text
name :: Maybe Text
$sel:name:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: DescribeApiDestinationResponse
s@DescribeApiDestinationResponse' {} Maybe Text
a -> DescribeApiDestinationResponse
s {$sel:name:DescribeApiDestinationResponse' :: Maybe Text
name = Maybe Text
a} :: DescribeApiDestinationResponse)

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

instance
  Prelude.NFData
    DescribeApiDestinationResponse
  where
  rnf :: DescribeApiDestinationResponse -> ()
rnf DescribeApiDestinationResponse' {Int
Maybe Natural
Maybe Text
Maybe POSIX
Maybe ApiDestinationHttpMethod
Maybe ApiDestinationState
httpStatus :: Int
name :: Maybe Text
lastModifiedTime :: Maybe POSIX
invocationRateLimitPerSecond :: Maybe Natural
invocationEndpoint :: Maybe Text
httpMethod :: Maybe ApiDestinationHttpMethod
description :: Maybe Text
creationTime :: Maybe POSIX
connectionArn :: Maybe Text
apiDestinationState :: Maybe ApiDestinationState
apiDestinationArn :: Maybe Text
$sel:httpStatus:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Int
$sel:name:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe Text
$sel:lastModifiedTime:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe POSIX
$sel:invocationRateLimitPerSecond:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe Natural
$sel:invocationEndpoint:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe Text
$sel:httpMethod:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe ApiDestinationHttpMethod
$sel:description:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe Text
$sel:creationTime:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe POSIX
$sel:connectionArn:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe Text
$sel:apiDestinationState:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe ApiDestinationState
$sel:apiDestinationArn:DescribeApiDestinationResponse' :: DescribeApiDestinationResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
apiDestinationArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ApiDestinationState
apiDestinationState
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ApiDestinationHttpMethod
httpMethod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
invocationEndpoint
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
invocationRateLimitPerSecond
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus