{-# 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.UpdateRegexMatchSet
-- 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.
--
-- Inserts or deletes RegexMatchTuple objects (filters) in a RegexMatchSet.
-- For each @RegexMatchSetUpdate@ object, you specify the following values:
--
-- -   Whether to insert or delete the object from the array. If you want
--     to change a @RegexMatchSetUpdate@ object, you delete the existing
--     object and add a new one.
--
-- -   The part of a web request that you want AWS WAF to inspectupdate,
--     such as a query string or the value of the @User-Agent@ header.
--
-- -   The identifier of the pattern (a regular expression) that you want
--     AWS WAF to look for. For more information, see RegexPatternSet.
--
-- -   Whether to perform any conversions on the request, such as
--     converting it to lowercase, before inspecting it for the specified
--     string.
--
-- For example, you can create a @RegexPatternSet@ that matches any
-- requests with @User-Agent@ headers that contain the string
-- @B[a\@]dB[o0]t@. You can then configure AWS WAF to reject those
-- requests.
--
-- To create and configure a @RegexMatchSet@, perform the following steps:
--
-- 1.  Create a @RegexMatchSet.@ For more information, see
--     CreateRegexMatchSet.
--
-- 2.  Use GetChangeToken to get the change token that you provide in the
--     @ChangeToken@ parameter of an @UpdateRegexMatchSet@ request.
--
-- 3.  Submit an @UpdateRegexMatchSet@ request to specify the part of the
--     request that you want AWS WAF to inspect (for example, the header or
--     the URI) and the identifier of the @RegexPatternSet@ that contain
--     the regular expression patters you want AWS WAF to watch for.
--
-- For more information about how to use the AWS WAF API to allow or block
-- HTTP requests, see the
-- <https://docs.aws.amazon.com/waf/latest/developerguide/ AWS WAF Developer Guide>.
module Amazonka.WAFRegional.UpdateRegexMatchSet
  ( -- * Creating a Request
    UpdateRegexMatchSet (..),
    newUpdateRegexMatchSet,

    -- * Request Lenses
    updateRegexMatchSet_regexMatchSetId,
    updateRegexMatchSet_updates,
    updateRegexMatchSet_changeToken,

    -- * Destructuring the Response
    UpdateRegexMatchSetResponse (..),
    newUpdateRegexMatchSetResponse,

    -- * Response Lenses
    updateRegexMatchSetResponse_changeToken,
    updateRegexMatchSetResponse_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:/ 'newUpdateRegexMatchSet' smart constructor.
data UpdateRegexMatchSet = UpdateRegexMatchSet'
  { -- | The @RegexMatchSetId@ of the RegexMatchSet that you want to update.
    -- @RegexMatchSetId@ is returned by CreateRegexMatchSet and by
    -- ListRegexMatchSets.
    UpdateRegexMatchSet -> Text
regexMatchSetId :: Prelude.Text,
    -- | An array of @RegexMatchSetUpdate@ objects that you want to insert into
    -- or delete from a RegexMatchSet. For more information, see
    -- RegexMatchTuple.
    UpdateRegexMatchSet -> NonEmpty RegexMatchSetUpdate
updates :: Prelude.NonEmpty RegexMatchSetUpdate,
    -- | The value returned by the most recent call to GetChangeToken.
    UpdateRegexMatchSet -> Text
changeToken :: Prelude.Text
  }
  deriving (UpdateRegexMatchSet -> UpdateRegexMatchSet -> Bool
(UpdateRegexMatchSet -> UpdateRegexMatchSet -> Bool)
-> (UpdateRegexMatchSet -> UpdateRegexMatchSet -> Bool)
-> Eq UpdateRegexMatchSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRegexMatchSet -> UpdateRegexMatchSet -> Bool
$c/= :: UpdateRegexMatchSet -> UpdateRegexMatchSet -> Bool
== :: UpdateRegexMatchSet -> UpdateRegexMatchSet -> Bool
$c== :: UpdateRegexMatchSet -> UpdateRegexMatchSet -> Bool
Prelude.Eq, ReadPrec [UpdateRegexMatchSet]
ReadPrec UpdateRegexMatchSet
Int -> ReadS UpdateRegexMatchSet
ReadS [UpdateRegexMatchSet]
(Int -> ReadS UpdateRegexMatchSet)
-> ReadS [UpdateRegexMatchSet]
-> ReadPrec UpdateRegexMatchSet
-> ReadPrec [UpdateRegexMatchSet]
-> Read UpdateRegexMatchSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRegexMatchSet]
$creadListPrec :: ReadPrec [UpdateRegexMatchSet]
readPrec :: ReadPrec UpdateRegexMatchSet
$creadPrec :: ReadPrec UpdateRegexMatchSet
readList :: ReadS [UpdateRegexMatchSet]
$creadList :: ReadS [UpdateRegexMatchSet]
readsPrec :: Int -> ReadS UpdateRegexMatchSet
$creadsPrec :: Int -> ReadS UpdateRegexMatchSet
Prelude.Read, Int -> UpdateRegexMatchSet -> ShowS
[UpdateRegexMatchSet] -> ShowS
UpdateRegexMatchSet -> String
(Int -> UpdateRegexMatchSet -> ShowS)
-> (UpdateRegexMatchSet -> String)
-> ([UpdateRegexMatchSet] -> ShowS)
-> Show UpdateRegexMatchSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRegexMatchSet] -> ShowS
$cshowList :: [UpdateRegexMatchSet] -> ShowS
show :: UpdateRegexMatchSet -> String
$cshow :: UpdateRegexMatchSet -> String
showsPrec :: Int -> UpdateRegexMatchSet -> ShowS
$cshowsPrec :: Int -> UpdateRegexMatchSet -> ShowS
Prelude.Show, (forall x. UpdateRegexMatchSet -> Rep UpdateRegexMatchSet x)
-> (forall x. Rep UpdateRegexMatchSet x -> UpdateRegexMatchSet)
-> Generic UpdateRegexMatchSet
forall x. Rep UpdateRegexMatchSet x -> UpdateRegexMatchSet
forall x. UpdateRegexMatchSet -> Rep UpdateRegexMatchSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRegexMatchSet x -> UpdateRegexMatchSet
$cfrom :: forall x. UpdateRegexMatchSet -> Rep UpdateRegexMatchSet x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRegexMatchSet' 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:
--
-- 'regexMatchSetId', 'updateRegexMatchSet_regexMatchSetId' - The @RegexMatchSetId@ of the RegexMatchSet that you want to update.
-- @RegexMatchSetId@ is returned by CreateRegexMatchSet and by
-- ListRegexMatchSets.
--
-- 'updates', 'updateRegexMatchSet_updates' - An array of @RegexMatchSetUpdate@ objects that you want to insert into
-- or delete from a RegexMatchSet. For more information, see
-- RegexMatchTuple.
--
-- 'changeToken', 'updateRegexMatchSet_changeToken' - The value returned by the most recent call to GetChangeToken.
newUpdateRegexMatchSet ::
  -- | 'regexMatchSetId'
  Prelude.Text ->
  -- | 'updates'
  Prelude.NonEmpty RegexMatchSetUpdate ->
  -- | 'changeToken'
  Prelude.Text ->
  UpdateRegexMatchSet
newUpdateRegexMatchSet :: Text -> NonEmpty RegexMatchSetUpdate -> Text -> UpdateRegexMatchSet
newUpdateRegexMatchSet
  Text
pRegexMatchSetId_
  NonEmpty RegexMatchSetUpdate
pUpdates_
  Text
pChangeToken_ =
    UpdateRegexMatchSet' :: Text -> NonEmpty RegexMatchSetUpdate -> Text -> UpdateRegexMatchSet
UpdateRegexMatchSet'
      { $sel:regexMatchSetId:UpdateRegexMatchSet' :: Text
regexMatchSetId =
          Text
pRegexMatchSetId_,
        $sel:updates:UpdateRegexMatchSet' :: NonEmpty RegexMatchSetUpdate
updates = Tagged
  (NonEmpty RegexMatchSetUpdate)
  (Identity (NonEmpty RegexMatchSetUpdate))
-> Tagged
     (NonEmpty RegexMatchSetUpdate)
     (Identity (NonEmpty RegexMatchSetUpdate))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty RegexMatchSetUpdate)
   (Identity (NonEmpty RegexMatchSetUpdate))
 -> Tagged
      (NonEmpty RegexMatchSetUpdate)
      (Identity (NonEmpty RegexMatchSetUpdate)))
-> NonEmpty RegexMatchSetUpdate -> NonEmpty RegexMatchSetUpdate
forall t b. AReview t b -> b -> t
Lens.# NonEmpty RegexMatchSetUpdate
pUpdates_,
        $sel:changeToken:UpdateRegexMatchSet' :: Text
changeToken = Text
pChangeToken_
      }

-- | The @RegexMatchSetId@ of the RegexMatchSet that you want to update.
-- @RegexMatchSetId@ is returned by CreateRegexMatchSet and by
-- ListRegexMatchSets.
updateRegexMatchSet_regexMatchSetId :: Lens.Lens' UpdateRegexMatchSet Prelude.Text
updateRegexMatchSet_regexMatchSetId :: (Text -> f Text) -> UpdateRegexMatchSet -> f UpdateRegexMatchSet
updateRegexMatchSet_regexMatchSetId = (UpdateRegexMatchSet -> Text)
-> (UpdateRegexMatchSet -> Text -> UpdateRegexMatchSet)
-> Lens UpdateRegexMatchSet UpdateRegexMatchSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegexMatchSet' {Text
regexMatchSetId :: Text
$sel:regexMatchSetId:UpdateRegexMatchSet' :: UpdateRegexMatchSet -> Text
regexMatchSetId} -> Text
regexMatchSetId) (\s :: UpdateRegexMatchSet
s@UpdateRegexMatchSet' {} Text
a -> UpdateRegexMatchSet
s {$sel:regexMatchSetId:UpdateRegexMatchSet' :: Text
regexMatchSetId = Text
a} :: UpdateRegexMatchSet)

-- | An array of @RegexMatchSetUpdate@ objects that you want to insert into
-- or delete from a RegexMatchSet. For more information, see
-- RegexMatchTuple.
updateRegexMatchSet_updates :: Lens.Lens' UpdateRegexMatchSet (Prelude.NonEmpty RegexMatchSetUpdate)
updateRegexMatchSet_updates :: (NonEmpty RegexMatchSetUpdate -> f (NonEmpty RegexMatchSetUpdate))
-> UpdateRegexMatchSet -> f UpdateRegexMatchSet
updateRegexMatchSet_updates = (UpdateRegexMatchSet -> NonEmpty RegexMatchSetUpdate)
-> (UpdateRegexMatchSet
    -> NonEmpty RegexMatchSetUpdate -> UpdateRegexMatchSet)
-> Lens
     UpdateRegexMatchSet
     UpdateRegexMatchSet
     (NonEmpty RegexMatchSetUpdate)
     (NonEmpty RegexMatchSetUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegexMatchSet' {NonEmpty RegexMatchSetUpdate
updates :: NonEmpty RegexMatchSetUpdate
$sel:updates:UpdateRegexMatchSet' :: UpdateRegexMatchSet -> NonEmpty RegexMatchSetUpdate
updates} -> NonEmpty RegexMatchSetUpdate
updates) (\s :: UpdateRegexMatchSet
s@UpdateRegexMatchSet' {} NonEmpty RegexMatchSetUpdate
a -> UpdateRegexMatchSet
s {$sel:updates:UpdateRegexMatchSet' :: NonEmpty RegexMatchSetUpdate
updates = NonEmpty RegexMatchSetUpdate
a} :: UpdateRegexMatchSet) ((NonEmpty RegexMatchSetUpdate -> f (NonEmpty RegexMatchSetUpdate))
 -> UpdateRegexMatchSet -> f UpdateRegexMatchSet)
-> ((NonEmpty RegexMatchSetUpdate
     -> f (NonEmpty RegexMatchSetUpdate))
    -> NonEmpty RegexMatchSetUpdate
    -> f (NonEmpty RegexMatchSetUpdate))
-> (NonEmpty RegexMatchSetUpdate
    -> f (NonEmpty RegexMatchSetUpdate))
-> UpdateRegexMatchSet
-> f UpdateRegexMatchSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty RegexMatchSetUpdate -> f (NonEmpty RegexMatchSetUpdate))
-> NonEmpty RegexMatchSetUpdate -> f (NonEmpty RegexMatchSetUpdate)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Core.AWSRequest UpdateRegexMatchSet where
  type
    AWSResponse UpdateRegexMatchSet =
      UpdateRegexMatchSetResponse
  request :: UpdateRegexMatchSet -> Request UpdateRegexMatchSet
request = Service -> UpdateRegexMatchSet -> Request UpdateRegexMatchSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateRegexMatchSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateRegexMatchSet)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateRegexMatchSet))
-> Logger
-> Service
-> Proxy UpdateRegexMatchSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateRegexMatchSet)))
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 Text -> Int -> UpdateRegexMatchSetResponse
UpdateRegexMatchSetResponse'
            (Maybe Text -> Int -> UpdateRegexMatchSetResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateRegexMatchSetResponse)
forall (f :: * -> *) a b. Functor 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 -> UpdateRegexMatchSetResponse)
-> Either String Int -> Either String UpdateRegexMatchSetResponse
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 UpdateRegexMatchSet

instance Prelude.NFData UpdateRegexMatchSet

instance Core.ToHeaders UpdateRegexMatchSet where
  toHeaders :: UpdateRegexMatchSet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateRegexMatchSet -> 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.UpdateRegexMatchSet" ::
                          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 UpdateRegexMatchSet where
  toJSON :: UpdateRegexMatchSet -> Value
toJSON UpdateRegexMatchSet' {NonEmpty RegexMatchSetUpdate
Text
changeToken :: Text
updates :: NonEmpty RegexMatchSetUpdate
regexMatchSetId :: Text
$sel:changeToken:UpdateRegexMatchSet' :: UpdateRegexMatchSet -> Text
$sel:updates:UpdateRegexMatchSet' :: UpdateRegexMatchSet -> NonEmpty RegexMatchSetUpdate
$sel:regexMatchSetId:UpdateRegexMatchSet' :: UpdateRegexMatchSet -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"RegexMatchSetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
regexMatchSetId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Updates" Text -> NonEmpty RegexMatchSetUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty RegexMatchSetUpdate
updates),
            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 UpdateRegexMatchSet where
  toPath :: UpdateRegexMatchSet -> ByteString
toPath = ByteString -> UpdateRegexMatchSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'UpdateRegexMatchSetResponse' 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:
--
-- 'changeToken', 'updateRegexMatchSetResponse_changeToken' - The @ChangeToken@ that you used to submit the @UpdateRegexMatchSet@
-- request. You can also use this value to query the status of the request.
-- For more information, see GetChangeTokenStatus.
--
-- 'httpStatus', 'updateRegexMatchSetResponse_httpStatus' - The response's http status code.
newUpdateRegexMatchSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateRegexMatchSetResponse
newUpdateRegexMatchSetResponse :: Int -> UpdateRegexMatchSetResponse
newUpdateRegexMatchSetResponse Int
pHttpStatus_ =
  UpdateRegexMatchSetResponse' :: Maybe Text -> Int -> UpdateRegexMatchSetResponse
UpdateRegexMatchSetResponse'
    { $sel:changeToken:UpdateRegexMatchSetResponse' :: Maybe Text
changeToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateRegexMatchSetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

instance Prelude.NFData UpdateRegexMatchSetResponse