{-# 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 #-}
module Amazonka.Shield.EnableApplicationLayerAutomaticResponse
(
EnableApplicationLayerAutomaticResponse (..),
newEnableApplicationLayerAutomaticResponse,
enableApplicationLayerAutomaticResponse_resourceArn,
enableApplicationLayerAutomaticResponse_action,
EnableApplicationLayerAutomaticResponseResponse (..),
newEnableApplicationLayerAutomaticResponseResponse,
enableApplicationLayerAutomaticResponseResponse_httpStatus,
)
where
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
import Amazonka.Shield.Types
data EnableApplicationLayerAutomaticResponse = EnableApplicationLayerAutomaticResponse'
{
EnableApplicationLayerAutomaticResponse -> Text
resourceArn :: Prelude.Text,
EnableApplicationLayerAutomaticResponse -> ResponseAction
action :: ResponseAction
}
deriving (EnableApplicationLayerAutomaticResponse
-> EnableApplicationLayerAutomaticResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableApplicationLayerAutomaticResponse
-> EnableApplicationLayerAutomaticResponse -> Bool
$c/= :: EnableApplicationLayerAutomaticResponse
-> EnableApplicationLayerAutomaticResponse -> Bool
== :: EnableApplicationLayerAutomaticResponse
-> EnableApplicationLayerAutomaticResponse -> Bool
$c== :: EnableApplicationLayerAutomaticResponse
-> EnableApplicationLayerAutomaticResponse -> Bool
Prelude.Eq, ReadPrec [EnableApplicationLayerAutomaticResponse]
ReadPrec EnableApplicationLayerAutomaticResponse
Int -> ReadS EnableApplicationLayerAutomaticResponse
ReadS [EnableApplicationLayerAutomaticResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableApplicationLayerAutomaticResponse]
$creadListPrec :: ReadPrec [EnableApplicationLayerAutomaticResponse]
readPrec :: ReadPrec EnableApplicationLayerAutomaticResponse
$creadPrec :: ReadPrec EnableApplicationLayerAutomaticResponse
readList :: ReadS [EnableApplicationLayerAutomaticResponse]
$creadList :: ReadS [EnableApplicationLayerAutomaticResponse]
readsPrec :: Int -> ReadS EnableApplicationLayerAutomaticResponse
$creadsPrec :: Int -> ReadS EnableApplicationLayerAutomaticResponse
Prelude.Read, Int -> EnableApplicationLayerAutomaticResponse -> ShowS
[EnableApplicationLayerAutomaticResponse] -> ShowS
EnableApplicationLayerAutomaticResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableApplicationLayerAutomaticResponse] -> ShowS
$cshowList :: [EnableApplicationLayerAutomaticResponse] -> ShowS
show :: EnableApplicationLayerAutomaticResponse -> String
$cshow :: EnableApplicationLayerAutomaticResponse -> String
showsPrec :: Int -> EnableApplicationLayerAutomaticResponse -> ShowS
$cshowsPrec :: Int -> EnableApplicationLayerAutomaticResponse -> ShowS
Prelude.Show, forall x.
Rep EnableApplicationLayerAutomaticResponse x
-> EnableApplicationLayerAutomaticResponse
forall x.
EnableApplicationLayerAutomaticResponse
-> Rep EnableApplicationLayerAutomaticResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnableApplicationLayerAutomaticResponse x
-> EnableApplicationLayerAutomaticResponse
$cfrom :: forall x.
EnableApplicationLayerAutomaticResponse
-> Rep EnableApplicationLayerAutomaticResponse x
Prelude.Generic)
newEnableApplicationLayerAutomaticResponse ::
Prelude.Text ->
ResponseAction ->
EnableApplicationLayerAutomaticResponse
newEnableApplicationLayerAutomaticResponse :: Text -> ResponseAction -> EnableApplicationLayerAutomaticResponse
newEnableApplicationLayerAutomaticResponse
Text
pResourceArn_
ResponseAction
pAction_ =
EnableApplicationLayerAutomaticResponse'
{ $sel:resourceArn:EnableApplicationLayerAutomaticResponse' :: Text
resourceArn =
Text
pResourceArn_,
$sel:action:EnableApplicationLayerAutomaticResponse' :: ResponseAction
action = ResponseAction
pAction_
}
enableApplicationLayerAutomaticResponse_resourceArn :: Lens.Lens' EnableApplicationLayerAutomaticResponse Prelude.Text
enableApplicationLayerAutomaticResponse_resourceArn :: Lens' EnableApplicationLayerAutomaticResponse Text
enableApplicationLayerAutomaticResponse_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableApplicationLayerAutomaticResponse' {Text
resourceArn :: Text
$sel:resourceArn:EnableApplicationLayerAutomaticResponse' :: EnableApplicationLayerAutomaticResponse -> Text
resourceArn} -> Text
resourceArn) (\s :: EnableApplicationLayerAutomaticResponse
s@EnableApplicationLayerAutomaticResponse' {} Text
a -> EnableApplicationLayerAutomaticResponse
s {$sel:resourceArn:EnableApplicationLayerAutomaticResponse' :: Text
resourceArn = Text
a} :: EnableApplicationLayerAutomaticResponse)
enableApplicationLayerAutomaticResponse_action :: Lens.Lens' EnableApplicationLayerAutomaticResponse ResponseAction
enableApplicationLayerAutomaticResponse_action :: Lens' EnableApplicationLayerAutomaticResponse ResponseAction
enableApplicationLayerAutomaticResponse_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableApplicationLayerAutomaticResponse' {ResponseAction
action :: ResponseAction
$sel:action:EnableApplicationLayerAutomaticResponse' :: EnableApplicationLayerAutomaticResponse -> ResponseAction
action} -> ResponseAction
action) (\s :: EnableApplicationLayerAutomaticResponse
s@EnableApplicationLayerAutomaticResponse' {} ResponseAction
a -> EnableApplicationLayerAutomaticResponse
s {$sel:action:EnableApplicationLayerAutomaticResponse' :: ResponseAction
action = ResponseAction
a} :: EnableApplicationLayerAutomaticResponse)
instance
Core.AWSRequest
EnableApplicationLayerAutomaticResponse
where
type
AWSResponse
EnableApplicationLayerAutomaticResponse =
EnableApplicationLayerAutomaticResponseResponse
request :: (Service -> Service)
-> EnableApplicationLayerAutomaticResponse
-> Request EnableApplicationLayerAutomaticResponse
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 EnableApplicationLayerAutomaticResponse
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse EnableApplicationLayerAutomaticResponse)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> EnableApplicationLayerAutomaticResponseResponse
EnableApplicationLayerAutomaticResponseResponse'
forall (f :: * -> *) a b. Functor 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
EnableApplicationLayerAutomaticResponse
where
hashWithSalt :: Int -> EnableApplicationLayerAutomaticResponse -> Int
hashWithSalt
Int
_salt
EnableApplicationLayerAutomaticResponse' {Text
ResponseAction
action :: ResponseAction
resourceArn :: Text
$sel:action:EnableApplicationLayerAutomaticResponse' :: EnableApplicationLayerAutomaticResponse -> ResponseAction
$sel:resourceArn:EnableApplicationLayerAutomaticResponse' :: EnableApplicationLayerAutomaticResponse -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResponseAction
action
instance
Prelude.NFData
EnableApplicationLayerAutomaticResponse
where
rnf :: EnableApplicationLayerAutomaticResponse -> ()
rnf EnableApplicationLayerAutomaticResponse' {Text
ResponseAction
action :: ResponseAction
resourceArn :: Text
$sel:action:EnableApplicationLayerAutomaticResponse' :: EnableApplicationLayerAutomaticResponse -> ResponseAction
$sel:resourceArn:EnableApplicationLayerAutomaticResponse' :: EnableApplicationLayerAutomaticResponse -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResponseAction
action
instance
Data.ToHeaders
EnableApplicationLayerAutomaticResponse
where
toHeaders :: EnableApplicationLayerAutomaticResponse -> 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
"AWSShield_20160616.EnableApplicationLayerAutomaticResponse" ::
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
EnableApplicationLayerAutomaticResponse
where
toJSON :: EnableApplicationLayerAutomaticResponse -> Value
toJSON EnableApplicationLayerAutomaticResponse' {Text
ResponseAction
action :: ResponseAction
resourceArn :: Text
$sel:action:EnableApplicationLayerAutomaticResponse' :: EnableApplicationLayerAutomaticResponse -> ResponseAction
$sel:resourceArn:EnableApplicationLayerAutomaticResponse' :: EnableApplicationLayerAutomaticResponse -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"ResourceArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceArn),
forall a. a -> Maybe a
Prelude.Just (Key
"Action" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ResponseAction
action)
]
)
instance
Data.ToPath
EnableApplicationLayerAutomaticResponse
where
toPath :: EnableApplicationLayerAutomaticResponse -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Data.ToQuery
EnableApplicationLayerAutomaticResponse
where
toQuery :: EnableApplicationLayerAutomaticResponse -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data EnableApplicationLayerAutomaticResponseResponse = EnableApplicationLayerAutomaticResponseResponse'
{
EnableApplicationLayerAutomaticResponseResponse -> Int
httpStatus :: Prelude.Int
}
deriving (EnableApplicationLayerAutomaticResponseResponse
-> EnableApplicationLayerAutomaticResponseResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableApplicationLayerAutomaticResponseResponse
-> EnableApplicationLayerAutomaticResponseResponse -> Bool
$c/= :: EnableApplicationLayerAutomaticResponseResponse
-> EnableApplicationLayerAutomaticResponseResponse -> Bool
== :: EnableApplicationLayerAutomaticResponseResponse
-> EnableApplicationLayerAutomaticResponseResponse -> Bool
$c== :: EnableApplicationLayerAutomaticResponseResponse
-> EnableApplicationLayerAutomaticResponseResponse -> Bool
Prelude.Eq, ReadPrec [EnableApplicationLayerAutomaticResponseResponse]
ReadPrec EnableApplicationLayerAutomaticResponseResponse
Int -> ReadS EnableApplicationLayerAutomaticResponseResponse
ReadS [EnableApplicationLayerAutomaticResponseResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableApplicationLayerAutomaticResponseResponse]
$creadListPrec :: ReadPrec [EnableApplicationLayerAutomaticResponseResponse]
readPrec :: ReadPrec EnableApplicationLayerAutomaticResponseResponse
$creadPrec :: ReadPrec EnableApplicationLayerAutomaticResponseResponse
readList :: ReadS [EnableApplicationLayerAutomaticResponseResponse]
$creadList :: ReadS [EnableApplicationLayerAutomaticResponseResponse]
readsPrec :: Int -> ReadS EnableApplicationLayerAutomaticResponseResponse
$creadsPrec :: Int -> ReadS EnableApplicationLayerAutomaticResponseResponse
Prelude.Read, Int -> EnableApplicationLayerAutomaticResponseResponse -> ShowS
[EnableApplicationLayerAutomaticResponseResponse] -> ShowS
EnableApplicationLayerAutomaticResponseResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableApplicationLayerAutomaticResponseResponse] -> ShowS
$cshowList :: [EnableApplicationLayerAutomaticResponseResponse] -> ShowS
show :: EnableApplicationLayerAutomaticResponseResponse -> String
$cshow :: EnableApplicationLayerAutomaticResponseResponse -> String
showsPrec :: Int -> EnableApplicationLayerAutomaticResponseResponse -> ShowS
$cshowsPrec :: Int -> EnableApplicationLayerAutomaticResponseResponse -> ShowS
Prelude.Show, forall x.
Rep EnableApplicationLayerAutomaticResponseResponse x
-> EnableApplicationLayerAutomaticResponseResponse
forall x.
EnableApplicationLayerAutomaticResponseResponse
-> Rep EnableApplicationLayerAutomaticResponseResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnableApplicationLayerAutomaticResponseResponse x
-> EnableApplicationLayerAutomaticResponseResponse
$cfrom :: forall x.
EnableApplicationLayerAutomaticResponseResponse
-> Rep EnableApplicationLayerAutomaticResponseResponse x
Prelude.Generic)
newEnableApplicationLayerAutomaticResponseResponse ::
Prelude.Int ->
EnableApplicationLayerAutomaticResponseResponse
newEnableApplicationLayerAutomaticResponseResponse :: Int -> EnableApplicationLayerAutomaticResponseResponse
newEnableApplicationLayerAutomaticResponseResponse
Int
pHttpStatus_ =
EnableApplicationLayerAutomaticResponseResponse'
{ $sel:httpStatus:EnableApplicationLayerAutomaticResponseResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
enableApplicationLayerAutomaticResponseResponse_httpStatus :: Lens.Lens' EnableApplicationLayerAutomaticResponseResponse Prelude.Int
enableApplicationLayerAutomaticResponseResponse_httpStatus :: Lens' EnableApplicationLayerAutomaticResponseResponse Int
enableApplicationLayerAutomaticResponseResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableApplicationLayerAutomaticResponseResponse' {Int
httpStatus :: Int
$sel:httpStatus:EnableApplicationLayerAutomaticResponseResponse' :: EnableApplicationLayerAutomaticResponseResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: EnableApplicationLayerAutomaticResponseResponse
s@EnableApplicationLayerAutomaticResponseResponse' {} Int
a -> EnableApplicationLayerAutomaticResponseResponse
s {$sel:httpStatus:EnableApplicationLayerAutomaticResponseResponse' :: Int
httpStatus = Int
a} :: EnableApplicationLayerAutomaticResponseResponse)
instance
Prelude.NFData
EnableApplicationLayerAutomaticResponseResponse
where
rnf :: EnableApplicationLayerAutomaticResponseResponse -> ()
rnf
EnableApplicationLayerAutomaticResponseResponse' {Int
httpStatus :: Int
$sel:httpStatus:EnableApplicationLayerAutomaticResponseResponse' :: EnableApplicationLayerAutomaticResponseResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus