{-# 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.WAFRegional.CreateWebACL
-- 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)
--
-- This is __AWS WAF Classic__ documentation. For more information, see
-- <https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html AWS WAF Classic>
-- in the developer guide.
--
-- __For the latest version of AWS WAF__, use the AWS WAFV2 API and see the
-- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html AWS WAF Developer Guide>.
-- With the latest version, AWS WAF has a single set of endpoints for
-- regional and global use.
--
-- Creates a @WebACL@, which contains the @Rules@ that identify the
-- CloudFront web requests that you want to allow, block, or count. AWS WAF
-- evaluates @Rules@ in order based on the value of @Priority@ for each
-- @Rule@.
--
-- You also specify a default action, either @ALLOW@ or @BLOCK@. If a web
-- request doesn\'t match any of the @Rules@ in a @WebACL@, AWS WAF
-- responds to the request with the default action.
--
-- To create and configure a @WebACL@, perform the following steps:
--
-- 1.  Create and update the @ByteMatchSet@ objects and other predicates
--     that you want to include in @Rules@. For more information, see
--     CreateByteMatchSet, UpdateByteMatchSet, CreateIPSet, UpdateIPSet,
--     CreateSqlInjectionMatchSet, and UpdateSqlInjectionMatchSet.
--
-- 2.  Create and update the @Rules@ that you want to include in the
--     @WebACL@. For more information, see CreateRule and UpdateRule.
--
-- 3.  Use GetChangeToken to get the change token that you provide in the
--     @ChangeToken@ parameter of a @CreateWebACL@ request.
--
-- 4.  Submit a @CreateWebACL@ request.
--
-- 5.  Use @GetChangeToken@ to get the change token that you provide in the
--     @ChangeToken@ parameter of an UpdateWebACL request.
--
-- 6.  Submit an UpdateWebACL request to specify the @Rules@ that you want
--     to include in the @WebACL@, to specify the default action, and to
--     associate the @WebACL@ with a CloudFront distribution.
--
-- For more information about how to use the AWS WAF API, see the
-- <https://docs.aws.amazon.com/waf/latest/developerguide/ AWS WAF Developer Guide>.
module Amazonka.WAFRegional.CreateWebACL
  ( -- * Creating a Request
    CreateWebACL (..),
    newCreateWebACL,

    -- * Request Lenses
    createWebACL_tags,
    createWebACL_name,
    createWebACL_metricName,
    createWebACL_defaultAction,
    createWebACL_changeToken,

    -- * Destructuring the Response
    CreateWebACLResponse (..),
    newCreateWebACLResponse,

    -- * Response Lenses
    createWebACLResponse_webACL,
    createWebACLResponse_changeToken,
    createWebACLResponse_httpStatus,
  )
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.WAFRegional.Types

-- | /See:/ 'newCreateWebACL' smart constructor.
data CreateWebACL = CreateWebACL'
  { CreateWebACL -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | A friendly name or description of the WebACL. You can\'t change @Name@
    -- after you create the @WebACL@.
    CreateWebACL -> Text
name :: Prelude.Text,
    -- | A friendly name or description for the metrics for this @WebACL@.The
    -- name can contain only alphanumeric characters (A-Z, a-z, 0-9), with
    -- maximum length 128 and minimum length one. It can\'t contain whitespace
    -- or metric names reserved for AWS WAF, including \"All\" and
    -- \"Default_Action.\" You can\'t change @MetricName@ after you create the
    -- @WebACL@.
    CreateWebACL -> Text
metricName :: Prelude.Text,
    -- | The action that you want AWS WAF to take when a request doesn\'t match
    -- the criteria specified in any of the @Rule@ objects that are associated
    -- with the @WebACL@.
    CreateWebACL -> WafAction
defaultAction :: WafAction,
    -- | The value returned by the most recent call to GetChangeToken.
    CreateWebACL -> Text
changeToken :: Prelude.Text
  }
  deriving (CreateWebACL -> CreateWebACL -> Bool
(CreateWebACL -> CreateWebACL -> Bool)
-> (CreateWebACL -> CreateWebACL -> Bool) -> Eq CreateWebACL
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWebACL -> CreateWebACL -> Bool
$c/= :: CreateWebACL -> CreateWebACL -> Bool
== :: CreateWebACL -> CreateWebACL -> Bool
$c== :: CreateWebACL -> CreateWebACL -> Bool
Prelude.Eq, ReadPrec [CreateWebACL]
ReadPrec CreateWebACL
Int -> ReadS CreateWebACL
ReadS [CreateWebACL]
(Int -> ReadS CreateWebACL)
-> ReadS [CreateWebACL]
-> ReadPrec CreateWebACL
-> ReadPrec [CreateWebACL]
-> Read CreateWebACL
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWebACL]
$creadListPrec :: ReadPrec [CreateWebACL]
readPrec :: ReadPrec CreateWebACL
$creadPrec :: ReadPrec CreateWebACL
readList :: ReadS [CreateWebACL]
$creadList :: ReadS [CreateWebACL]
readsPrec :: Int -> ReadS CreateWebACL
$creadsPrec :: Int -> ReadS CreateWebACL
Prelude.Read, Int -> CreateWebACL -> ShowS
[CreateWebACL] -> ShowS
CreateWebACL -> String
(Int -> CreateWebACL -> ShowS)
-> (CreateWebACL -> String)
-> ([CreateWebACL] -> ShowS)
-> Show CreateWebACL
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWebACL] -> ShowS
$cshowList :: [CreateWebACL] -> ShowS
show :: CreateWebACL -> String
$cshow :: CreateWebACL -> String
showsPrec :: Int -> CreateWebACL -> ShowS
$cshowsPrec :: Int -> CreateWebACL -> ShowS
Prelude.Show, (forall x. CreateWebACL -> Rep CreateWebACL x)
-> (forall x. Rep CreateWebACL x -> CreateWebACL)
-> Generic CreateWebACL
forall x. Rep CreateWebACL x -> CreateWebACL
forall x. CreateWebACL -> Rep CreateWebACL x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWebACL x -> CreateWebACL
$cfrom :: forall x. CreateWebACL -> Rep CreateWebACL x
Prelude.Generic)

-- |
-- Create a value of 'CreateWebACL' 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:
--
-- 'tags', 'createWebACL_tags' -
--
-- 'name', 'createWebACL_name' - A friendly name or description of the WebACL. You can\'t change @Name@
-- after you create the @WebACL@.
--
-- 'metricName', 'createWebACL_metricName' - A friendly name or description for the metrics for this @WebACL@.The
-- name can contain only alphanumeric characters (A-Z, a-z, 0-9), with
-- maximum length 128 and minimum length one. It can\'t contain whitespace
-- or metric names reserved for AWS WAF, including \"All\" and
-- \"Default_Action.\" You can\'t change @MetricName@ after you create the
-- @WebACL@.
--
-- 'defaultAction', 'createWebACL_defaultAction' - The action that you want AWS WAF to take when a request doesn\'t match
-- the criteria specified in any of the @Rule@ objects that are associated
-- with the @WebACL@.
--
-- 'changeToken', 'createWebACL_changeToken' - The value returned by the most recent call to GetChangeToken.
newCreateWebACL ::
  -- | 'name'
  Prelude.Text ->
  -- | 'metricName'
  Prelude.Text ->
  -- | 'defaultAction'
  WafAction ->
  -- | 'changeToken'
  Prelude.Text ->
  CreateWebACL
newCreateWebACL :: Text -> Text -> WafAction -> Text -> CreateWebACL
newCreateWebACL
  Text
pName_
  Text
pMetricName_
  WafAction
pDefaultAction_
  Text
pChangeToken_ =
    CreateWebACL' :: Maybe (NonEmpty Tag)
-> Text -> Text -> WafAction -> Text -> CreateWebACL
CreateWebACL'
      { $sel:tags:CreateWebACL' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateWebACL' :: Text
name = Text
pName_,
        $sel:metricName:CreateWebACL' :: Text
metricName = Text
pMetricName_,
        $sel:defaultAction:CreateWebACL' :: WafAction
defaultAction = WafAction
pDefaultAction_,
        $sel:changeToken:CreateWebACL' :: Text
changeToken = Text
pChangeToken_
      }

-- |
createWebACL_tags :: Lens.Lens' CreateWebACL (Prelude.Maybe (Prelude.NonEmpty Tag))
createWebACL_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateWebACL -> f CreateWebACL
createWebACL_tags = (CreateWebACL -> Maybe (NonEmpty Tag))
-> (CreateWebACL -> Maybe (NonEmpty Tag) -> CreateWebACL)
-> Lens
     CreateWebACL
     CreateWebACL
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWebACL' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateWebACL' :: CreateWebACL -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateWebACL
s@CreateWebACL' {} Maybe (NonEmpty Tag)
a -> CreateWebACL
s {$sel:tags:CreateWebACL' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateWebACL) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateWebACL -> f CreateWebACL)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateWebACL
-> f CreateWebACL
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A friendly name or description of the WebACL. You can\'t change @Name@
-- after you create the @WebACL@.
createWebACL_name :: Lens.Lens' CreateWebACL Prelude.Text
createWebACL_name :: (Text -> f Text) -> CreateWebACL -> f CreateWebACL
createWebACL_name = (CreateWebACL -> Text)
-> (CreateWebACL -> Text -> CreateWebACL)
-> Lens CreateWebACL CreateWebACL Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWebACL' {Text
name :: Text
$sel:name:CreateWebACL' :: CreateWebACL -> Text
name} -> Text
name) (\s :: CreateWebACL
s@CreateWebACL' {} Text
a -> CreateWebACL
s {$sel:name:CreateWebACL' :: Text
name = Text
a} :: CreateWebACL)

-- | A friendly name or description for the metrics for this @WebACL@.The
-- name can contain only alphanumeric characters (A-Z, a-z, 0-9), with
-- maximum length 128 and minimum length one. It can\'t contain whitespace
-- or metric names reserved for AWS WAF, including \"All\" and
-- \"Default_Action.\" You can\'t change @MetricName@ after you create the
-- @WebACL@.
createWebACL_metricName :: Lens.Lens' CreateWebACL Prelude.Text
createWebACL_metricName :: (Text -> f Text) -> CreateWebACL -> f CreateWebACL
createWebACL_metricName = (CreateWebACL -> Text)
-> (CreateWebACL -> Text -> CreateWebACL)
-> Lens CreateWebACL CreateWebACL Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWebACL' {Text
metricName :: Text
$sel:metricName:CreateWebACL' :: CreateWebACL -> Text
metricName} -> Text
metricName) (\s :: CreateWebACL
s@CreateWebACL' {} Text
a -> CreateWebACL
s {$sel:metricName:CreateWebACL' :: Text
metricName = Text
a} :: CreateWebACL)

-- | The action that you want AWS WAF to take when a request doesn\'t match
-- the criteria specified in any of the @Rule@ objects that are associated
-- with the @WebACL@.
createWebACL_defaultAction :: Lens.Lens' CreateWebACL WafAction
createWebACL_defaultAction :: (WafAction -> f WafAction) -> CreateWebACL -> f CreateWebACL
createWebACL_defaultAction = (CreateWebACL -> WafAction)
-> (CreateWebACL -> WafAction -> CreateWebACL)
-> Lens CreateWebACL CreateWebACL WafAction WafAction
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWebACL' {WafAction
defaultAction :: WafAction
$sel:defaultAction:CreateWebACL' :: CreateWebACL -> WafAction
defaultAction} -> WafAction
defaultAction) (\s :: CreateWebACL
s@CreateWebACL' {} WafAction
a -> CreateWebACL
s {$sel:defaultAction:CreateWebACL' :: WafAction
defaultAction = WafAction
a} :: CreateWebACL)

-- | The value returned by the most recent call to GetChangeToken.
createWebACL_changeToken :: Lens.Lens' CreateWebACL Prelude.Text
createWebACL_changeToken :: (Text -> f Text) -> CreateWebACL -> f CreateWebACL
createWebACL_changeToken = (CreateWebACL -> Text)
-> (CreateWebACL -> Text -> CreateWebACL)
-> Lens CreateWebACL CreateWebACL Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWebACL' {Text
changeToken :: Text
$sel:changeToken:CreateWebACL' :: CreateWebACL -> Text
changeToken} -> Text
changeToken) (\s :: CreateWebACL
s@CreateWebACL' {} Text
a -> CreateWebACL
s {$sel:changeToken:CreateWebACL' :: Text
changeToken = Text
a} :: CreateWebACL)

instance Core.AWSRequest CreateWebACL where
  type AWSResponse CreateWebACL = CreateWebACLResponse
  request :: CreateWebACL -> Request CreateWebACL
request = Service -> CreateWebACL -> Request CreateWebACL
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateWebACL
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateWebACL)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateWebACL))
-> Logger
-> Service
-> Proxy CreateWebACL
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateWebACL)))
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 ->
          Maybe WebACL -> Maybe Text -> Int -> CreateWebACLResponse
CreateWebACLResponse'
            (Maybe WebACL -> Maybe Text -> Int -> CreateWebACLResponse)
-> Either String (Maybe WebACL)
-> Either String (Maybe Text -> Int -> CreateWebACLResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe WebACL)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"WebACL")
            Either String (Maybe Text -> Int -> CreateWebACLResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateWebACLResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ChangeToken")
            Either String (Int -> CreateWebACLResponse)
-> Either String Int -> Either String CreateWebACLResponse
forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable CreateWebACL

instance Prelude.NFData CreateWebACL

instance Core.ToHeaders CreateWebACL where
  toHeaders :: CreateWebACL -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateWebACL -> 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_Regional_20161128.CreateWebACL" ::
                          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 CreateWebACL where
  toJSON :: CreateWebACL -> Value
toJSON CreateWebACL' {Maybe (NonEmpty Tag)
Text
WafAction
changeToken :: Text
defaultAction :: WafAction
metricName :: Text
name :: Text
tags :: Maybe (NonEmpty Tag)
$sel:changeToken:CreateWebACL' :: CreateWebACL -> Text
$sel:defaultAction:CreateWebACL' :: CreateWebACL -> WafAction
$sel:metricName:CreateWebACL' :: CreateWebACL -> Text
$sel:name:CreateWebACL' :: CreateWebACL -> Text
$sel:tags:CreateWebACL' :: CreateWebACL -> Maybe (NonEmpty Tag)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MetricName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
metricName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DefaultAction" Text -> WafAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= WafAction
defaultAction),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ChangeToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
changeToken)
          ]
      )

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

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

-- | /See:/ 'newCreateWebACLResponse' smart constructor.
data CreateWebACLResponse = CreateWebACLResponse'
  { -- | The WebACL returned in the @CreateWebACL@ response.
    CreateWebACLResponse -> Maybe WebACL
webACL :: Prelude.Maybe WebACL,
    -- | The @ChangeToken@ that you used to submit the @CreateWebACL@ request.
    -- You can also use this value to query the status of the request. For more
    -- information, see GetChangeTokenStatus.
    CreateWebACLResponse -> Maybe Text
changeToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateWebACLResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateWebACLResponse -> CreateWebACLResponse -> Bool
(CreateWebACLResponse -> CreateWebACLResponse -> Bool)
-> (CreateWebACLResponse -> CreateWebACLResponse -> Bool)
-> Eq CreateWebACLResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWebACLResponse -> CreateWebACLResponse -> Bool
$c/= :: CreateWebACLResponse -> CreateWebACLResponse -> Bool
== :: CreateWebACLResponse -> CreateWebACLResponse -> Bool
$c== :: CreateWebACLResponse -> CreateWebACLResponse -> Bool
Prelude.Eq, ReadPrec [CreateWebACLResponse]
ReadPrec CreateWebACLResponse
Int -> ReadS CreateWebACLResponse
ReadS [CreateWebACLResponse]
(Int -> ReadS CreateWebACLResponse)
-> ReadS [CreateWebACLResponse]
-> ReadPrec CreateWebACLResponse
-> ReadPrec [CreateWebACLResponse]
-> Read CreateWebACLResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWebACLResponse]
$creadListPrec :: ReadPrec [CreateWebACLResponse]
readPrec :: ReadPrec CreateWebACLResponse
$creadPrec :: ReadPrec CreateWebACLResponse
readList :: ReadS [CreateWebACLResponse]
$creadList :: ReadS [CreateWebACLResponse]
readsPrec :: Int -> ReadS CreateWebACLResponse
$creadsPrec :: Int -> ReadS CreateWebACLResponse
Prelude.Read, Int -> CreateWebACLResponse -> ShowS
[CreateWebACLResponse] -> ShowS
CreateWebACLResponse -> String
(Int -> CreateWebACLResponse -> ShowS)
-> (CreateWebACLResponse -> String)
-> ([CreateWebACLResponse] -> ShowS)
-> Show CreateWebACLResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWebACLResponse] -> ShowS
$cshowList :: [CreateWebACLResponse] -> ShowS
show :: CreateWebACLResponse -> String
$cshow :: CreateWebACLResponse -> String
showsPrec :: Int -> CreateWebACLResponse -> ShowS
$cshowsPrec :: Int -> CreateWebACLResponse -> ShowS
Prelude.Show, (forall x. CreateWebACLResponse -> Rep CreateWebACLResponse x)
-> (forall x. Rep CreateWebACLResponse x -> CreateWebACLResponse)
-> Generic CreateWebACLResponse
forall x. Rep CreateWebACLResponse x -> CreateWebACLResponse
forall x. CreateWebACLResponse -> Rep CreateWebACLResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWebACLResponse x -> CreateWebACLResponse
$cfrom :: forall x. CreateWebACLResponse -> Rep CreateWebACLResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWebACLResponse' 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:
--
-- 'webACL', 'createWebACLResponse_webACL' - The WebACL returned in the @CreateWebACL@ response.
--
-- 'changeToken', 'createWebACLResponse_changeToken' - The @ChangeToken@ that you used to submit the @CreateWebACL@ request.
-- You can also use this value to query the status of the request. For more
-- information, see GetChangeTokenStatus.
--
-- 'httpStatus', 'createWebACLResponse_httpStatus' - The response's http status code.
newCreateWebACLResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWebACLResponse
newCreateWebACLResponse :: Int -> CreateWebACLResponse
newCreateWebACLResponse Int
pHttpStatus_ =
  CreateWebACLResponse' :: Maybe WebACL -> Maybe Text -> Int -> CreateWebACLResponse
CreateWebACLResponse'
    { $sel:webACL:CreateWebACLResponse' :: Maybe WebACL
webACL = Maybe WebACL
forall a. Maybe a
Prelude.Nothing,
      $sel:changeToken:CreateWebACLResponse' :: Maybe Text
changeToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWebACLResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The WebACL returned in the @CreateWebACL@ response.
createWebACLResponse_webACL :: Lens.Lens' CreateWebACLResponse (Prelude.Maybe WebACL)
createWebACLResponse_webACL :: (Maybe WebACL -> f (Maybe WebACL))
-> CreateWebACLResponse -> f CreateWebACLResponse
createWebACLResponse_webACL = (CreateWebACLResponse -> Maybe WebACL)
-> (CreateWebACLResponse -> Maybe WebACL -> CreateWebACLResponse)
-> Lens
     CreateWebACLResponse
     CreateWebACLResponse
     (Maybe WebACL)
     (Maybe WebACL)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWebACLResponse' {Maybe WebACL
webACL :: Maybe WebACL
$sel:webACL:CreateWebACLResponse' :: CreateWebACLResponse -> Maybe WebACL
webACL} -> Maybe WebACL
webACL) (\s :: CreateWebACLResponse
s@CreateWebACLResponse' {} Maybe WebACL
a -> CreateWebACLResponse
s {$sel:webACL:CreateWebACLResponse' :: Maybe WebACL
webACL = Maybe WebACL
a} :: CreateWebACLResponse)

-- | The @ChangeToken@ that you used to submit the @CreateWebACL@ request.
-- You can also use this value to query the status of the request. For more
-- information, see GetChangeTokenStatus.
createWebACLResponse_changeToken :: Lens.Lens' CreateWebACLResponse (Prelude.Maybe Prelude.Text)
createWebACLResponse_changeToken :: (Maybe Text -> f (Maybe Text))
-> CreateWebACLResponse -> f CreateWebACLResponse
createWebACLResponse_changeToken = (CreateWebACLResponse -> Maybe Text)
-> (CreateWebACLResponse -> Maybe Text -> CreateWebACLResponse)
-> Lens
     CreateWebACLResponse CreateWebACLResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWebACLResponse' {Maybe Text
changeToken :: Maybe Text
$sel:changeToken:CreateWebACLResponse' :: CreateWebACLResponse -> Maybe Text
changeToken} -> Maybe Text
changeToken) (\s :: CreateWebACLResponse
s@CreateWebACLResponse' {} Maybe Text
a -> CreateWebACLResponse
s {$sel:changeToken:CreateWebACLResponse' :: Maybe Text
changeToken = Maybe Text
a} :: CreateWebACLResponse)

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

instance Prelude.NFData CreateWebACLResponse