{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.ApiDestination
-- 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)
module Amazonka.CloudWatchEvents.Types.ApiDestination where

import Amazonka.CloudWatchEvents.Types.ApiDestinationHttpMethod
import Amazonka.CloudWatchEvents.Types.ApiDestinationState
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains details about an API destination.
--
-- /See:/ 'newApiDestination' smart constructor.
data ApiDestination = ApiDestination'
  { -- | A time stamp for the time that the API destination was created.
    ApiDestination -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The method to use to connect to the HTTP endpoint.
    ApiDestination -> Maybe ApiDestinationHttpMethod
httpMethod :: Prelude.Maybe ApiDestinationHttpMethod,
    -- | The URL to the endpoint for the API destination.
    ApiDestination -> Maybe Text
invocationEndpoint :: Prelude.Maybe Prelude.Text,
    -- | A time stamp for the time that the API destination was last modified.
    ApiDestination -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the API destination.
    ApiDestination -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of invocations per second to send to the HTTP
    -- endpoint.
    ApiDestination -> Maybe Natural
invocationRateLimitPerSecond :: Prelude.Maybe Prelude.Natural,
    -- | The state of the API destination.
    ApiDestination -> Maybe ApiDestinationState
apiDestinationState :: Prelude.Maybe ApiDestinationState,
    -- | The ARN of the connection specified for the API destination.
    ApiDestination -> Maybe Text
connectionArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the API destination.
    ApiDestination -> Maybe Text
apiDestinationArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ApiDestination -> ApiDestination -> Bool
(ApiDestination -> ApiDestination -> Bool)
-> (ApiDestination -> ApiDestination -> Bool) -> Eq ApiDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApiDestination -> ApiDestination -> Bool
$c/= :: ApiDestination -> ApiDestination -> Bool
== :: ApiDestination -> ApiDestination -> Bool
$c== :: ApiDestination -> ApiDestination -> Bool
Prelude.Eq, ReadPrec [ApiDestination]
ReadPrec ApiDestination
Int -> ReadS ApiDestination
ReadS [ApiDestination]
(Int -> ReadS ApiDestination)
-> ReadS [ApiDestination]
-> ReadPrec ApiDestination
-> ReadPrec [ApiDestination]
-> Read ApiDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApiDestination]
$creadListPrec :: ReadPrec [ApiDestination]
readPrec :: ReadPrec ApiDestination
$creadPrec :: ReadPrec ApiDestination
readList :: ReadS [ApiDestination]
$creadList :: ReadS [ApiDestination]
readsPrec :: Int -> ReadS ApiDestination
$creadsPrec :: Int -> ReadS ApiDestination
Prelude.Read, Int -> ApiDestination -> ShowS
[ApiDestination] -> ShowS
ApiDestination -> String
(Int -> ApiDestination -> ShowS)
-> (ApiDestination -> String)
-> ([ApiDestination] -> ShowS)
-> Show ApiDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApiDestination] -> ShowS
$cshowList :: [ApiDestination] -> ShowS
show :: ApiDestination -> String
$cshow :: ApiDestination -> String
showsPrec :: Int -> ApiDestination -> ShowS
$cshowsPrec :: Int -> ApiDestination -> ShowS
Prelude.Show, (forall x. ApiDestination -> Rep ApiDestination x)
-> (forall x. Rep ApiDestination x -> ApiDestination)
-> Generic ApiDestination
forall x. Rep ApiDestination x -> ApiDestination
forall x. ApiDestination -> Rep ApiDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApiDestination x -> ApiDestination
$cfrom :: forall x. ApiDestination -> Rep ApiDestination x
Prelude.Generic)

-- |
-- Create a value of 'ApiDestination' 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', 'apiDestination_creationTime' - A time stamp for the time that the API destination was created.
--
-- 'httpMethod', 'apiDestination_httpMethod' - The method to use to connect to the HTTP endpoint.
--
-- 'invocationEndpoint', 'apiDestination_invocationEndpoint' - The URL to the endpoint for the API destination.
--
-- 'lastModifiedTime', 'apiDestination_lastModifiedTime' - A time stamp for the time that the API destination was last modified.
--
-- 'name', 'apiDestination_name' - The name of the API destination.
--
-- 'invocationRateLimitPerSecond', 'apiDestination_invocationRateLimitPerSecond' - The maximum number of invocations per second to send to the HTTP
-- endpoint.
--
-- 'apiDestinationState', 'apiDestination_apiDestinationState' - The state of the API destination.
--
-- 'connectionArn', 'apiDestination_connectionArn' - The ARN of the connection specified for the API destination.
--
-- 'apiDestinationArn', 'apiDestination_apiDestinationArn' - The ARN of the API destination.
newApiDestination ::
  ApiDestination
newApiDestination :: ApiDestination
newApiDestination =
  ApiDestination' :: Maybe POSIX
-> Maybe ApiDestinationHttpMethod
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Natural
-> Maybe ApiDestinationState
-> Maybe Text
-> Maybe Text
-> ApiDestination
ApiDestination'
    { $sel:creationTime:ApiDestination' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:httpMethod:ApiDestination' :: Maybe ApiDestinationHttpMethod
httpMethod = Maybe ApiDestinationHttpMethod
forall a. Maybe a
Prelude.Nothing,
      $sel:invocationEndpoint:ApiDestination' :: Maybe Text
invocationEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:ApiDestination' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ApiDestination' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:invocationRateLimitPerSecond:ApiDestination' :: Maybe Natural
invocationRateLimitPerSecond = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:apiDestinationState:ApiDestination' :: Maybe ApiDestinationState
apiDestinationState = Maybe ApiDestinationState
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionArn:ApiDestination' :: Maybe Text
connectionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:apiDestinationArn:ApiDestination' :: Maybe Text
apiDestinationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A time stamp for the time that the API destination was created.
apiDestination_creationTime :: Lens.Lens' ApiDestination (Prelude.Maybe Prelude.UTCTime)
apiDestination_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ApiDestination -> f ApiDestination
apiDestination_creationTime = (ApiDestination -> Maybe POSIX)
-> (ApiDestination -> Maybe POSIX -> ApiDestination)
-> Lens ApiDestination ApiDestination (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiDestination' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:ApiDestination' :: ApiDestination -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: ApiDestination
s@ApiDestination' {} Maybe POSIX
a -> ApiDestination
s {$sel:creationTime:ApiDestination' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: ApiDestination) ((Maybe POSIX -> f (Maybe POSIX))
 -> ApiDestination -> f ApiDestination)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ApiDestination
-> f ApiDestination
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 method to use to connect to the HTTP endpoint.
apiDestination_httpMethod :: Lens.Lens' ApiDestination (Prelude.Maybe ApiDestinationHttpMethod)
apiDestination_httpMethod :: (Maybe ApiDestinationHttpMethod
 -> f (Maybe ApiDestinationHttpMethod))
-> ApiDestination -> f ApiDestination
apiDestination_httpMethod = (ApiDestination -> Maybe ApiDestinationHttpMethod)
-> (ApiDestination
    -> Maybe ApiDestinationHttpMethod -> ApiDestination)
-> Lens
     ApiDestination
     ApiDestination
     (Maybe ApiDestinationHttpMethod)
     (Maybe ApiDestinationHttpMethod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiDestination' {Maybe ApiDestinationHttpMethod
httpMethod :: Maybe ApiDestinationHttpMethod
$sel:httpMethod:ApiDestination' :: ApiDestination -> Maybe ApiDestinationHttpMethod
httpMethod} -> Maybe ApiDestinationHttpMethod
httpMethod) (\s :: ApiDestination
s@ApiDestination' {} Maybe ApiDestinationHttpMethod
a -> ApiDestination
s {$sel:httpMethod:ApiDestination' :: Maybe ApiDestinationHttpMethod
httpMethod = Maybe ApiDestinationHttpMethod
a} :: ApiDestination)

-- | The URL to the endpoint for the API destination.
apiDestination_invocationEndpoint :: Lens.Lens' ApiDestination (Prelude.Maybe Prelude.Text)
apiDestination_invocationEndpoint :: (Maybe Text -> f (Maybe Text))
-> ApiDestination -> f ApiDestination
apiDestination_invocationEndpoint = (ApiDestination -> Maybe Text)
-> (ApiDestination -> Maybe Text -> ApiDestination)
-> Lens ApiDestination ApiDestination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiDestination' {Maybe Text
invocationEndpoint :: Maybe Text
$sel:invocationEndpoint:ApiDestination' :: ApiDestination -> Maybe Text
invocationEndpoint} -> Maybe Text
invocationEndpoint) (\s :: ApiDestination
s@ApiDestination' {} Maybe Text
a -> ApiDestination
s {$sel:invocationEndpoint:ApiDestination' :: Maybe Text
invocationEndpoint = Maybe Text
a} :: ApiDestination)

-- | A time stamp for the time that the API destination was last modified.
apiDestination_lastModifiedTime :: Lens.Lens' ApiDestination (Prelude.Maybe Prelude.UTCTime)
apiDestination_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ApiDestination -> f ApiDestination
apiDestination_lastModifiedTime = (ApiDestination -> Maybe POSIX)
-> (ApiDestination -> Maybe POSIX -> ApiDestination)
-> Lens ApiDestination ApiDestination (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiDestination' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:ApiDestination' :: ApiDestination -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: ApiDestination
s@ApiDestination' {} Maybe POSIX
a -> ApiDestination
s {$sel:lastModifiedTime:ApiDestination' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: ApiDestination) ((Maybe POSIX -> f (Maybe POSIX))
 -> ApiDestination -> f ApiDestination)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ApiDestination
-> f ApiDestination
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 API destination.
apiDestination_name :: Lens.Lens' ApiDestination (Prelude.Maybe Prelude.Text)
apiDestination_name :: (Maybe Text -> f (Maybe Text))
-> ApiDestination -> f ApiDestination
apiDestination_name = (ApiDestination -> Maybe Text)
-> (ApiDestination -> Maybe Text -> ApiDestination)
-> Lens ApiDestination ApiDestination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiDestination' {Maybe Text
name :: Maybe Text
$sel:name:ApiDestination' :: ApiDestination -> Maybe Text
name} -> Maybe Text
name) (\s :: ApiDestination
s@ApiDestination' {} Maybe Text
a -> ApiDestination
s {$sel:name:ApiDestination' :: Maybe Text
name = Maybe Text
a} :: ApiDestination)

-- | The maximum number of invocations per second to send to the HTTP
-- endpoint.
apiDestination_invocationRateLimitPerSecond :: Lens.Lens' ApiDestination (Prelude.Maybe Prelude.Natural)
apiDestination_invocationRateLimitPerSecond :: (Maybe Natural -> f (Maybe Natural))
-> ApiDestination -> f ApiDestination
apiDestination_invocationRateLimitPerSecond = (ApiDestination -> Maybe Natural)
-> (ApiDestination -> Maybe Natural -> ApiDestination)
-> Lens
     ApiDestination ApiDestination (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApiDestination' {Maybe Natural
invocationRateLimitPerSecond :: Maybe Natural
$sel:invocationRateLimitPerSecond:ApiDestination' :: ApiDestination -> Maybe Natural
invocationRateLimitPerSecond} -> Maybe Natural
invocationRateLimitPerSecond) (\s :: ApiDestination
s@ApiDestination' {} Maybe Natural
a -> ApiDestination
s {$sel:invocationRateLimitPerSecond:ApiDestination' :: Maybe Natural
invocationRateLimitPerSecond = Maybe Natural
a} :: ApiDestination)

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

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

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

instance Core.FromJSON ApiDestination where
  parseJSON :: Value -> Parser ApiDestination
parseJSON =
    String
-> (Object -> Parser ApiDestination)
-> Value
-> Parser ApiDestination
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ApiDestination"
      ( \Object
x ->
          Maybe POSIX
-> Maybe ApiDestinationHttpMethod
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Natural
-> Maybe ApiDestinationState
-> Maybe Text
-> Maybe Text
-> ApiDestination
ApiDestination'
            (Maybe POSIX
 -> Maybe ApiDestinationHttpMethod
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Natural
 -> Maybe ApiDestinationState
 -> Maybe Text
 -> Maybe Text
 -> ApiDestination)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ApiDestinationHttpMethod
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Natural
      -> Maybe ApiDestinationState
      -> Maybe Text
      -> Maybe Text
      -> ApiDestination)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTime")
            Parser
  (Maybe ApiDestinationHttpMethod
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Natural
   -> Maybe ApiDestinationState
   -> Maybe Text
   -> Maybe Text
   -> ApiDestination)
-> Parser (Maybe ApiDestinationHttpMethod)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Natural
      -> Maybe ApiDestinationState
      -> Maybe Text
      -> Maybe Text
      -> ApiDestination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ApiDestinationHttpMethod)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HttpMethod")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Natural
   -> Maybe ApiDestinationState
   -> Maybe Text
   -> Maybe Text
   -> ApiDestination)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Natural
      -> Maybe ApiDestinationState
      -> Maybe Text
      -> Maybe Text
      -> ApiDestination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InvocationEndpoint")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Natural
   -> Maybe ApiDestinationState
   -> Maybe Text
   -> Maybe Text
   -> ApiDestination)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Natural
      -> Maybe ApiDestinationState
      -> Maybe Text
      -> Maybe Text
      -> ApiDestination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastModifiedTime")
            Parser
  (Maybe Text
   -> Maybe Natural
   -> Maybe ApiDestinationState
   -> Maybe Text
   -> Maybe Text
   -> ApiDestination)
-> Parser (Maybe Text)
-> Parser
     (Maybe Natural
      -> Maybe ApiDestinationState
      -> Maybe Text
      -> Maybe Text
      -> ApiDestination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe Natural
   -> Maybe ApiDestinationState
   -> Maybe Text
   -> Maybe Text
   -> ApiDestination)
-> Parser (Maybe Natural)
-> Parser
     (Maybe ApiDestinationState
      -> Maybe Text -> Maybe Text -> ApiDestination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InvocationRateLimitPerSecond")
            Parser
  (Maybe ApiDestinationState
   -> Maybe Text -> Maybe Text -> ApiDestination)
-> Parser (Maybe ApiDestinationState)
-> Parser (Maybe Text -> Maybe Text -> ApiDestination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ApiDestinationState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ApiDestinationState")
            Parser (Maybe Text -> Maybe Text -> ApiDestination)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ApiDestination)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ConnectionArn")
            Parser (Maybe Text -> ApiDestination)
-> Parser (Maybe Text) -> Parser ApiDestination
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ApiDestinationArn")
      )

instance Prelude.Hashable ApiDestination

instance Prelude.NFData ApiDestination