{-# 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.WAFV2.UpdateWebACL
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the specified WebACL. While updating a web ACL, WAF provides
-- continuous coverage to the resources that you have associated with the
-- web ACL.
--
-- When you make changes to web ACLs or web ACL components, like rules and
-- rule groups, WAF propagates the changes everywhere that the web ACL and
-- its components are stored and used. Your changes are applied within
-- seconds, but there might be a brief period of inconsistency when the
-- changes have arrived in some places and not in others. So, for example,
-- if you change a rule action setting, the action might be the old action
-- in one area and the new action in another area. Or if you add an IP
-- address to an IP set used in a blocking rule, the new address might
-- briefly be blocked in one area while still allowed in another. This
-- temporary inconsistency can occur when you first associate a web ACL
-- with an Amazon Web Services resource and when you change a web ACL that
-- is already associated with a resource. Generally, any inconsistencies of
-- this type last only a few seconds.
--
-- This operation completely replaces the mutable specifications that you
-- already have for the web ACL with the ones that you provide to this
-- call. To modify the web ACL, retrieve it by calling GetWebACL, update
-- the settings as needed, and then provide the complete web ACL
-- specification to this call.
--
-- A web ACL defines a collection of rules to use to inspect and control
-- web requests. Each rule has an action defined (allow, block, or count)
-- for requests that match the statement of the rule. In the web ACL, you
-- assign a default action to take (allow, block) for any request that does
-- not match any of the rules. The rules in a web ACL can be a combination
-- of the types Rule, RuleGroup, and managed rule group. You can associate
-- a web ACL with one or more Amazon Web Services resources to protect. The
-- resources can be an Amazon CloudFront distribution, an Amazon API
-- Gateway REST API, an Application Load Balancer, an AppSync GraphQL API,
-- or an Amazon Cognito user pool.
module Amazonka.WAFV2.UpdateWebACL
  ( -- * Creating a Request
    UpdateWebACL (..),
    newUpdateWebACL,

    -- * Request Lenses
    updateWebACL_captchaConfig,
    updateWebACL_challengeConfig,
    updateWebACL_customResponseBodies,
    updateWebACL_description,
    updateWebACL_rules,
    updateWebACL_tokenDomains,
    updateWebACL_name,
    updateWebACL_scope,
    updateWebACL_id,
    updateWebACL_defaultAction,
    updateWebACL_visibilityConfig,
    updateWebACL_lockToken,

    -- * Destructuring the Response
    UpdateWebACLResponse (..),
    newUpdateWebACLResponse,

    -- * Response Lenses
    updateWebACLResponse_nextLockToken,
    updateWebACLResponse_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.WAFV2.Types

-- | /See:/ 'newUpdateWebACL' smart constructor.
data UpdateWebACL = UpdateWebACL'
  { -- | Specifies how WAF should handle @CAPTCHA@ evaluations for rules that
    -- don\'t have their own @CaptchaConfig@ settings. If you don\'t specify
    -- this, WAF uses its default settings for @CaptchaConfig@.
    UpdateWebACL -> Maybe CaptchaConfig
captchaConfig :: Prelude.Maybe CaptchaConfig,
    -- | Specifies how WAF should handle challenge evaluations for rules that
    -- don\'t have their own @ChallengeConfig@ settings. If you don\'t specify
    -- this, WAF uses its default settings for @ChallengeConfig@.
    UpdateWebACL -> Maybe ChallengeConfig
challengeConfig :: Prelude.Maybe ChallengeConfig,
    -- | A map of custom response keys and content bodies. When you create a rule
    -- with a block action, you can send a custom response to the web request.
    -- You define these for the web ACL, and then use them in the rules and
    -- default actions that you define in the web ACL.
    --
    -- For information about customizing web requests and responses, see
    -- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html Customizing web requests and responses in WAF>
    -- in the
    -- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html WAF Developer Guide>.
    --
    -- For information about the limits on count and size for custom request
    -- and response settings, see
    -- <https://docs.aws.amazon.com/waf/latest/developerguide/limits.html WAF quotas>
    -- in the
    -- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html WAF Developer Guide>.
    UpdateWebACL -> Maybe (HashMap Text CustomResponseBody)
customResponseBodies :: Prelude.Maybe (Prelude.HashMap Prelude.Text CustomResponseBody),
    -- | A description of the web ACL that helps with identification.
    UpdateWebACL -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The Rule statements used to identify the web requests that you want to
    -- allow, block, or count. Each rule includes one top-level statement that
    -- WAF uses to identify matching web requests, and parameters that govern
    -- how WAF handles them.
    UpdateWebACL -> Maybe [Rule]
rules :: Prelude.Maybe [Rule],
    -- | Specifies the domains that WAF should accept in a web request token.
    -- This enables the use of tokens across multiple protected websites. When
    -- WAF provides a token, it uses the domain of the Amazon Web Services
    -- resource that the web ACL is protecting. If you don\'t specify a list of
    -- token domains, WAF accepts tokens only for the domain of the protected
    -- resource. With a token domain list, WAF accepts the resource\'s host
    -- domain plus all domains in the token domain list, including their
    -- prefixed subdomains.
    --
    -- Example JSON:
    -- @\"TokenDomains\": { \"mywebsite.com\", \"myotherwebsite.com\" }@
    --
    -- Public suffixes aren\'t allowed. For example, you can\'t use @usa.gov@
    -- or @co.uk@ as token domains.
    UpdateWebACL -> Maybe (NonEmpty Text)
tokenDomains :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The name of the web ACL. You cannot change the name of a web ACL after
    -- you create it.
    UpdateWebACL -> Text
name :: Prelude.Text,
    -- | Specifies whether this is for an Amazon CloudFront distribution or for a
    -- regional application. A regional application can be an Application Load
    -- Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API,
    -- or an Amazon Cognito user pool.
    --
    -- To work with CloudFront, you must also specify the Region US East (N.
    -- Virginia) as follows:
    --
    -- -   CLI - Specify the Region when you use the CloudFront scope:
    --     @--scope=CLOUDFRONT --region=us-east-1@.
    --
    -- -   API and SDKs - For all calls, use the Region endpoint us-east-1.
    UpdateWebACL -> Scope
scope :: Scope,
    -- | The unique identifier for the web ACL. This ID is returned in the
    -- responses to create and list commands. You provide it to operations like
    -- update and delete.
    UpdateWebACL -> Text
id :: Prelude.Text,
    -- | The action to perform if none of the @Rules@ contained in the @WebACL@
    -- match.
    UpdateWebACL -> DefaultAction
defaultAction :: DefaultAction,
    -- | Defines and enables Amazon CloudWatch metrics and web request sample
    -- collection.
    UpdateWebACL -> VisibilityConfig
visibilityConfig :: VisibilityConfig,
    -- | A token used for optimistic locking. WAF returns a token to your @get@
    -- and @list@ requests, to mark the state of the entity at the time of the
    -- request. To make changes to the entity associated with the token, you
    -- provide the token to operations like @update@ and @delete@. WAF uses the
    -- token to ensure that no changes have been made to the entity since you
    -- last retrieved it. If a change has been made, the update fails with a
    -- @WAFOptimisticLockException@. If this happens, perform another @get@,
    -- and use the new token returned by that operation.
    UpdateWebACL -> Text
lockToken :: Prelude.Text
  }
  deriving (UpdateWebACL -> UpdateWebACL -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateWebACL -> UpdateWebACL -> Bool
$c/= :: UpdateWebACL -> UpdateWebACL -> Bool
== :: UpdateWebACL -> UpdateWebACL -> Bool
$c== :: UpdateWebACL -> UpdateWebACL -> Bool
Prelude.Eq, ReadPrec [UpdateWebACL]
ReadPrec UpdateWebACL
Int -> ReadS UpdateWebACL
ReadS [UpdateWebACL]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateWebACL]
$creadListPrec :: ReadPrec [UpdateWebACL]
readPrec :: ReadPrec UpdateWebACL
$creadPrec :: ReadPrec UpdateWebACL
readList :: ReadS [UpdateWebACL]
$creadList :: ReadS [UpdateWebACL]
readsPrec :: Int -> ReadS UpdateWebACL
$creadsPrec :: Int -> ReadS UpdateWebACL
Prelude.Read, Int -> UpdateWebACL -> ShowS
[UpdateWebACL] -> ShowS
UpdateWebACL -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateWebACL] -> ShowS
$cshowList :: [UpdateWebACL] -> ShowS
show :: UpdateWebACL -> String
$cshow :: UpdateWebACL -> String
showsPrec :: Int -> UpdateWebACL -> ShowS
$cshowsPrec :: Int -> UpdateWebACL -> ShowS
Prelude.Show, forall x. Rep UpdateWebACL x -> UpdateWebACL
forall x. UpdateWebACL -> Rep UpdateWebACL x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateWebACL x -> UpdateWebACL
$cfrom :: forall x. UpdateWebACL -> Rep UpdateWebACL x
Prelude.Generic)

-- |
-- Create a value of 'UpdateWebACL' 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:
--
-- 'captchaConfig', 'updateWebACL_captchaConfig' - Specifies how WAF should handle @CAPTCHA@ evaluations for rules that
-- don\'t have their own @CaptchaConfig@ settings. If you don\'t specify
-- this, WAF uses its default settings for @CaptchaConfig@.
--
-- 'challengeConfig', 'updateWebACL_challengeConfig' - Specifies how WAF should handle challenge evaluations for rules that
-- don\'t have their own @ChallengeConfig@ settings. If you don\'t specify
-- this, WAF uses its default settings for @ChallengeConfig@.
--
-- 'customResponseBodies', 'updateWebACL_customResponseBodies' - A map of custom response keys and content bodies. When you create a rule
-- with a block action, you can send a custom response to the web request.
-- You define these for the web ACL, and then use them in the rules and
-- default actions that you define in the web ACL.
--
-- For information about customizing web requests and responses, see
-- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html Customizing web requests and responses in WAF>
-- in the
-- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html WAF Developer Guide>.
--
-- For information about the limits on count and size for custom request
-- and response settings, see
-- <https://docs.aws.amazon.com/waf/latest/developerguide/limits.html WAF quotas>
-- in the
-- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html WAF Developer Guide>.
--
-- 'description', 'updateWebACL_description' - A description of the web ACL that helps with identification.
--
-- 'rules', 'updateWebACL_rules' - The Rule statements used to identify the web requests that you want to
-- allow, block, or count. Each rule includes one top-level statement that
-- WAF uses to identify matching web requests, and parameters that govern
-- how WAF handles them.
--
-- 'tokenDomains', 'updateWebACL_tokenDomains' - Specifies the domains that WAF should accept in a web request token.
-- This enables the use of tokens across multiple protected websites. When
-- WAF provides a token, it uses the domain of the Amazon Web Services
-- resource that the web ACL is protecting. If you don\'t specify a list of
-- token domains, WAF accepts tokens only for the domain of the protected
-- resource. With a token domain list, WAF accepts the resource\'s host
-- domain plus all domains in the token domain list, including their
-- prefixed subdomains.
--
-- Example JSON:
-- @\"TokenDomains\": { \"mywebsite.com\", \"myotherwebsite.com\" }@
--
-- Public suffixes aren\'t allowed. For example, you can\'t use @usa.gov@
-- or @co.uk@ as token domains.
--
-- 'name', 'updateWebACL_name' - The name of the web ACL. You cannot change the name of a web ACL after
-- you create it.
--
-- 'scope', 'updateWebACL_scope' - Specifies whether this is for an Amazon CloudFront distribution or for a
-- regional application. A regional application can be an Application Load
-- Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API,
-- or an Amazon Cognito user pool.
--
-- To work with CloudFront, you must also specify the Region US East (N.
-- Virginia) as follows:
--
-- -   CLI - Specify the Region when you use the CloudFront scope:
--     @--scope=CLOUDFRONT --region=us-east-1@.
--
-- -   API and SDKs - For all calls, use the Region endpoint us-east-1.
--
-- 'id', 'updateWebACL_id' - The unique identifier for the web ACL. This ID is returned in the
-- responses to create and list commands. You provide it to operations like
-- update and delete.
--
-- 'defaultAction', 'updateWebACL_defaultAction' - The action to perform if none of the @Rules@ contained in the @WebACL@
-- match.
--
-- 'visibilityConfig', 'updateWebACL_visibilityConfig' - Defines and enables Amazon CloudWatch metrics and web request sample
-- collection.
--
-- 'lockToken', 'updateWebACL_lockToken' - A token used for optimistic locking. WAF returns a token to your @get@
-- and @list@ requests, to mark the state of the entity at the time of the
-- request. To make changes to the entity associated with the token, you
-- provide the token to operations like @update@ and @delete@. WAF uses the
-- token to ensure that no changes have been made to the entity since you
-- last retrieved it. If a change has been made, the update fails with a
-- @WAFOptimisticLockException@. If this happens, perform another @get@,
-- and use the new token returned by that operation.
newUpdateWebACL ::
  -- | 'name'
  Prelude.Text ->
  -- | 'scope'
  Scope ->
  -- | 'id'
  Prelude.Text ->
  -- | 'defaultAction'
  DefaultAction ->
  -- | 'visibilityConfig'
  VisibilityConfig ->
  -- | 'lockToken'
  Prelude.Text ->
  UpdateWebACL
newUpdateWebACL :: Text
-> Scope
-> Text
-> DefaultAction
-> VisibilityConfig
-> Text
-> UpdateWebACL
newUpdateWebACL
  Text
pName_
  Scope
pScope_
  Text
pId_
  DefaultAction
pDefaultAction_
  VisibilityConfig
pVisibilityConfig_
  Text
pLockToken_ =
    UpdateWebACL'
      { $sel:captchaConfig:UpdateWebACL' :: Maybe CaptchaConfig
captchaConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:challengeConfig:UpdateWebACL' :: Maybe ChallengeConfig
challengeConfig = forall a. Maybe a
Prelude.Nothing,
        $sel:customResponseBodies:UpdateWebACL' :: Maybe (HashMap Text CustomResponseBody)
customResponseBodies = forall a. Maybe a
Prelude.Nothing,
        $sel:description:UpdateWebACL' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:rules:UpdateWebACL' :: Maybe [Rule]
rules = forall a. Maybe a
Prelude.Nothing,
        $sel:tokenDomains:UpdateWebACL' :: Maybe (NonEmpty Text)
tokenDomains = forall a. Maybe a
Prelude.Nothing,
        $sel:name:UpdateWebACL' :: Text
name = Text
pName_,
        $sel:scope:UpdateWebACL' :: Scope
scope = Scope
pScope_,
        $sel:id:UpdateWebACL' :: Text
id = Text
pId_,
        $sel:defaultAction:UpdateWebACL' :: DefaultAction
defaultAction = DefaultAction
pDefaultAction_,
        $sel:visibilityConfig:UpdateWebACL' :: VisibilityConfig
visibilityConfig = VisibilityConfig
pVisibilityConfig_,
        $sel:lockToken:UpdateWebACL' :: Text
lockToken = Text
pLockToken_
      }

-- | Specifies how WAF should handle @CAPTCHA@ evaluations for rules that
-- don\'t have their own @CaptchaConfig@ settings. If you don\'t specify
-- this, WAF uses its default settings for @CaptchaConfig@.
updateWebACL_captchaConfig :: Lens.Lens' UpdateWebACL (Prelude.Maybe CaptchaConfig)
updateWebACL_captchaConfig :: Lens' UpdateWebACL (Maybe CaptchaConfig)
updateWebACL_captchaConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACL' {Maybe CaptchaConfig
captchaConfig :: Maybe CaptchaConfig
$sel:captchaConfig:UpdateWebACL' :: UpdateWebACL -> Maybe CaptchaConfig
captchaConfig} -> Maybe CaptchaConfig
captchaConfig) (\s :: UpdateWebACL
s@UpdateWebACL' {} Maybe CaptchaConfig
a -> UpdateWebACL
s {$sel:captchaConfig:UpdateWebACL' :: Maybe CaptchaConfig
captchaConfig = Maybe CaptchaConfig
a} :: UpdateWebACL)

-- | Specifies how WAF should handle challenge evaluations for rules that
-- don\'t have their own @ChallengeConfig@ settings. If you don\'t specify
-- this, WAF uses its default settings for @ChallengeConfig@.
updateWebACL_challengeConfig :: Lens.Lens' UpdateWebACL (Prelude.Maybe ChallengeConfig)
updateWebACL_challengeConfig :: Lens' UpdateWebACL (Maybe ChallengeConfig)
updateWebACL_challengeConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACL' {Maybe ChallengeConfig
challengeConfig :: Maybe ChallengeConfig
$sel:challengeConfig:UpdateWebACL' :: UpdateWebACL -> Maybe ChallengeConfig
challengeConfig} -> Maybe ChallengeConfig
challengeConfig) (\s :: UpdateWebACL
s@UpdateWebACL' {} Maybe ChallengeConfig
a -> UpdateWebACL
s {$sel:challengeConfig:UpdateWebACL' :: Maybe ChallengeConfig
challengeConfig = Maybe ChallengeConfig
a} :: UpdateWebACL)

-- | A map of custom response keys and content bodies. When you create a rule
-- with a block action, you can send a custom response to the web request.
-- You define these for the web ACL, and then use them in the rules and
-- default actions that you define in the web ACL.
--
-- For information about customizing web requests and responses, see
-- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html Customizing web requests and responses in WAF>
-- in the
-- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html WAF Developer Guide>.
--
-- For information about the limits on count and size for custom request
-- and response settings, see
-- <https://docs.aws.amazon.com/waf/latest/developerguide/limits.html WAF quotas>
-- in the
-- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html WAF Developer Guide>.
updateWebACL_customResponseBodies :: Lens.Lens' UpdateWebACL (Prelude.Maybe (Prelude.HashMap Prelude.Text CustomResponseBody))
updateWebACL_customResponseBodies :: Lens' UpdateWebACL (Maybe (HashMap Text CustomResponseBody))
updateWebACL_customResponseBodies = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACL' {Maybe (HashMap Text CustomResponseBody)
customResponseBodies :: Maybe (HashMap Text CustomResponseBody)
$sel:customResponseBodies:UpdateWebACL' :: UpdateWebACL -> Maybe (HashMap Text CustomResponseBody)
customResponseBodies} -> Maybe (HashMap Text CustomResponseBody)
customResponseBodies) (\s :: UpdateWebACL
s@UpdateWebACL' {} Maybe (HashMap Text CustomResponseBody)
a -> UpdateWebACL
s {$sel:customResponseBodies:UpdateWebACL' :: Maybe (HashMap Text CustomResponseBody)
customResponseBodies = Maybe (HashMap Text CustomResponseBody)
a} :: UpdateWebACL) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A description of the web ACL that helps with identification.
updateWebACL_description :: Lens.Lens' UpdateWebACL (Prelude.Maybe Prelude.Text)
updateWebACL_description :: Lens' UpdateWebACL (Maybe Text)
updateWebACL_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACL' {Maybe Text
description :: Maybe Text
$sel:description:UpdateWebACL' :: UpdateWebACL -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateWebACL
s@UpdateWebACL' {} Maybe Text
a -> UpdateWebACL
s {$sel:description:UpdateWebACL' :: Maybe Text
description = Maybe Text
a} :: UpdateWebACL)

-- | The Rule statements used to identify the web requests that you want to
-- allow, block, or count. Each rule includes one top-level statement that
-- WAF uses to identify matching web requests, and parameters that govern
-- how WAF handles them.
updateWebACL_rules :: Lens.Lens' UpdateWebACL (Prelude.Maybe [Rule])
updateWebACL_rules :: Lens' UpdateWebACL (Maybe [Rule])
updateWebACL_rules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACL' {Maybe [Rule]
rules :: Maybe [Rule]
$sel:rules:UpdateWebACL' :: UpdateWebACL -> Maybe [Rule]
rules} -> Maybe [Rule]
rules) (\s :: UpdateWebACL
s@UpdateWebACL' {} Maybe [Rule]
a -> UpdateWebACL
s {$sel:rules:UpdateWebACL' :: Maybe [Rule]
rules = Maybe [Rule]
a} :: UpdateWebACL) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies the domains that WAF should accept in a web request token.
-- This enables the use of tokens across multiple protected websites. When
-- WAF provides a token, it uses the domain of the Amazon Web Services
-- resource that the web ACL is protecting. If you don\'t specify a list of
-- token domains, WAF accepts tokens only for the domain of the protected
-- resource. With a token domain list, WAF accepts the resource\'s host
-- domain plus all domains in the token domain list, including their
-- prefixed subdomains.
--
-- Example JSON:
-- @\"TokenDomains\": { \"mywebsite.com\", \"myotherwebsite.com\" }@
--
-- Public suffixes aren\'t allowed. For example, you can\'t use @usa.gov@
-- or @co.uk@ as token domains.
updateWebACL_tokenDomains :: Lens.Lens' UpdateWebACL (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateWebACL_tokenDomains :: Lens' UpdateWebACL (Maybe (NonEmpty Text))
updateWebACL_tokenDomains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACL' {Maybe (NonEmpty Text)
tokenDomains :: Maybe (NonEmpty Text)
$sel:tokenDomains:UpdateWebACL' :: UpdateWebACL -> Maybe (NonEmpty Text)
tokenDomains} -> Maybe (NonEmpty Text)
tokenDomains) (\s :: UpdateWebACL
s@UpdateWebACL' {} Maybe (NonEmpty Text)
a -> UpdateWebACL
s {$sel:tokenDomains:UpdateWebACL' :: Maybe (NonEmpty Text)
tokenDomains = Maybe (NonEmpty Text)
a} :: UpdateWebACL) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the web ACL. You cannot change the name of a web ACL after
-- you create it.
updateWebACL_name :: Lens.Lens' UpdateWebACL Prelude.Text
updateWebACL_name :: Lens' UpdateWebACL Text
updateWebACL_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACL' {Text
name :: Text
$sel:name:UpdateWebACL' :: UpdateWebACL -> Text
name} -> Text
name) (\s :: UpdateWebACL
s@UpdateWebACL' {} Text
a -> UpdateWebACL
s {$sel:name:UpdateWebACL' :: Text
name = Text
a} :: UpdateWebACL)

-- | Specifies whether this is for an Amazon CloudFront distribution or for a
-- regional application. A regional application can be an Application Load
-- Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API,
-- or an Amazon Cognito user pool.
--
-- To work with CloudFront, you must also specify the Region US East (N.
-- Virginia) as follows:
--
-- -   CLI - Specify the Region when you use the CloudFront scope:
--     @--scope=CLOUDFRONT --region=us-east-1@.
--
-- -   API and SDKs - For all calls, use the Region endpoint us-east-1.
updateWebACL_scope :: Lens.Lens' UpdateWebACL Scope
updateWebACL_scope :: Lens' UpdateWebACL Scope
updateWebACL_scope = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACL' {Scope
scope :: Scope
$sel:scope:UpdateWebACL' :: UpdateWebACL -> Scope
scope} -> Scope
scope) (\s :: UpdateWebACL
s@UpdateWebACL' {} Scope
a -> UpdateWebACL
s {$sel:scope:UpdateWebACL' :: Scope
scope = Scope
a} :: UpdateWebACL)

-- | The unique identifier for the web ACL. This ID is returned in the
-- responses to create and list commands. You provide it to operations like
-- update and delete.
updateWebACL_id :: Lens.Lens' UpdateWebACL Prelude.Text
updateWebACL_id :: Lens' UpdateWebACL Text
updateWebACL_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACL' {Text
id :: Text
$sel:id:UpdateWebACL' :: UpdateWebACL -> Text
id} -> Text
id) (\s :: UpdateWebACL
s@UpdateWebACL' {} Text
a -> UpdateWebACL
s {$sel:id:UpdateWebACL' :: Text
id = Text
a} :: UpdateWebACL)

-- | The action to perform if none of the @Rules@ contained in the @WebACL@
-- match.
updateWebACL_defaultAction :: Lens.Lens' UpdateWebACL DefaultAction
updateWebACL_defaultAction :: Lens' UpdateWebACL DefaultAction
updateWebACL_defaultAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACL' {DefaultAction
defaultAction :: DefaultAction
$sel:defaultAction:UpdateWebACL' :: UpdateWebACL -> DefaultAction
defaultAction} -> DefaultAction
defaultAction) (\s :: UpdateWebACL
s@UpdateWebACL' {} DefaultAction
a -> UpdateWebACL
s {$sel:defaultAction:UpdateWebACL' :: DefaultAction
defaultAction = DefaultAction
a} :: UpdateWebACL)

-- | Defines and enables Amazon CloudWatch metrics and web request sample
-- collection.
updateWebACL_visibilityConfig :: Lens.Lens' UpdateWebACL VisibilityConfig
updateWebACL_visibilityConfig :: Lens' UpdateWebACL VisibilityConfig
updateWebACL_visibilityConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACL' {VisibilityConfig
visibilityConfig :: VisibilityConfig
$sel:visibilityConfig:UpdateWebACL' :: UpdateWebACL -> VisibilityConfig
visibilityConfig} -> VisibilityConfig
visibilityConfig) (\s :: UpdateWebACL
s@UpdateWebACL' {} VisibilityConfig
a -> UpdateWebACL
s {$sel:visibilityConfig:UpdateWebACL' :: VisibilityConfig
visibilityConfig = VisibilityConfig
a} :: UpdateWebACL)

-- | A token used for optimistic locking. WAF returns a token to your @get@
-- and @list@ requests, to mark the state of the entity at the time of the
-- request. To make changes to the entity associated with the token, you
-- provide the token to operations like @update@ and @delete@. WAF uses the
-- token to ensure that no changes have been made to the entity since you
-- last retrieved it. If a change has been made, the update fails with a
-- @WAFOptimisticLockException@. If this happens, perform another @get@,
-- and use the new token returned by that operation.
updateWebACL_lockToken :: Lens.Lens' UpdateWebACL Prelude.Text
updateWebACL_lockToken :: Lens' UpdateWebACL Text
updateWebACL_lockToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACL' {Text
lockToken :: Text
$sel:lockToken:UpdateWebACL' :: UpdateWebACL -> Text
lockToken} -> Text
lockToken) (\s :: UpdateWebACL
s@UpdateWebACL' {} Text
a -> UpdateWebACL
s {$sel:lockToken:UpdateWebACL' :: Text
lockToken = Text
a} :: UpdateWebACL)

instance Core.AWSRequest UpdateWebACL where
  type AWSResponse UpdateWebACL = UpdateWebACLResponse
  request :: (Service -> Service) -> UpdateWebACL -> Request UpdateWebACL
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 UpdateWebACL
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateWebACL)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> UpdateWebACLResponse
UpdateWebACLResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextLockToken")
            forall (f :: * -> *) a b. Applicative f => 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 UpdateWebACL where
  hashWithSalt :: Int -> UpdateWebACL -> Int
hashWithSalt Int
_salt UpdateWebACL' {Maybe [Rule]
Maybe (NonEmpty Text)
Maybe Text
Maybe (HashMap Text CustomResponseBody)
Maybe ChallengeConfig
Maybe CaptchaConfig
Text
DefaultAction
Scope
VisibilityConfig
lockToken :: Text
visibilityConfig :: VisibilityConfig
defaultAction :: DefaultAction
id :: Text
scope :: Scope
name :: Text
tokenDomains :: Maybe (NonEmpty Text)
rules :: Maybe [Rule]
description :: Maybe Text
customResponseBodies :: Maybe (HashMap Text CustomResponseBody)
challengeConfig :: Maybe ChallengeConfig
captchaConfig :: Maybe CaptchaConfig
$sel:lockToken:UpdateWebACL' :: UpdateWebACL -> Text
$sel:visibilityConfig:UpdateWebACL' :: UpdateWebACL -> VisibilityConfig
$sel:defaultAction:UpdateWebACL' :: UpdateWebACL -> DefaultAction
$sel:id:UpdateWebACL' :: UpdateWebACL -> Text
$sel:scope:UpdateWebACL' :: UpdateWebACL -> Scope
$sel:name:UpdateWebACL' :: UpdateWebACL -> Text
$sel:tokenDomains:UpdateWebACL' :: UpdateWebACL -> Maybe (NonEmpty Text)
$sel:rules:UpdateWebACL' :: UpdateWebACL -> Maybe [Rule]
$sel:description:UpdateWebACL' :: UpdateWebACL -> Maybe Text
$sel:customResponseBodies:UpdateWebACL' :: UpdateWebACL -> Maybe (HashMap Text CustomResponseBody)
$sel:challengeConfig:UpdateWebACL' :: UpdateWebACL -> Maybe ChallengeConfig
$sel:captchaConfig:UpdateWebACL' :: UpdateWebACL -> Maybe CaptchaConfig
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CaptchaConfig
captchaConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChallengeConfig
challengeConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text CustomResponseBody)
customResponseBodies
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Rule]
rules
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
tokenDomains
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Scope
scope
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DefaultAction
defaultAction
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VisibilityConfig
visibilityConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
lockToken

instance Prelude.NFData UpdateWebACL where
  rnf :: UpdateWebACL -> ()
rnf UpdateWebACL' {Maybe [Rule]
Maybe (NonEmpty Text)
Maybe Text
Maybe (HashMap Text CustomResponseBody)
Maybe ChallengeConfig
Maybe CaptchaConfig
Text
DefaultAction
Scope
VisibilityConfig
lockToken :: Text
visibilityConfig :: VisibilityConfig
defaultAction :: DefaultAction
id :: Text
scope :: Scope
name :: Text
tokenDomains :: Maybe (NonEmpty Text)
rules :: Maybe [Rule]
description :: Maybe Text
customResponseBodies :: Maybe (HashMap Text CustomResponseBody)
challengeConfig :: Maybe ChallengeConfig
captchaConfig :: Maybe CaptchaConfig
$sel:lockToken:UpdateWebACL' :: UpdateWebACL -> Text
$sel:visibilityConfig:UpdateWebACL' :: UpdateWebACL -> VisibilityConfig
$sel:defaultAction:UpdateWebACL' :: UpdateWebACL -> DefaultAction
$sel:id:UpdateWebACL' :: UpdateWebACL -> Text
$sel:scope:UpdateWebACL' :: UpdateWebACL -> Scope
$sel:name:UpdateWebACL' :: UpdateWebACL -> Text
$sel:tokenDomains:UpdateWebACL' :: UpdateWebACL -> Maybe (NonEmpty Text)
$sel:rules:UpdateWebACL' :: UpdateWebACL -> Maybe [Rule]
$sel:description:UpdateWebACL' :: UpdateWebACL -> Maybe Text
$sel:customResponseBodies:UpdateWebACL' :: UpdateWebACL -> Maybe (HashMap Text CustomResponseBody)
$sel:challengeConfig:UpdateWebACL' :: UpdateWebACL -> Maybe ChallengeConfig
$sel:captchaConfig:UpdateWebACL' :: UpdateWebACL -> Maybe CaptchaConfig
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe CaptchaConfig
captchaConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ChallengeConfig
challengeConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text CustomResponseBody)
customResponseBodies
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Rule]
rules
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
tokenDomains
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Scope
scope
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DefaultAction
defaultAction
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VisibilityConfig
visibilityConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
lockToken

instance Data.ToHeaders UpdateWebACL where
  toHeaders :: UpdateWebACL -> 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
"AWSWAF_20190729.UpdateWebACL" ::
                          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 UpdateWebACL where
  toJSON :: UpdateWebACL -> Value
toJSON UpdateWebACL' {Maybe [Rule]
Maybe (NonEmpty Text)
Maybe Text
Maybe (HashMap Text CustomResponseBody)
Maybe ChallengeConfig
Maybe CaptchaConfig
Text
DefaultAction
Scope
VisibilityConfig
lockToken :: Text
visibilityConfig :: VisibilityConfig
defaultAction :: DefaultAction
id :: Text
scope :: Scope
name :: Text
tokenDomains :: Maybe (NonEmpty Text)
rules :: Maybe [Rule]
description :: Maybe Text
customResponseBodies :: Maybe (HashMap Text CustomResponseBody)
challengeConfig :: Maybe ChallengeConfig
captchaConfig :: Maybe CaptchaConfig
$sel:lockToken:UpdateWebACL' :: UpdateWebACL -> Text
$sel:visibilityConfig:UpdateWebACL' :: UpdateWebACL -> VisibilityConfig
$sel:defaultAction:UpdateWebACL' :: UpdateWebACL -> DefaultAction
$sel:id:UpdateWebACL' :: UpdateWebACL -> Text
$sel:scope:UpdateWebACL' :: UpdateWebACL -> Scope
$sel:name:UpdateWebACL' :: UpdateWebACL -> Text
$sel:tokenDomains:UpdateWebACL' :: UpdateWebACL -> Maybe (NonEmpty Text)
$sel:rules:UpdateWebACL' :: UpdateWebACL -> Maybe [Rule]
$sel:description:UpdateWebACL' :: UpdateWebACL -> Maybe Text
$sel:customResponseBodies:UpdateWebACL' :: UpdateWebACL -> Maybe (HashMap Text CustomResponseBody)
$sel:challengeConfig:UpdateWebACL' :: UpdateWebACL -> Maybe ChallengeConfig
$sel:captchaConfig:UpdateWebACL' :: UpdateWebACL -> Maybe CaptchaConfig
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CaptchaConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CaptchaConfig
captchaConfig,
            (Key
"ChallengeConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChallengeConfig
challengeConfig,
            (Key
"CustomResponseBodies" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text CustomResponseBody)
customResponseBodies,
            (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"Rules" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Rule]
rules,
            (Key
"TokenDomains" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
tokenDomains,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
            forall a. a -> Maybe a
Prelude.Just (Key
"Scope" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Scope
scope),
            forall a. a -> Maybe a
Prelude.Just (Key
"Id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
id),
            forall a. a -> Maybe a
Prelude.Just (Key
"DefaultAction" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DefaultAction
defaultAction),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"VisibilityConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= VisibilityConfig
visibilityConfig),
            forall a. a -> Maybe a
Prelude.Just (Key
"LockToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
lockToken)
          ]
      )

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

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

-- | /See:/ 'newUpdateWebACLResponse' smart constructor.
data UpdateWebACLResponse = UpdateWebACLResponse'
  { -- | A token used for optimistic locking. WAF returns this token to your
    -- @update@ requests. You use @NextLockToken@ in the same manner as you use
    -- @LockToken@.
    UpdateWebACLResponse -> Maybe Text
nextLockToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateWebACLResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateWebACLResponse -> UpdateWebACLResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateWebACLResponse -> UpdateWebACLResponse -> Bool
$c/= :: UpdateWebACLResponse -> UpdateWebACLResponse -> Bool
== :: UpdateWebACLResponse -> UpdateWebACLResponse -> Bool
$c== :: UpdateWebACLResponse -> UpdateWebACLResponse -> Bool
Prelude.Eq, ReadPrec [UpdateWebACLResponse]
ReadPrec UpdateWebACLResponse
Int -> ReadS UpdateWebACLResponse
ReadS [UpdateWebACLResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateWebACLResponse]
$creadListPrec :: ReadPrec [UpdateWebACLResponse]
readPrec :: ReadPrec UpdateWebACLResponse
$creadPrec :: ReadPrec UpdateWebACLResponse
readList :: ReadS [UpdateWebACLResponse]
$creadList :: ReadS [UpdateWebACLResponse]
readsPrec :: Int -> ReadS UpdateWebACLResponse
$creadsPrec :: Int -> ReadS UpdateWebACLResponse
Prelude.Read, Int -> UpdateWebACLResponse -> ShowS
[UpdateWebACLResponse] -> ShowS
UpdateWebACLResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateWebACLResponse] -> ShowS
$cshowList :: [UpdateWebACLResponse] -> ShowS
show :: UpdateWebACLResponse -> String
$cshow :: UpdateWebACLResponse -> String
showsPrec :: Int -> UpdateWebACLResponse -> ShowS
$cshowsPrec :: Int -> UpdateWebACLResponse -> ShowS
Prelude.Show, forall x. Rep UpdateWebACLResponse x -> UpdateWebACLResponse
forall x. UpdateWebACLResponse -> Rep UpdateWebACLResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateWebACLResponse x -> UpdateWebACLResponse
$cfrom :: forall x. UpdateWebACLResponse -> Rep UpdateWebACLResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateWebACLResponse' 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:
--
-- 'nextLockToken', 'updateWebACLResponse_nextLockToken' - A token used for optimistic locking. WAF returns this token to your
-- @update@ requests. You use @NextLockToken@ in the same manner as you use
-- @LockToken@.
--
-- 'httpStatus', 'updateWebACLResponse_httpStatus' - The response's http status code.
newUpdateWebACLResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateWebACLResponse
newUpdateWebACLResponse :: Int -> UpdateWebACLResponse
newUpdateWebACLResponse Int
pHttpStatus_ =
  UpdateWebACLResponse'
    { $sel:nextLockToken:UpdateWebACLResponse' :: Maybe Text
nextLockToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateWebACLResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A token used for optimistic locking. WAF returns this token to your
-- @update@ requests. You use @NextLockToken@ in the same manner as you use
-- @LockToken@.
updateWebACLResponse_nextLockToken :: Lens.Lens' UpdateWebACLResponse (Prelude.Maybe Prelude.Text)
updateWebACLResponse_nextLockToken :: Lens' UpdateWebACLResponse (Maybe Text)
updateWebACLResponse_nextLockToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateWebACLResponse' {Maybe Text
nextLockToken :: Maybe Text
$sel:nextLockToken:UpdateWebACLResponse' :: UpdateWebACLResponse -> Maybe Text
nextLockToken} -> Maybe Text
nextLockToken) (\s :: UpdateWebACLResponse
s@UpdateWebACLResponse' {} Maybe Text
a -> UpdateWebACLResponse
s {$sel:nextLockToken:UpdateWebACLResponse' :: Maybe Text
nextLockToken = Maybe Text
a} :: UpdateWebACLResponse)

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

instance Prelude.NFData UpdateWebACLResponse where
  rnf :: UpdateWebACLResponse -> ()
rnf UpdateWebACLResponse' {Int
Maybe Text
httpStatus :: Int
nextLockToken :: Maybe Text
$sel:httpStatus:UpdateWebACLResponse' :: UpdateWebACLResponse -> Int
$sel:nextLockToken:UpdateWebACLResponse' :: UpdateWebACLResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextLockToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus