{-# 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.WAF.CreateWebACLMigrationStack
(
CreateWebACLMigrationStack (..),
newCreateWebACLMigrationStack,
createWebACLMigrationStack_webACLId,
createWebACLMigrationStack_s3BucketName,
createWebACLMigrationStack_ignoreUnsupportedType,
CreateWebACLMigrationStackResponse (..),
newCreateWebACLMigrationStackResponse,
createWebACLMigrationStackResponse_httpStatus,
createWebACLMigrationStackResponse_s3ObjectUrl,
)
where
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
import Amazonka.WAF.Types
data CreateWebACLMigrationStack = CreateWebACLMigrationStack'
{
CreateWebACLMigrationStack -> Text
webACLId :: Prelude.Text,
CreateWebACLMigrationStack -> Text
s3BucketName :: Prelude.Text,
CreateWebACLMigrationStack -> Bool
ignoreUnsupportedType :: Prelude.Bool
}
deriving (CreateWebACLMigrationStack -> CreateWebACLMigrationStack -> Bool
(CreateWebACLMigrationStack -> CreateWebACLMigrationStack -> Bool)
-> (CreateWebACLMigrationStack
-> CreateWebACLMigrationStack -> Bool)
-> Eq CreateWebACLMigrationStack
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWebACLMigrationStack -> CreateWebACLMigrationStack -> Bool
$c/= :: CreateWebACLMigrationStack -> CreateWebACLMigrationStack -> Bool
== :: CreateWebACLMigrationStack -> CreateWebACLMigrationStack -> Bool
$c== :: CreateWebACLMigrationStack -> CreateWebACLMigrationStack -> Bool
Prelude.Eq, ReadPrec [CreateWebACLMigrationStack]
ReadPrec CreateWebACLMigrationStack
Int -> ReadS CreateWebACLMigrationStack
ReadS [CreateWebACLMigrationStack]
(Int -> ReadS CreateWebACLMigrationStack)
-> ReadS [CreateWebACLMigrationStack]
-> ReadPrec CreateWebACLMigrationStack
-> ReadPrec [CreateWebACLMigrationStack]
-> Read CreateWebACLMigrationStack
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWebACLMigrationStack]
$creadListPrec :: ReadPrec [CreateWebACLMigrationStack]
readPrec :: ReadPrec CreateWebACLMigrationStack
$creadPrec :: ReadPrec CreateWebACLMigrationStack
readList :: ReadS [CreateWebACLMigrationStack]
$creadList :: ReadS [CreateWebACLMigrationStack]
readsPrec :: Int -> ReadS CreateWebACLMigrationStack
$creadsPrec :: Int -> ReadS CreateWebACLMigrationStack
Prelude.Read, Int -> CreateWebACLMigrationStack -> ShowS
[CreateWebACLMigrationStack] -> ShowS
CreateWebACLMigrationStack -> String
(Int -> CreateWebACLMigrationStack -> ShowS)
-> (CreateWebACLMigrationStack -> String)
-> ([CreateWebACLMigrationStack] -> ShowS)
-> Show CreateWebACLMigrationStack
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWebACLMigrationStack] -> ShowS
$cshowList :: [CreateWebACLMigrationStack] -> ShowS
show :: CreateWebACLMigrationStack -> String
$cshow :: CreateWebACLMigrationStack -> String
showsPrec :: Int -> CreateWebACLMigrationStack -> ShowS
$cshowsPrec :: Int -> CreateWebACLMigrationStack -> ShowS
Prelude.Show, (forall x.
CreateWebACLMigrationStack -> Rep CreateWebACLMigrationStack x)
-> (forall x.
Rep CreateWebACLMigrationStack x -> CreateWebACLMigrationStack)
-> Generic CreateWebACLMigrationStack
forall x.
Rep CreateWebACLMigrationStack x -> CreateWebACLMigrationStack
forall x.
CreateWebACLMigrationStack -> Rep CreateWebACLMigrationStack x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWebACLMigrationStack x -> CreateWebACLMigrationStack
$cfrom :: forall x.
CreateWebACLMigrationStack -> Rep CreateWebACLMigrationStack x
Prelude.Generic)
newCreateWebACLMigrationStack ::
Prelude.Text ->
Prelude.Text ->
Prelude.Bool ->
CreateWebACLMigrationStack
newCreateWebACLMigrationStack :: Text -> Text -> Bool -> CreateWebACLMigrationStack
newCreateWebACLMigrationStack
Text
pWebACLId_
Text
pS3BucketName_
Bool
pIgnoreUnsupportedType_ =
CreateWebACLMigrationStack' :: Text -> Text -> Bool -> CreateWebACLMigrationStack
CreateWebACLMigrationStack'
{ $sel:webACLId:CreateWebACLMigrationStack' :: Text
webACLId = Text
pWebACLId_,
$sel:s3BucketName:CreateWebACLMigrationStack' :: Text
s3BucketName = Text
pS3BucketName_,
$sel:ignoreUnsupportedType:CreateWebACLMigrationStack' :: Bool
ignoreUnsupportedType = Bool
pIgnoreUnsupportedType_
}
createWebACLMigrationStack_webACLId :: Lens.Lens' CreateWebACLMigrationStack Prelude.Text
createWebACLMigrationStack_webACLId :: (Text -> f Text)
-> CreateWebACLMigrationStack -> f CreateWebACLMigrationStack
createWebACLMigrationStack_webACLId = (CreateWebACLMigrationStack -> Text)
-> (CreateWebACLMigrationStack
-> Text -> CreateWebACLMigrationStack)
-> Lens
CreateWebACLMigrationStack CreateWebACLMigrationStack Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWebACLMigrationStack' {Text
webACLId :: Text
$sel:webACLId:CreateWebACLMigrationStack' :: CreateWebACLMigrationStack -> Text
webACLId} -> Text
webACLId) (\s :: CreateWebACLMigrationStack
s@CreateWebACLMigrationStack' {} Text
a -> CreateWebACLMigrationStack
s {$sel:webACLId:CreateWebACLMigrationStack' :: Text
webACLId = Text
a} :: CreateWebACLMigrationStack)
createWebACLMigrationStack_s3BucketName :: Lens.Lens' CreateWebACLMigrationStack Prelude.Text
createWebACLMigrationStack_s3BucketName :: (Text -> f Text)
-> CreateWebACLMigrationStack -> f CreateWebACLMigrationStack
createWebACLMigrationStack_s3BucketName = (CreateWebACLMigrationStack -> Text)
-> (CreateWebACLMigrationStack
-> Text -> CreateWebACLMigrationStack)
-> Lens
CreateWebACLMigrationStack CreateWebACLMigrationStack Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWebACLMigrationStack' {Text
s3BucketName :: Text
$sel:s3BucketName:CreateWebACLMigrationStack' :: CreateWebACLMigrationStack -> Text
s3BucketName} -> Text
s3BucketName) (\s :: CreateWebACLMigrationStack
s@CreateWebACLMigrationStack' {} Text
a -> CreateWebACLMigrationStack
s {$sel:s3BucketName:CreateWebACLMigrationStack' :: Text
s3BucketName = Text
a} :: CreateWebACLMigrationStack)
createWebACLMigrationStack_ignoreUnsupportedType :: Lens.Lens' CreateWebACLMigrationStack Prelude.Bool
createWebACLMigrationStack_ignoreUnsupportedType :: (Bool -> f Bool)
-> CreateWebACLMigrationStack -> f CreateWebACLMigrationStack
createWebACLMigrationStack_ignoreUnsupportedType = (CreateWebACLMigrationStack -> Bool)
-> (CreateWebACLMigrationStack
-> Bool -> CreateWebACLMigrationStack)
-> Lens
CreateWebACLMigrationStack CreateWebACLMigrationStack Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWebACLMigrationStack' {Bool
ignoreUnsupportedType :: Bool
$sel:ignoreUnsupportedType:CreateWebACLMigrationStack' :: CreateWebACLMigrationStack -> Bool
ignoreUnsupportedType} -> Bool
ignoreUnsupportedType) (\s :: CreateWebACLMigrationStack
s@CreateWebACLMigrationStack' {} Bool
a -> CreateWebACLMigrationStack
s {$sel:ignoreUnsupportedType:CreateWebACLMigrationStack' :: Bool
ignoreUnsupportedType = Bool
a} :: CreateWebACLMigrationStack)
instance Core.AWSRequest CreateWebACLMigrationStack where
type
AWSResponse CreateWebACLMigrationStack =
CreateWebACLMigrationStackResponse
request :: CreateWebACLMigrationStack -> Request CreateWebACLMigrationStack
request = Service
-> CreateWebACLMigrationStack -> Request CreateWebACLMigrationStack
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateWebACLMigrationStack
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateWebACLMigrationStack)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateWebACLMigrationStack))
-> Logger
-> Service
-> Proxy CreateWebACLMigrationStack
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateWebACLMigrationStack)))
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 ->
Int -> Text -> CreateWebACLMigrationStackResponse
CreateWebACLMigrationStackResponse'
(Int -> Text -> CreateWebACLMigrationStackResponse)
-> Either String Int
-> Either String (Text -> CreateWebACLMigrationStackResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (Text -> CreateWebACLMigrationStackResponse)
-> Either String Text
-> Either String CreateWebACLMigrationStackResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"S3ObjectUrl")
)
instance Prelude.Hashable CreateWebACLMigrationStack
instance Prelude.NFData CreateWebACLMigrationStack
instance Core.ToHeaders CreateWebACLMigrationStack where
toHeaders :: CreateWebACLMigrationStack -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateWebACLMigrationStack -> 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
"AWSWAF_20150824.CreateWebACLMigrationStack" ::
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 CreateWebACLMigrationStack where
toJSON :: CreateWebACLMigrationStack -> Value
toJSON CreateWebACLMigrationStack' {Bool
Text
ignoreUnsupportedType :: Bool
s3BucketName :: Text
webACLId :: Text
$sel:ignoreUnsupportedType:CreateWebACLMigrationStack' :: CreateWebACLMigrationStack -> Bool
$sel:s3BucketName:CreateWebACLMigrationStack' :: CreateWebACLMigrationStack -> Text
$sel:webACLId:CreateWebACLMigrationStack' :: CreateWebACLMigrationStack -> 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
"WebACLId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
webACLId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"S3BucketName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3BucketName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"IgnoreUnsupportedType"
Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
ignoreUnsupportedType
)
]
)
instance Core.ToPath CreateWebACLMigrationStack where
toPath :: CreateWebACLMigrationStack -> ByteString
toPath = ByteString -> CreateWebACLMigrationStack -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateWebACLMigrationStack where
toQuery :: CreateWebACLMigrationStack -> QueryString
toQuery = QueryString -> CreateWebACLMigrationStack -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateWebACLMigrationStackResponse = CreateWebACLMigrationStackResponse'
{
CreateWebACLMigrationStackResponse -> Int
httpStatus :: Prelude.Int,
CreateWebACLMigrationStackResponse -> Text
s3ObjectUrl :: Prelude.Text
}
deriving (CreateWebACLMigrationStackResponse
-> CreateWebACLMigrationStackResponse -> Bool
(CreateWebACLMigrationStackResponse
-> CreateWebACLMigrationStackResponse -> Bool)
-> (CreateWebACLMigrationStackResponse
-> CreateWebACLMigrationStackResponse -> Bool)
-> Eq CreateWebACLMigrationStackResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWebACLMigrationStackResponse
-> CreateWebACLMigrationStackResponse -> Bool
$c/= :: CreateWebACLMigrationStackResponse
-> CreateWebACLMigrationStackResponse -> Bool
== :: CreateWebACLMigrationStackResponse
-> CreateWebACLMigrationStackResponse -> Bool
$c== :: CreateWebACLMigrationStackResponse
-> CreateWebACLMigrationStackResponse -> Bool
Prelude.Eq, ReadPrec [CreateWebACLMigrationStackResponse]
ReadPrec CreateWebACLMigrationStackResponse
Int -> ReadS CreateWebACLMigrationStackResponse
ReadS [CreateWebACLMigrationStackResponse]
(Int -> ReadS CreateWebACLMigrationStackResponse)
-> ReadS [CreateWebACLMigrationStackResponse]
-> ReadPrec CreateWebACLMigrationStackResponse
-> ReadPrec [CreateWebACLMigrationStackResponse]
-> Read CreateWebACLMigrationStackResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWebACLMigrationStackResponse]
$creadListPrec :: ReadPrec [CreateWebACLMigrationStackResponse]
readPrec :: ReadPrec CreateWebACLMigrationStackResponse
$creadPrec :: ReadPrec CreateWebACLMigrationStackResponse
readList :: ReadS [CreateWebACLMigrationStackResponse]
$creadList :: ReadS [CreateWebACLMigrationStackResponse]
readsPrec :: Int -> ReadS CreateWebACLMigrationStackResponse
$creadsPrec :: Int -> ReadS CreateWebACLMigrationStackResponse
Prelude.Read, Int -> CreateWebACLMigrationStackResponse -> ShowS
[CreateWebACLMigrationStackResponse] -> ShowS
CreateWebACLMigrationStackResponse -> String
(Int -> CreateWebACLMigrationStackResponse -> ShowS)
-> (CreateWebACLMigrationStackResponse -> String)
-> ([CreateWebACLMigrationStackResponse] -> ShowS)
-> Show CreateWebACLMigrationStackResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWebACLMigrationStackResponse] -> ShowS
$cshowList :: [CreateWebACLMigrationStackResponse] -> ShowS
show :: CreateWebACLMigrationStackResponse -> String
$cshow :: CreateWebACLMigrationStackResponse -> String
showsPrec :: Int -> CreateWebACLMigrationStackResponse -> ShowS
$cshowsPrec :: Int -> CreateWebACLMigrationStackResponse -> ShowS
Prelude.Show, (forall x.
CreateWebACLMigrationStackResponse
-> Rep CreateWebACLMigrationStackResponse x)
-> (forall x.
Rep CreateWebACLMigrationStackResponse x
-> CreateWebACLMigrationStackResponse)
-> Generic CreateWebACLMigrationStackResponse
forall x.
Rep CreateWebACLMigrationStackResponse x
-> CreateWebACLMigrationStackResponse
forall x.
CreateWebACLMigrationStackResponse
-> Rep CreateWebACLMigrationStackResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWebACLMigrationStackResponse x
-> CreateWebACLMigrationStackResponse
$cfrom :: forall x.
CreateWebACLMigrationStackResponse
-> Rep CreateWebACLMigrationStackResponse x
Prelude.Generic)
newCreateWebACLMigrationStackResponse ::
Prelude.Int ->
Prelude.Text ->
CreateWebACLMigrationStackResponse
newCreateWebACLMigrationStackResponse :: Int -> Text -> CreateWebACLMigrationStackResponse
newCreateWebACLMigrationStackResponse
Int
pHttpStatus_
Text
pS3ObjectUrl_ =
CreateWebACLMigrationStackResponse' :: Int -> Text -> CreateWebACLMigrationStackResponse
CreateWebACLMigrationStackResponse'
{ $sel:httpStatus:CreateWebACLMigrationStackResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:s3ObjectUrl:CreateWebACLMigrationStackResponse' :: Text
s3ObjectUrl = Text
pS3ObjectUrl_
}
createWebACLMigrationStackResponse_httpStatus :: Lens.Lens' CreateWebACLMigrationStackResponse Prelude.Int
createWebACLMigrationStackResponse_httpStatus :: (Int -> f Int)
-> CreateWebACLMigrationStackResponse
-> f CreateWebACLMigrationStackResponse
createWebACLMigrationStackResponse_httpStatus = (CreateWebACLMigrationStackResponse -> Int)
-> (CreateWebACLMigrationStackResponse
-> Int -> CreateWebACLMigrationStackResponse)
-> Lens
CreateWebACLMigrationStackResponse
CreateWebACLMigrationStackResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWebACLMigrationStackResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateWebACLMigrationStackResponse' :: CreateWebACLMigrationStackResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateWebACLMigrationStackResponse
s@CreateWebACLMigrationStackResponse' {} Int
a -> CreateWebACLMigrationStackResponse
s {$sel:httpStatus:CreateWebACLMigrationStackResponse' :: Int
httpStatus = Int
a} :: CreateWebACLMigrationStackResponse)
createWebACLMigrationStackResponse_s3ObjectUrl :: Lens.Lens' CreateWebACLMigrationStackResponse Prelude.Text
createWebACLMigrationStackResponse_s3ObjectUrl :: (Text -> f Text)
-> CreateWebACLMigrationStackResponse
-> f CreateWebACLMigrationStackResponse
createWebACLMigrationStackResponse_s3ObjectUrl = (CreateWebACLMigrationStackResponse -> Text)
-> (CreateWebACLMigrationStackResponse
-> Text -> CreateWebACLMigrationStackResponse)
-> Lens
CreateWebACLMigrationStackResponse
CreateWebACLMigrationStackResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWebACLMigrationStackResponse' {Text
s3ObjectUrl :: Text
$sel:s3ObjectUrl:CreateWebACLMigrationStackResponse' :: CreateWebACLMigrationStackResponse -> Text
s3ObjectUrl} -> Text
s3ObjectUrl) (\s :: CreateWebACLMigrationStackResponse
s@CreateWebACLMigrationStackResponse' {} Text
a -> CreateWebACLMigrationStackResponse
s {$sel:s3ObjectUrl:CreateWebACLMigrationStackResponse' :: Text
s3ObjectUrl = Text
a} :: CreateWebACLMigrationStackResponse)
instance
Prelude.NFData
CreateWebACLMigrationStackResponse