{-# 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.UpdateRegexPatternSet
-- 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 RegexPatternSet.
--
-- This operation completely replaces the mutable specifications that you
-- already have for the regex pattern set with the ones that you provide to
-- this call. To modify the regex pattern set, retrieve it by calling
-- GetRegexPatternSet, update the settings as needed, and then provide the
-- complete regex pattern set specification to this call.
--
-- 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.
module Amazonka.WAFV2.UpdateRegexPatternSet
  ( -- * Creating a Request
    UpdateRegexPatternSet (..),
    newUpdateRegexPatternSet,

    -- * Request Lenses
    updateRegexPatternSet_description,
    updateRegexPatternSet_name,
    updateRegexPatternSet_scope,
    updateRegexPatternSet_id,
    updateRegexPatternSet_regularExpressionList,
    updateRegexPatternSet_lockToken,

    -- * Destructuring the Response
    UpdateRegexPatternSetResponse (..),
    newUpdateRegexPatternSetResponse,

    -- * Response Lenses
    updateRegexPatternSetResponse_nextLockToken,
    updateRegexPatternSetResponse_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:/ 'newUpdateRegexPatternSet' smart constructor.
data UpdateRegexPatternSet = UpdateRegexPatternSet'
  { -- | A description of the set that helps with identification.
    UpdateRegexPatternSet -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the set. You cannot change the name after you create the
    -- set.
    UpdateRegexPatternSet -> 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.
    UpdateRegexPatternSet -> Scope
scope :: Scope,
    -- | A unique identifier for the set. This ID is returned in the responses to
    -- create and list commands. You provide it to operations like update and
    -- delete.
    UpdateRegexPatternSet -> Text
id :: Prelude.Text,
    UpdateRegexPatternSet -> [Regex]
regularExpressionList :: [Regex],
    -- | 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.
    UpdateRegexPatternSet -> Text
lockToken :: Prelude.Text
  }
  deriving (UpdateRegexPatternSet -> UpdateRegexPatternSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRegexPatternSet -> UpdateRegexPatternSet -> Bool
$c/= :: UpdateRegexPatternSet -> UpdateRegexPatternSet -> Bool
== :: UpdateRegexPatternSet -> UpdateRegexPatternSet -> Bool
$c== :: UpdateRegexPatternSet -> UpdateRegexPatternSet -> Bool
Prelude.Eq, ReadPrec [UpdateRegexPatternSet]
ReadPrec UpdateRegexPatternSet
Int -> ReadS UpdateRegexPatternSet
ReadS [UpdateRegexPatternSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRegexPatternSet]
$creadListPrec :: ReadPrec [UpdateRegexPatternSet]
readPrec :: ReadPrec UpdateRegexPatternSet
$creadPrec :: ReadPrec UpdateRegexPatternSet
readList :: ReadS [UpdateRegexPatternSet]
$creadList :: ReadS [UpdateRegexPatternSet]
readsPrec :: Int -> ReadS UpdateRegexPatternSet
$creadsPrec :: Int -> ReadS UpdateRegexPatternSet
Prelude.Read, Int -> UpdateRegexPatternSet -> ShowS
[UpdateRegexPatternSet] -> ShowS
UpdateRegexPatternSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRegexPatternSet] -> ShowS
$cshowList :: [UpdateRegexPatternSet] -> ShowS
show :: UpdateRegexPatternSet -> String
$cshow :: UpdateRegexPatternSet -> String
showsPrec :: Int -> UpdateRegexPatternSet -> ShowS
$cshowsPrec :: Int -> UpdateRegexPatternSet -> ShowS
Prelude.Show, forall x. Rep UpdateRegexPatternSet x -> UpdateRegexPatternSet
forall x. UpdateRegexPatternSet -> Rep UpdateRegexPatternSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRegexPatternSet x -> UpdateRegexPatternSet
$cfrom :: forall x. UpdateRegexPatternSet -> Rep UpdateRegexPatternSet x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRegexPatternSet' 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:
--
-- 'description', 'updateRegexPatternSet_description' - A description of the set that helps with identification.
--
-- 'name', 'updateRegexPatternSet_name' - The name of the set. You cannot change the name after you create the
-- set.
--
-- 'scope', 'updateRegexPatternSet_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', 'updateRegexPatternSet_id' - A unique identifier for the set. This ID is returned in the responses to
-- create and list commands. You provide it to operations like update and
-- delete.
--
-- 'regularExpressionList', 'updateRegexPatternSet_regularExpressionList' -
--
-- 'lockToken', 'updateRegexPatternSet_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.
newUpdateRegexPatternSet ::
  -- | 'name'
  Prelude.Text ->
  -- | 'scope'
  Scope ->
  -- | 'id'
  Prelude.Text ->
  -- | 'lockToken'
  Prelude.Text ->
  UpdateRegexPatternSet
newUpdateRegexPatternSet :: Text -> Scope -> Text -> Text -> UpdateRegexPatternSet
newUpdateRegexPatternSet
  Text
pName_
  Scope
pScope_
  Text
pId_
  Text
pLockToken_ =
    UpdateRegexPatternSet'
      { $sel:description:UpdateRegexPatternSet' :: Maybe Text
description =
          forall a. Maybe a
Prelude.Nothing,
        $sel:name:UpdateRegexPatternSet' :: Text
name = Text
pName_,
        $sel:scope:UpdateRegexPatternSet' :: Scope
scope = Scope
pScope_,
        $sel:id:UpdateRegexPatternSet' :: Text
id = Text
pId_,
        $sel:regularExpressionList:UpdateRegexPatternSet' :: [Regex]
regularExpressionList = forall a. Monoid a => a
Prelude.mempty,
        $sel:lockToken:UpdateRegexPatternSet' :: Text
lockToken = Text
pLockToken_
      }

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

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

-- | 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.
updateRegexPatternSet_scope :: Lens.Lens' UpdateRegexPatternSet Scope
updateRegexPatternSet_scope :: Lens' UpdateRegexPatternSet Scope
updateRegexPatternSet_scope = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegexPatternSet' {Scope
scope :: Scope
$sel:scope:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Scope
scope} -> Scope
scope) (\s :: UpdateRegexPatternSet
s@UpdateRegexPatternSet' {} Scope
a -> UpdateRegexPatternSet
s {$sel:scope:UpdateRegexPatternSet' :: Scope
scope = Scope
a} :: UpdateRegexPatternSet)

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

updateRegexPatternSet_regularExpressionList :: Lens.Lens' UpdateRegexPatternSet [Regex]
updateRegexPatternSet_regularExpressionList :: Lens' UpdateRegexPatternSet [Regex]
updateRegexPatternSet_regularExpressionList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegexPatternSet' {[Regex]
regularExpressionList :: [Regex]
$sel:regularExpressionList:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> [Regex]
regularExpressionList} -> [Regex]
regularExpressionList) (\s :: UpdateRegexPatternSet
s@UpdateRegexPatternSet' {} [Regex]
a -> UpdateRegexPatternSet
s {$sel:regularExpressionList:UpdateRegexPatternSet' :: [Regex]
regularExpressionList = [Regex]
a} :: UpdateRegexPatternSet) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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.
updateRegexPatternSet_lockToken :: Lens.Lens' UpdateRegexPatternSet Prelude.Text
updateRegexPatternSet_lockToken :: Lens' UpdateRegexPatternSet Text
updateRegexPatternSet_lockToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegexPatternSet' {Text
lockToken :: Text
$sel:lockToken:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
lockToken} -> Text
lockToken) (\s :: UpdateRegexPatternSet
s@UpdateRegexPatternSet' {} Text
a -> UpdateRegexPatternSet
s {$sel:lockToken:UpdateRegexPatternSet' :: Text
lockToken = Text
a} :: UpdateRegexPatternSet)

instance Core.AWSRequest UpdateRegexPatternSet where
  type
    AWSResponse UpdateRegexPatternSet =
      UpdateRegexPatternSetResponse
  request :: (Service -> Service)
-> UpdateRegexPatternSet -> Request UpdateRegexPatternSet
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 UpdateRegexPatternSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateRegexPatternSet)))
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 -> UpdateRegexPatternSetResponse
UpdateRegexPatternSetResponse'
            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 UpdateRegexPatternSet where
  hashWithSalt :: Int -> UpdateRegexPatternSet -> Int
hashWithSalt Int
_salt UpdateRegexPatternSet' {[Regex]
Maybe Text
Text
Scope
lockToken :: Text
regularExpressionList :: [Regex]
id :: Text
scope :: Scope
name :: Text
description :: Maybe Text
$sel:lockToken:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
$sel:regularExpressionList:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> [Regex]
$sel:id:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
$sel:scope:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Scope
$sel:name:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
$sel:description:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      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` [Regex]
regularExpressionList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
lockToken

instance Prelude.NFData UpdateRegexPatternSet where
  rnf :: UpdateRegexPatternSet -> ()
rnf UpdateRegexPatternSet' {[Regex]
Maybe Text
Text
Scope
lockToken :: Text
regularExpressionList :: [Regex]
id :: Text
scope :: Scope
name :: Text
description :: Maybe Text
$sel:lockToken:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
$sel:regularExpressionList:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> [Regex]
$sel:id:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
$sel:scope:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Scope
$sel:name:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
$sel:description:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Maybe Text
..} =
    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 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 [Regex]
regularExpressionList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
lockToken

instance Data.ToHeaders UpdateRegexPatternSet where
  toHeaders :: UpdateRegexPatternSet -> 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.UpdateRegexPatternSet" ::
                          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 UpdateRegexPatternSet where
  toJSON :: UpdateRegexPatternSet -> Value
toJSON UpdateRegexPatternSet' {[Regex]
Maybe Text
Text
Scope
lockToken :: Text
regularExpressionList :: [Regex]
id :: Text
scope :: Scope
name :: Text
description :: Maybe Text
$sel:lockToken:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
$sel:regularExpressionList:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> [Regex]
$sel:id:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
$sel:scope:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Scope
$sel:name:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
$sel:description:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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,
            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
"RegularExpressionList"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Regex]
regularExpressionList
              ),
            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 UpdateRegexPatternSet where
  toPath :: UpdateRegexPatternSet -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newUpdateRegexPatternSetResponse' smart constructor.
data UpdateRegexPatternSetResponse = UpdateRegexPatternSetResponse'
  { -- | 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@.
    UpdateRegexPatternSetResponse -> Maybe Text
nextLockToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateRegexPatternSetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateRegexPatternSetResponse
-> UpdateRegexPatternSetResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRegexPatternSetResponse
-> UpdateRegexPatternSetResponse -> Bool
$c/= :: UpdateRegexPatternSetResponse
-> UpdateRegexPatternSetResponse -> Bool
== :: UpdateRegexPatternSetResponse
-> UpdateRegexPatternSetResponse -> Bool
$c== :: UpdateRegexPatternSetResponse
-> UpdateRegexPatternSetResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRegexPatternSetResponse]
ReadPrec UpdateRegexPatternSetResponse
Int -> ReadS UpdateRegexPatternSetResponse
ReadS [UpdateRegexPatternSetResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRegexPatternSetResponse]
$creadListPrec :: ReadPrec [UpdateRegexPatternSetResponse]
readPrec :: ReadPrec UpdateRegexPatternSetResponse
$creadPrec :: ReadPrec UpdateRegexPatternSetResponse
readList :: ReadS [UpdateRegexPatternSetResponse]
$creadList :: ReadS [UpdateRegexPatternSetResponse]
readsPrec :: Int -> ReadS UpdateRegexPatternSetResponse
$creadsPrec :: Int -> ReadS UpdateRegexPatternSetResponse
Prelude.Read, Int -> UpdateRegexPatternSetResponse -> ShowS
[UpdateRegexPatternSetResponse] -> ShowS
UpdateRegexPatternSetResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRegexPatternSetResponse] -> ShowS
$cshowList :: [UpdateRegexPatternSetResponse] -> ShowS
show :: UpdateRegexPatternSetResponse -> String
$cshow :: UpdateRegexPatternSetResponse -> String
showsPrec :: Int -> UpdateRegexPatternSetResponse -> ShowS
$cshowsPrec :: Int -> UpdateRegexPatternSetResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateRegexPatternSetResponse x
-> UpdateRegexPatternSetResponse
forall x.
UpdateRegexPatternSetResponse
-> Rep UpdateRegexPatternSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRegexPatternSetResponse x
-> UpdateRegexPatternSetResponse
$cfrom :: forall x.
UpdateRegexPatternSetResponse
-> Rep UpdateRegexPatternSetResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRegexPatternSetResponse' 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', 'updateRegexPatternSetResponse_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', 'updateRegexPatternSetResponse_httpStatus' - The response's http status code.
newUpdateRegexPatternSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateRegexPatternSetResponse
newUpdateRegexPatternSetResponse :: Int -> UpdateRegexPatternSetResponse
newUpdateRegexPatternSetResponse Int
pHttpStatus_ =
  UpdateRegexPatternSetResponse'
    { $sel:nextLockToken:UpdateRegexPatternSetResponse' :: Maybe Text
nextLockToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateRegexPatternSetResponse' :: 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@.
updateRegexPatternSetResponse_nextLockToken :: Lens.Lens' UpdateRegexPatternSetResponse (Prelude.Maybe Prelude.Text)
updateRegexPatternSetResponse_nextLockToken :: Lens' UpdateRegexPatternSetResponse (Maybe Text)
updateRegexPatternSetResponse_nextLockToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegexPatternSetResponse' {Maybe Text
nextLockToken :: Maybe Text
$sel:nextLockToken:UpdateRegexPatternSetResponse' :: UpdateRegexPatternSetResponse -> Maybe Text
nextLockToken} -> Maybe Text
nextLockToken) (\s :: UpdateRegexPatternSetResponse
s@UpdateRegexPatternSetResponse' {} Maybe Text
a -> UpdateRegexPatternSetResponse
s {$sel:nextLockToken:UpdateRegexPatternSetResponse' :: Maybe Text
nextLockToken = Maybe Text
a} :: UpdateRegexPatternSetResponse)

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

instance Prelude.NFData UpdateRegexPatternSetResponse where
  rnf :: UpdateRegexPatternSetResponse -> ()
rnf UpdateRegexPatternSetResponse' {Int
Maybe Text
httpStatus :: Int
nextLockToken :: Maybe Text
$sel:httpStatus:UpdateRegexPatternSetResponse' :: UpdateRegexPatternSetResponse -> Int
$sel:nextLockToken:UpdateRegexPatternSetResponse' :: UpdateRegexPatternSetResponse -> 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