{-# 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 #-}
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
data ApiDestination = ApiDestination'
{
ApiDestination -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
ApiDestination -> Maybe ApiDestinationHttpMethod
httpMethod :: Prelude.Maybe ApiDestinationHttpMethod,
ApiDestination -> Maybe Text
invocationEndpoint :: Prelude.Maybe Prelude.Text,
ApiDestination -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
ApiDestination -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ApiDestination -> Maybe Natural
invocationRateLimitPerSecond :: Prelude.Maybe Prelude.Natural,
ApiDestination -> Maybe ApiDestinationState
apiDestinationState :: Prelude.Maybe ApiDestinationState,
ApiDestination -> Maybe Text
connectionArn :: Prelude.Maybe Prelude.Text,
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)
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
}
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
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)
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)
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
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)
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)
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)
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)
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