{-# 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.UpdateSqlInjectionMatchSet
-- 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 SqlInjectionMatchTuple objects (filters) in a
-- SqlInjectionMatchSet. For each @SqlInjectionMatchTuple@ object, you
-- specify the following values:
--
-- -   @Action@: Whether to insert the object into or delete the object
--     from the array. To change a @SqlInjectionMatchTuple@, you delete the
--     existing object and add a new one.
--
-- -   @FieldToMatch@: The part of web requests that you want AWS WAF to
--     inspect and, if you want AWS WAF to inspect a header or custom query
--     parameter, the name of the header or parameter.
--
-- -   @TextTransformation@: Which text transformation, if any, to perform
--     on the web request before inspecting the request for snippets of
--     malicious SQL code.
--
--     You can only specify a single type of TextTransformation.
--
-- You use @SqlInjectionMatchSet@ objects to specify which CloudFront
-- requests that you want to allow, block, or count. For example, if
-- you\'re receiving requests that contain snippets of SQL code in the
-- query string and you want to block the requests, you can create a
-- @SqlInjectionMatchSet@ with the applicable settings, and then configure
-- AWS WAF to block the requests.
--
-- To create and configure a @SqlInjectionMatchSet@, perform the following
-- steps:
--
-- 1.  Submit a CreateSqlInjectionMatchSet request.
--
-- 2.  Use GetChangeToken to get the change token that you provide in the
--     @ChangeToken@ parameter of an UpdateIPSet request.
--
-- 3.  Submit an @UpdateSqlInjectionMatchSet@ request to specify the parts
--     of web requests that you want AWS WAF to inspect for snippets of SQL
--     code.
--
-- 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.UpdateSqlInjectionMatchSet
  ( -- * Creating a Request
    UpdateSqlInjectionMatchSet (..),
    newUpdateSqlInjectionMatchSet,

    -- * Request Lenses
    updateSqlInjectionMatchSet_sqlInjectionMatchSetId,
    updateSqlInjectionMatchSet_changeToken,
    updateSqlInjectionMatchSet_updates,

    -- * Destructuring the Response
    UpdateSqlInjectionMatchSetResponse (..),
    newUpdateSqlInjectionMatchSetResponse,

    -- * Response Lenses
    updateSqlInjectionMatchSetResponse_changeToken,
    updateSqlInjectionMatchSetResponse_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

-- | A request to update a SqlInjectionMatchSet.
--
-- /See:/ 'newUpdateSqlInjectionMatchSet' smart constructor.
data UpdateSqlInjectionMatchSet = UpdateSqlInjectionMatchSet'
  { -- | The @SqlInjectionMatchSetId@ of the @SqlInjectionMatchSet@ that you want
    -- to update. @SqlInjectionMatchSetId@ is returned by
    -- CreateSqlInjectionMatchSet and by ListSqlInjectionMatchSets.
    UpdateSqlInjectionMatchSet -> Text
sqlInjectionMatchSetId :: Prelude.Text,
    -- | The value returned by the most recent call to GetChangeToken.
    UpdateSqlInjectionMatchSet -> Text
changeToken :: Prelude.Text,
    -- | An array of @SqlInjectionMatchSetUpdate@ objects that you want to insert
    -- into or delete from a SqlInjectionMatchSet. For more information, see
    -- the applicable data types:
    --
    -- -   SqlInjectionMatchSetUpdate: Contains @Action@ and
    --     @SqlInjectionMatchTuple@
    --
    -- -   SqlInjectionMatchTuple: Contains @FieldToMatch@ and
    --     @TextTransformation@
    --
    -- -   FieldToMatch: Contains @Data@ and @Type@
    UpdateSqlInjectionMatchSet -> NonEmpty SqlInjectionMatchSetUpdate
updates :: Prelude.NonEmpty SqlInjectionMatchSetUpdate
  }
  deriving (UpdateSqlInjectionMatchSet -> UpdateSqlInjectionMatchSet -> Bool
(UpdateSqlInjectionMatchSet -> UpdateSqlInjectionMatchSet -> Bool)
-> (UpdateSqlInjectionMatchSet
    -> UpdateSqlInjectionMatchSet -> Bool)
-> Eq UpdateSqlInjectionMatchSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSqlInjectionMatchSet -> UpdateSqlInjectionMatchSet -> Bool
$c/= :: UpdateSqlInjectionMatchSet -> UpdateSqlInjectionMatchSet -> Bool
== :: UpdateSqlInjectionMatchSet -> UpdateSqlInjectionMatchSet -> Bool
$c== :: UpdateSqlInjectionMatchSet -> UpdateSqlInjectionMatchSet -> Bool
Prelude.Eq, ReadPrec [UpdateSqlInjectionMatchSet]
ReadPrec UpdateSqlInjectionMatchSet
Int -> ReadS UpdateSqlInjectionMatchSet
ReadS [UpdateSqlInjectionMatchSet]
(Int -> ReadS UpdateSqlInjectionMatchSet)
-> ReadS [UpdateSqlInjectionMatchSet]
-> ReadPrec UpdateSqlInjectionMatchSet
-> ReadPrec [UpdateSqlInjectionMatchSet]
-> Read UpdateSqlInjectionMatchSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSqlInjectionMatchSet]
$creadListPrec :: ReadPrec [UpdateSqlInjectionMatchSet]
readPrec :: ReadPrec UpdateSqlInjectionMatchSet
$creadPrec :: ReadPrec UpdateSqlInjectionMatchSet
readList :: ReadS [UpdateSqlInjectionMatchSet]
$creadList :: ReadS [UpdateSqlInjectionMatchSet]
readsPrec :: Int -> ReadS UpdateSqlInjectionMatchSet
$creadsPrec :: Int -> ReadS UpdateSqlInjectionMatchSet
Prelude.Read, Int -> UpdateSqlInjectionMatchSet -> ShowS
[UpdateSqlInjectionMatchSet] -> ShowS
UpdateSqlInjectionMatchSet -> String
(Int -> UpdateSqlInjectionMatchSet -> ShowS)
-> (UpdateSqlInjectionMatchSet -> String)
-> ([UpdateSqlInjectionMatchSet] -> ShowS)
-> Show UpdateSqlInjectionMatchSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSqlInjectionMatchSet] -> ShowS
$cshowList :: [UpdateSqlInjectionMatchSet] -> ShowS
show :: UpdateSqlInjectionMatchSet -> String
$cshow :: UpdateSqlInjectionMatchSet -> String
showsPrec :: Int -> UpdateSqlInjectionMatchSet -> ShowS
$cshowsPrec :: Int -> UpdateSqlInjectionMatchSet -> ShowS
Prelude.Show, (forall x.
 UpdateSqlInjectionMatchSet -> Rep UpdateSqlInjectionMatchSet x)
-> (forall x.
    Rep UpdateSqlInjectionMatchSet x -> UpdateSqlInjectionMatchSet)
-> Generic UpdateSqlInjectionMatchSet
forall x.
Rep UpdateSqlInjectionMatchSet x -> UpdateSqlInjectionMatchSet
forall x.
UpdateSqlInjectionMatchSet -> Rep UpdateSqlInjectionMatchSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSqlInjectionMatchSet x -> UpdateSqlInjectionMatchSet
$cfrom :: forall x.
UpdateSqlInjectionMatchSet -> Rep UpdateSqlInjectionMatchSet x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSqlInjectionMatchSet' 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:
--
-- 'sqlInjectionMatchSetId', 'updateSqlInjectionMatchSet_sqlInjectionMatchSetId' - The @SqlInjectionMatchSetId@ of the @SqlInjectionMatchSet@ that you want
-- to update. @SqlInjectionMatchSetId@ is returned by
-- CreateSqlInjectionMatchSet and by ListSqlInjectionMatchSets.
--
-- 'changeToken', 'updateSqlInjectionMatchSet_changeToken' - The value returned by the most recent call to GetChangeToken.
--
-- 'updates', 'updateSqlInjectionMatchSet_updates' - An array of @SqlInjectionMatchSetUpdate@ objects that you want to insert
-- into or delete from a SqlInjectionMatchSet. For more information, see
-- the applicable data types:
--
-- -   SqlInjectionMatchSetUpdate: Contains @Action@ and
--     @SqlInjectionMatchTuple@
--
-- -   SqlInjectionMatchTuple: Contains @FieldToMatch@ and
--     @TextTransformation@
--
-- -   FieldToMatch: Contains @Data@ and @Type@
newUpdateSqlInjectionMatchSet ::
  -- | 'sqlInjectionMatchSetId'
  Prelude.Text ->
  -- | 'changeToken'
  Prelude.Text ->
  -- | 'updates'
  Prelude.NonEmpty SqlInjectionMatchSetUpdate ->
  UpdateSqlInjectionMatchSet
newUpdateSqlInjectionMatchSet :: Text
-> Text
-> NonEmpty SqlInjectionMatchSetUpdate
-> UpdateSqlInjectionMatchSet
newUpdateSqlInjectionMatchSet
  Text
pSqlInjectionMatchSetId_
  Text
pChangeToken_
  NonEmpty SqlInjectionMatchSetUpdate
pUpdates_ =
    UpdateSqlInjectionMatchSet' :: Text
-> Text
-> NonEmpty SqlInjectionMatchSetUpdate
-> UpdateSqlInjectionMatchSet
UpdateSqlInjectionMatchSet'
      { $sel:sqlInjectionMatchSetId:UpdateSqlInjectionMatchSet' :: Text
sqlInjectionMatchSetId =
          Text
pSqlInjectionMatchSetId_,
        $sel:changeToken:UpdateSqlInjectionMatchSet' :: Text
changeToken = Text
pChangeToken_,
        $sel:updates:UpdateSqlInjectionMatchSet' :: NonEmpty SqlInjectionMatchSetUpdate
updates = Tagged
  (NonEmpty SqlInjectionMatchSetUpdate)
  (Identity (NonEmpty SqlInjectionMatchSetUpdate))
-> Tagged
     (NonEmpty SqlInjectionMatchSetUpdate)
     (Identity (NonEmpty SqlInjectionMatchSetUpdate))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty SqlInjectionMatchSetUpdate)
   (Identity (NonEmpty SqlInjectionMatchSetUpdate))
 -> Tagged
      (NonEmpty SqlInjectionMatchSetUpdate)
      (Identity (NonEmpty SqlInjectionMatchSetUpdate)))
-> NonEmpty SqlInjectionMatchSetUpdate
-> NonEmpty SqlInjectionMatchSetUpdate
forall t b. AReview t b -> b -> t
Lens.# NonEmpty SqlInjectionMatchSetUpdate
pUpdates_
      }

-- | The @SqlInjectionMatchSetId@ of the @SqlInjectionMatchSet@ that you want
-- to update. @SqlInjectionMatchSetId@ is returned by
-- CreateSqlInjectionMatchSet and by ListSqlInjectionMatchSets.
updateSqlInjectionMatchSet_sqlInjectionMatchSetId :: Lens.Lens' UpdateSqlInjectionMatchSet Prelude.Text
updateSqlInjectionMatchSet_sqlInjectionMatchSetId :: (Text -> f Text)
-> UpdateSqlInjectionMatchSet -> f UpdateSqlInjectionMatchSet
updateSqlInjectionMatchSet_sqlInjectionMatchSetId = (UpdateSqlInjectionMatchSet -> Text)
-> (UpdateSqlInjectionMatchSet
    -> Text -> UpdateSqlInjectionMatchSet)
-> Lens
     UpdateSqlInjectionMatchSet UpdateSqlInjectionMatchSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSqlInjectionMatchSet' {Text
sqlInjectionMatchSetId :: Text
$sel:sqlInjectionMatchSetId:UpdateSqlInjectionMatchSet' :: UpdateSqlInjectionMatchSet -> Text
sqlInjectionMatchSetId} -> Text
sqlInjectionMatchSetId) (\s :: UpdateSqlInjectionMatchSet
s@UpdateSqlInjectionMatchSet' {} Text
a -> UpdateSqlInjectionMatchSet
s {$sel:sqlInjectionMatchSetId:UpdateSqlInjectionMatchSet' :: Text
sqlInjectionMatchSetId = Text
a} :: UpdateSqlInjectionMatchSet)

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

-- | An array of @SqlInjectionMatchSetUpdate@ objects that you want to insert
-- into or delete from a SqlInjectionMatchSet. For more information, see
-- the applicable data types:
--
-- -   SqlInjectionMatchSetUpdate: Contains @Action@ and
--     @SqlInjectionMatchTuple@
--
-- -   SqlInjectionMatchTuple: Contains @FieldToMatch@ and
--     @TextTransformation@
--
-- -   FieldToMatch: Contains @Data@ and @Type@
updateSqlInjectionMatchSet_updates :: Lens.Lens' UpdateSqlInjectionMatchSet (Prelude.NonEmpty SqlInjectionMatchSetUpdate)
updateSqlInjectionMatchSet_updates :: (NonEmpty SqlInjectionMatchSetUpdate
 -> f (NonEmpty SqlInjectionMatchSetUpdate))
-> UpdateSqlInjectionMatchSet -> f UpdateSqlInjectionMatchSet
updateSqlInjectionMatchSet_updates = (UpdateSqlInjectionMatchSet -> NonEmpty SqlInjectionMatchSetUpdate)
-> (UpdateSqlInjectionMatchSet
    -> NonEmpty SqlInjectionMatchSetUpdate
    -> UpdateSqlInjectionMatchSet)
-> Lens
     UpdateSqlInjectionMatchSet
     UpdateSqlInjectionMatchSet
     (NonEmpty SqlInjectionMatchSetUpdate)
     (NonEmpty SqlInjectionMatchSetUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSqlInjectionMatchSet' {NonEmpty SqlInjectionMatchSetUpdate
updates :: NonEmpty SqlInjectionMatchSetUpdate
$sel:updates:UpdateSqlInjectionMatchSet' :: UpdateSqlInjectionMatchSet -> NonEmpty SqlInjectionMatchSetUpdate
updates} -> NonEmpty SqlInjectionMatchSetUpdate
updates) (\s :: UpdateSqlInjectionMatchSet
s@UpdateSqlInjectionMatchSet' {} NonEmpty SqlInjectionMatchSetUpdate
a -> UpdateSqlInjectionMatchSet
s {$sel:updates:UpdateSqlInjectionMatchSet' :: NonEmpty SqlInjectionMatchSetUpdate
updates = NonEmpty SqlInjectionMatchSetUpdate
a} :: UpdateSqlInjectionMatchSet) ((NonEmpty SqlInjectionMatchSetUpdate
  -> f (NonEmpty SqlInjectionMatchSetUpdate))
 -> UpdateSqlInjectionMatchSet -> f UpdateSqlInjectionMatchSet)
-> ((NonEmpty SqlInjectionMatchSetUpdate
     -> f (NonEmpty SqlInjectionMatchSetUpdate))
    -> NonEmpty SqlInjectionMatchSetUpdate
    -> f (NonEmpty SqlInjectionMatchSetUpdate))
-> (NonEmpty SqlInjectionMatchSetUpdate
    -> f (NonEmpty SqlInjectionMatchSetUpdate))
-> UpdateSqlInjectionMatchSet
-> f UpdateSqlInjectionMatchSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty SqlInjectionMatchSetUpdate
 -> f (NonEmpty SqlInjectionMatchSetUpdate))
-> NonEmpty SqlInjectionMatchSetUpdate
-> f (NonEmpty SqlInjectionMatchSetUpdate)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData UpdateSqlInjectionMatchSet

instance Core.ToHeaders UpdateSqlInjectionMatchSet where
  toHeaders :: UpdateSqlInjectionMatchSet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateSqlInjectionMatchSet -> 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.UpdateSqlInjectionMatchSet" ::
                          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 UpdateSqlInjectionMatchSet where
  toJSON :: UpdateSqlInjectionMatchSet -> Value
toJSON UpdateSqlInjectionMatchSet' {NonEmpty SqlInjectionMatchSetUpdate
Text
updates :: NonEmpty SqlInjectionMatchSetUpdate
changeToken :: Text
sqlInjectionMatchSetId :: Text
$sel:updates:UpdateSqlInjectionMatchSet' :: UpdateSqlInjectionMatchSet -> NonEmpty SqlInjectionMatchSetUpdate
$sel:changeToken:UpdateSqlInjectionMatchSet' :: UpdateSqlInjectionMatchSet -> Text
$sel:sqlInjectionMatchSetId:UpdateSqlInjectionMatchSet' :: UpdateSqlInjectionMatchSet -> 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
"SqlInjectionMatchSetId"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sqlInjectionMatchSetId
              ),
            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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Updates" Text -> NonEmpty SqlInjectionMatchSetUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty SqlInjectionMatchSetUpdate
updates)
          ]
      )

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

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

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

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

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

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

instance
  Prelude.NFData
    UpdateSqlInjectionMatchSetResponse