{-# 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.WAF.UpdateRegexPatternSet
-- 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 @RegexPatternString@ objects in a RegexPatternSet.
-- For each @RegexPatternString@ object, you specify the following values:
--
-- -   Whether to insert or delete the @RegexPatternString@.
--
-- -   The regular expression pattern that you want to insert or delete.
--     For more information, see RegexPatternSet.
--
-- For example, you can create a @RegexPatternString@ such as
-- @B[a\@]dB[o0]t@. AWS WAF will match this @RegexPatternString@ to:
--
-- -   BadBot
--
-- -   BadB0t
--
-- -   B\@dBot
--
-- -   B\@dB0t
--
-- To create and configure a @RegexPatternSet@, perform the following
-- steps:
--
-- 1.  Create a @RegexPatternSet.@ For more information, see
--     CreateRegexPatternSet.
--
-- 2.  Use GetChangeToken to get the change token that you provide in the
--     @ChangeToken@ parameter of an @UpdateRegexPatternSet@ request.
--
-- 3.  Submit an @UpdateRegexPatternSet@ request to specify the regular
--     expression pattern that 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.WAF.UpdateRegexPatternSet
  ( -- * Creating a Request
    UpdateRegexPatternSet (..),
    newUpdateRegexPatternSet,

    -- * Request Lenses
    updateRegexPatternSet_regexPatternSetId,
    updateRegexPatternSet_updates,
    updateRegexPatternSet_changeToken,

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

    -- * Response Lenses
    updateRegexPatternSetResponse_changeToken,
    updateRegexPatternSetResponse_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.WAF.Types

-- | /See:/ 'newUpdateRegexPatternSet' smart constructor.
data UpdateRegexPatternSet = UpdateRegexPatternSet'
  { -- | The @RegexPatternSetId@ of the RegexPatternSet that you want to update.
    -- @RegexPatternSetId@ is returned by CreateRegexPatternSet and by
    -- ListRegexPatternSets.
    UpdateRegexPatternSet -> Text
regexPatternSetId :: Prelude.Text,
    -- | An array of @RegexPatternSetUpdate@ objects that you want to insert into
    -- or delete from a RegexPatternSet.
    UpdateRegexPatternSet -> NonEmpty RegexPatternSetUpdate
updates :: Prelude.NonEmpty RegexPatternSetUpdate,
    -- | The value returned by the most recent call to GetChangeToken.
    UpdateRegexPatternSet -> Text
changeToken :: Prelude.Text
  }
  deriving (UpdateRegexPatternSet -> UpdateRegexPatternSet -> Bool
(UpdateRegexPatternSet -> UpdateRegexPatternSet -> Bool)
-> (UpdateRegexPatternSet -> UpdateRegexPatternSet -> Bool)
-> Eq UpdateRegexPatternSet
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]
(Int -> ReadS UpdateRegexPatternSet)
-> ReadS [UpdateRegexPatternSet]
-> ReadPrec UpdateRegexPatternSet
-> ReadPrec [UpdateRegexPatternSet]
-> Read 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
(Int -> UpdateRegexPatternSet -> ShowS)
-> (UpdateRegexPatternSet -> String)
-> ([UpdateRegexPatternSet] -> ShowS)
-> Show UpdateRegexPatternSet
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. UpdateRegexPatternSet -> Rep UpdateRegexPatternSet x)
-> (forall x. Rep UpdateRegexPatternSet x -> UpdateRegexPatternSet)
-> Generic UpdateRegexPatternSet
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:
--
-- 'regexPatternSetId', 'updateRegexPatternSet_regexPatternSetId' - The @RegexPatternSetId@ of the RegexPatternSet that you want to update.
-- @RegexPatternSetId@ is returned by CreateRegexPatternSet and by
-- ListRegexPatternSets.
--
-- 'updates', 'updateRegexPatternSet_updates' - An array of @RegexPatternSetUpdate@ objects that you want to insert into
-- or delete from a RegexPatternSet.
--
-- 'changeToken', 'updateRegexPatternSet_changeToken' - The value returned by the most recent call to GetChangeToken.
newUpdateRegexPatternSet ::
  -- | 'regexPatternSetId'
  Prelude.Text ->
  -- | 'updates'
  Prelude.NonEmpty RegexPatternSetUpdate ->
  -- | 'changeToken'
  Prelude.Text ->
  UpdateRegexPatternSet
newUpdateRegexPatternSet :: Text
-> NonEmpty RegexPatternSetUpdate -> Text -> UpdateRegexPatternSet
newUpdateRegexPatternSet
  Text
pRegexPatternSetId_
  NonEmpty RegexPatternSetUpdate
pUpdates_
  Text
pChangeToken_ =
    UpdateRegexPatternSet' :: Text
-> NonEmpty RegexPatternSetUpdate -> Text -> UpdateRegexPatternSet
UpdateRegexPatternSet'
      { $sel:regexPatternSetId:UpdateRegexPatternSet' :: Text
regexPatternSetId =
          Text
pRegexPatternSetId_,
        $sel:updates:UpdateRegexPatternSet' :: NonEmpty RegexPatternSetUpdate
updates = Tagged
  (NonEmpty RegexPatternSetUpdate)
  (Identity (NonEmpty RegexPatternSetUpdate))
-> Tagged
     (NonEmpty RegexPatternSetUpdate)
     (Identity (NonEmpty RegexPatternSetUpdate))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty RegexPatternSetUpdate)
   (Identity (NonEmpty RegexPatternSetUpdate))
 -> Tagged
      (NonEmpty RegexPatternSetUpdate)
      (Identity (NonEmpty RegexPatternSetUpdate)))
-> NonEmpty RegexPatternSetUpdate -> NonEmpty RegexPatternSetUpdate
forall t b. AReview t b -> b -> t
Lens.# NonEmpty RegexPatternSetUpdate
pUpdates_,
        $sel:changeToken:UpdateRegexPatternSet' :: Text
changeToken = Text
pChangeToken_
      }

-- | The @RegexPatternSetId@ of the RegexPatternSet that you want to update.
-- @RegexPatternSetId@ is returned by CreateRegexPatternSet and by
-- ListRegexPatternSets.
updateRegexPatternSet_regexPatternSetId :: Lens.Lens' UpdateRegexPatternSet Prelude.Text
updateRegexPatternSet_regexPatternSetId :: (Text -> f Text)
-> UpdateRegexPatternSet -> f UpdateRegexPatternSet
updateRegexPatternSet_regexPatternSetId = (UpdateRegexPatternSet -> Text)
-> (UpdateRegexPatternSet -> Text -> UpdateRegexPatternSet)
-> Lens UpdateRegexPatternSet UpdateRegexPatternSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegexPatternSet' {Text
regexPatternSetId :: Text
$sel:regexPatternSetId:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
regexPatternSetId} -> Text
regexPatternSetId) (\s :: UpdateRegexPatternSet
s@UpdateRegexPatternSet' {} Text
a -> UpdateRegexPatternSet
s {$sel:regexPatternSetId:UpdateRegexPatternSet' :: Text
regexPatternSetId = Text
a} :: UpdateRegexPatternSet)

-- | An array of @RegexPatternSetUpdate@ objects that you want to insert into
-- or delete from a RegexPatternSet.
updateRegexPatternSet_updates :: Lens.Lens' UpdateRegexPatternSet (Prelude.NonEmpty RegexPatternSetUpdate)
updateRegexPatternSet_updates :: (NonEmpty RegexPatternSetUpdate
 -> f (NonEmpty RegexPatternSetUpdate))
-> UpdateRegexPatternSet -> f UpdateRegexPatternSet
updateRegexPatternSet_updates = (UpdateRegexPatternSet -> NonEmpty RegexPatternSetUpdate)
-> (UpdateRegexPatternSet
    -> NonEmpty RegexPatternSetUpdate -> UpdateRegexPatternSet)
-> Lens
     UpdateRegexPatternSet
     UpdateRegexPatternSet
     (NonEmpty RegexPatternSetUpdate)
     (NonEmpty RegexPatternSetUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegexPatternSet' {NonEmpty RegexPatternSetUpdate
updates :: NonEmpty RegexPatternSetUpdate
$sel:updates:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> NonEmpty RegexPatternSetUpdate
updates} -> NonEmpty RegexPatternSetUpdate
updates) (\s :: UpdateRegexPatternSet
s@UpdateRegexPatternSet' {} NonEmpty RegexPatternSetUpdate
a -> UpdateRegexPatternSet
s {$sel:updates:UpdateRegexPatternSet' :: NonEmpty RegexPatternSetUpdate
updates = NonEmpty RegexPatternSetUpdate
a} :: UpdateRegexPatternSet) ((NonEmpty RegexPatternSetUpdate
  -> f (NonEmpty RegexPatternSetUpdate))
 -> UpdateRegexPatternSet -> f UpdateRegexPatternSet)
-> ((NonEmpty RegexPatternSetUpdate
     -> f (NonEmpty RegexPatternSetUpdate))
    -> NonEmpty RegexPatternSetUpdate
    -> f (NonEmpty RegexPatternSetUpdate))
-> (NonEmpty RegexPatternSetUpdate
    -> f (NonEmpty RegexPatternSetUpdate))
-> UpdateRegexPatternSet
-> f UpdateRegexPatternSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty RegexPatternSetUpdate
 -> f (NonEmpty RegexPatternSetUpdate))
-> NonEmpty RegexPatternSetUpdate
-> f (NonEmpty RegexPatternSetUpdate)
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.
updateRegexPatternSet_changeToken :: Lens.Lens' UpdateRegexPatternSet Prelude.Text
updateRegexPatternSet_changeToken :: (Text -> f Text)
-> UpdateRegexPatternSet -> f UpdateRegexPatternSet
updateRegexPatternSet_changeToken = (UpdateRegexPatternSet -> Text)
-> (UpdateRegexPatternSet -> Text -> UpdateRegexPatternSet)
-> Lens UpdateRegexPatternSet UpdateRegexPatternSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRegexPatternSet' {Text
changeToken :: Text
$sel:changeToken:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
changeToken} -> Text
changeToken) (\s :: UpdateRegexPatternSet
s@UpdateRegexPatternSet' {} Text
a -> UpdateRegexPatternSet
s {$sel:changeToken:UpdateRegexPatternSet' :: Text
changeToken = Text
a} :: UpdateRegexPatternSet)

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

instance Prelude.NFData UpdateRegexPatternSet

instance Core.ToHeaders UpdateRegexPatternSet where
  toHeaders :: UpdateRegexPatternSet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateRegexPatternSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSWAF_20150824.UpdateRegexPatternSet" ::
                          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 UpdateRegexPatternSet where
  toJSON :: UpdateRegexPatternSet -> Value
toJSON UpdateRegexPatternSet' {NonEmpty RegexPatternSetUpdate
Text
changeToken :: Text
updates :: NonEmpty RegexPatternSetUpdate
regexPatternSetId :: Text
$sel:changeToken:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> Text
$sel:updates:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> NonEmpty RegexPatternSetUpdate
$sel:regexPatternSetId:UpdateRegexPatternSet' :: UpdateRegexPatternSet -> 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
"RegexPatternSetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
regexPatternSetId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Updates" Text -> NonEmpty RegexPatternSetUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty RegexPatternSetUpdate
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 UpdateRegexPatternSet where
  toPath :: UpdateRegexPatternSet -> ByteString
toPath = ByteString -> UpdateRegexPatternSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newUpdateRegexPatternSetResponse' smart constructor.
data UpdateRegexPatternSetResponse = UpdateRegexPatternSetResponse'
  { -- | The @ChangeToken@ that you used to submit the @UpdateRegexPatternSet@
    -- request. You can also use this value to query the status of the request.
    -- For more information, see GetChangeTokenStatus.
    UpdateRegexPatternSetResponse -> Maybe Text
changeToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateRegexPatternSetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateRegexPatternSetResponse
-> UpdateRegexPatternSetResponse -> Bool
(UpdateRegexPatternSetResponse
 -> UpdateRegexPatternSetResponse -> Bool)
-> (UpdateRegexPatternSetResponse
    -> UpdateRegexPatternSetResponse -> Bool)
-> Eq UpdateRegexPatternSetResponse
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]
(Int -> ReadS UpdateRegexPatternSetResponse)
-> ReadS [UpdateRegexPatternSetResponse]
-> ReadPrec UpdateRegexPatternSetResponse
-> ReadPrec [UpdateRegexPatternSetResponse]
-> Read 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
(Int -> UpdateRegexPatternSetResponse -> ShowS)
-> (UpdateRegexPatternSetResponse -> String)
-> ([UpdateRegexPatternSetResponse] -> ShowS)
-> Show UpdateRegexPatternSetResponse
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.
 UpdateRegexPatternSetResponse
 -> Rep UpdateRegexPatternSetResponse x)
-> (forall x.
    Rep UpdateRegexPatternSetResponse x
    -> UpdateRegexPatternSetResponse)
-> Generic UpdateRegexPatternSetResponse
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:
--
-- 'changeToken', 'updateRegexPatternSetResponse_changeToken' - The @ChangeToken@ that you used to submit the @UpdateRegexPatternSet@
-- request. You can also use this value to query the status of the request.
-- For more information, see GetChangeTokenStatus.
--
-- 'httpStatus', 'updateRegexPatternSetResponse_httpStatus' - The response's http status code.
newUpdateRegexPatternSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateRegexPatternSetResponse
newUpdateRegexPatternSetResponse :: Int -> UpdateRegexPatternSetResponse
newUpdateRegexPatternSetResponse Int
pHttpStatus_ =
  UpdateRegexPatternSetResponse' :: Maybe Text -> Int -> UpdateRegexPatternSetResponse
UpdateRegexPatternSetResponse'
    { $sel:changeToken:UpdateRegexPatternSetResponse' :: Maybe Text
changeToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateRegexPatternSetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The response's http status code.
updateRegexPatternSetResponse_httpStatus :: Lens.Lens' UpdateRegexPatternSetResponse Prelude.Int
updateRegexPatternSetResponse_httpStatus :: (Int -> f Int)
-> UpdateRegexPatternSetResponse -> f UpdateRegexPatternSetResponse
updateRegexPatternSetResponse_httpStatus = (UpdateRegexPatternSetResponse -> Int)
-> (UpdateRegexPatternSetResponse
    -> Int -> UpdateRegexPatternSetResponse)
-> Lens
     UpdateRegexPatternSetResponse UpdateRegexPatternSetResponse Int Int
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