{-# 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.UpdateByteMatchSet
-- 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 ByteMatchTuple objects (filters) in a ByteMatchSet.
-- For each @ByteMatchTuple@ object, you specify the following values:
--
-- -   Whether to insert or delete the object from the array. If you want
--     to change a @ByteMatchSetUpdate@ object, you delete the existing
--     object and add a new one.
--
-- -   The part of a web request that you want AWS WAF to inspect, such as
--     a query string or the value of the @User-Agent@ header.
--
-- -   The bytes (typically a string that corresponds with ASCII
--     characters) that you want AWS WAF to look for. For more information,
--     including how you specify the values for the AWS WAF API and the AWS
--     CLI or SDKs, see @TargetString@ in the ByteMatchTuple data type.
--
-- -   Where to look, such as at the beginning or the end of a query
--     string.
--
-- -   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 add a @ByteMatchSetUpdate@ object that matches web
-- requests in which @User-Agent@ headers contain the string @BadBot@. You
-- can then configure AWS WAF to block those requests.
--
-- To create and configure a @ByteMatchSet@, perform the following steps:
--
-- 1.  Create a @ByteMatchSet.@ For more information, see
--     CreateByteMatchSet.
--
-- 2.  Use GetChangeToken to get the change token that you provide in the
--     @ChangeToken@ parameter of an @UpdateByteMatchSet@ request.
--
-- 3.  Submit an @UpdateByteMatchSet@ request to specify the part of the
--     request that you want AWS WAF to inspect (for example, the header or
--     the URI) and the value 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.UpdateByteMatchSet
  ( -- * Creating a Request
    UpdateByteMatchSet (..),
    newUpdateByteMatchSet,

    -- * Request Lenses
    updateByteMatchSet_byteMatchSetId,
    updateByteMatchSet_changeToken,
    updateByteMatchSet_updates,

    -- * Destructuring the Response
    UpdateByteMatchSetResponse (..),
    newUpdateByteMatchSetResponse,

    -- * Response Lenses
    updateByteMatchSetResponse_changeToken,
    updateByteMatchSetResponse_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:/ 'newUpdateByteMatchSet' smart constructor.
data UpdateByteMatchSet = UpdateByteMatchSet'
  { -- | The @ByteMatchSetId@ of the ByteMatchSet that you want to update.
    -- @ByteMatchSetId@ is returned by CreateByteMatchSet and by
    -- ListByteMatchSets.
    UpdateByteMatchSet -> Text
byteMatchSetId :: Prelude.Text,
    -- | The value returned by the most recent call to GetChangeToken.
    UpdateByteMatchSet -> Text
changeToken :: Prelude.Text,
    -- | An array of @ByteMatchSetUpdate@ objects that you want to insert into or
    -- delete from a ByteMatchSet. For more information, see the applicable
    -- data types:
    --
    -- -   ByteMatchSetUpdate: Contains @Action@ and @ByteMatchTuple@
    --
    -- -   ByteMatchTuple: Contains @FieldToMatch@, @PositionalConstraint@,
    --     @TargetString@, and @TextTransformation@
    --
    -- -   FieldToMatch: Contains @Data@ and @Type@
    UpdateByteMatchSet -> NonEmpty ByteMatchSetUpdate
updates :: Prelude.NonEmpty ByteMatchSetUpdate
  }
  deriving (UpdateByteMatchSet -> UpdateByteMatchSet -> Bool
(UpdateByteMatchSet -> UpdateByteMatchSet -> Bool)
-> (UpdateByteMatchSet -> UpdateByteMatchSet -> Bool)
-> Eq UpdateByteMatchSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateByteMatchSet -> UpdateByteMatchSet -> Bool
$c/= :: UpdateByteMatchSet -> UpdateByteMatchSet -> Bool
== :: UpdateByteMatchSet -> UpdateByteMatchSet -> Bool
$c== :: UpdateByteMatchSet -> UpdateByteMatchSet -> Bool
Prelude.Eq, ReadPrec [UpdateByteMatchSet]
ReadPrec UpdateByteMatchSet
Int -> ReadS UpdateByteMatchSet
ReadS [UpdateByteMatchSet]
(Int -> ReadS UpdateByteMatchSet)
-> ReadS [UpdateByteMatchSet]
-> ReadPrec UpdateByteMatchSet
-> ReadPrec [UpdateByteMatchSet]
-> Read UpdateByteMatchSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateByteMatchSet]
$creadListPrec :: ReadPrec [UpdateByteMatchSet]
readPrec :: ReadPrec UpdateByteMatchSet
$creadPrec :: ReadPrec UpdateByteMatchSet
readList :: ReadS [UpdateByteMatchSet]
$creadList :: ReadS [UpdateByteMatchSet]
readsPrec :: Int -> ReadS UpdateByteMatchSet
$creadsPrec :: Int -> ReadS UpdateByteMatchSet
Prelude.Read, Int -> UpdateByteMatchSet -> ShowS
[UpdateByteMatchSet] -> ShowS
UpdateByteMatchSet -> String
(Int -> UpdateByteMatchSet -> ShowS)
-> (UpdateByteMatchSet -> String)
-> ([UpdateByteMatchSet] -> ShowS)
-> Show UpdateByteMatchSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateByteMatchSet] -> ShowS
$cshowList :: [UpdateByteMatchSet] -> ShowS
show :: UpdateByteMatchSet -> String
$cshow :: UpdateByteMatchSet -> String
showsPrec :: Int -> UpdateByteMatchSet -> ShowS
$cshowsPrec :: Int -> UpdateByteMatchSet -> ShowS
Prelude.Show, (forall x. UpdateByteMatchSet -> Rep UpdateByteMatchSet x)
-> (forall x. Rep UpdateByteMatchSet x -> UpdateByteMatchSet)
-> Generic UpdateByteMatchSet
forall x. Rep UpdateByteMatchSet x -> UpdateByteMatchSet
forall x. UpdateByteMatchSet -> Rep UpdateByteMatchSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateByteMatchSet x -> UpdateByteMatchSet
$cfrom :: forall x. UpdateByteMatchSet -> Rep UpdateByteMatchSet x
Prelude.Generic)

-- |
-- Create a value of 'UpdateByteMatchSet' 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:
--
-- 'byteMatchSetId', 'updateByteMatchSet_byteMatchSetId' - The @ByteMatchSetId@ of the ByteMatchSet that you want to update.
-- @ByteMatchSetId@ is returned by CreateByteMatchSet and by
-- ListByteMatchSets.
--
-- 'changeToken', 'updateByteMatchSet_changeToken' - The value returned by the most recent call to GetChangeToken.
--
-- 'updates', 'updateByteMatchSet_updates' - An array of @ByteMatchSetUpdate@ objects that you want to insert into or
-- delete from a ByteMatchSet. For more information, see the applicable
-- data types:
--
-- -   ByteMatchSetUpdate: Contains @Action@ and @ByteMatchTuple@
--
-- -   ByteMatchTuple: Contains @FieldToMatch@, @PositionalConstraint@,
--     @TargetString@, and @TextTransformation@
--
-- -   FieldToMatch: Contains @Data@ and @Type@
newUpdateByteMatchSet ::
  -- | 'byteMatchSetId'
  Prelude.Text ->
  -- | 'changeToken'
  Prelude.Text ->
  -- | 'updates'
  Prelude.NonEmpty ByteMatchSetUpdate ->
  UpdateByteMatchSet
newUpdateByteMatchSet :: Text -> Text -> NonEmpty ByteMatchSetUpdate -> UpdateByteMatchSet
newUpdateByteMatchSet
  Text
pByteMatchSetId_
  Text
pChangeToken_
  NonEmpty ByteMatchSetUpdate
pUpdates_ =
    UpdateByteMatchSet' :: Text -> Text -> NonEmpty ByteMatchSetUpdate -> UpdateByteMatchSet
UpdateByteMatchSet'
      { $sel:byteMatchSetId:UpdateByteMatchSet' :: Text
byteMatchSetId =
          Text
pByteMatchSetId_,
        $sel:changeToken:UpdateByteMatchSet' :: Text
changeToken = Text
pChangeToken_,
        $sel:updates:UpdateByteMatchSet' :: NonEmpty ByteMatchSetUpdate
updates = Tagged
  (NonEmpty ByteMatchSetUpdate)
  (Identity (NonEmpty ByteMatchSetUpdate))
-> Tagged
     (NonEmpty ByteMatchSetUpdate)
     (Identity (NonEmpty ByteMatchSetUpdate))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty ByteMatchSetUpdate)
   (Identity (NonEmpty ByteMatchSetUpdate))
 -> Tagged
      (NonEmpty ByteMatchSetUpdate)
      (Identity (NonEmpty ByteMatchSetUpdate)))
-> NonEmpty ByteMatchSetUpdate -> NonEmpty ByteMatchSetUpdate
forall t b. AReview t b -> b -> t
Lens.# NonEmpty ByteMatchSetUpdate
pUpdates_
      }

-- | The @ByteMatchSetId@ of the ByteMatchSet that you want to update.
-- @ByteMatchSetId@ is returned by CreateByteMatchSet and by
-- ListByteMatchSets.
updateByteMatchSet_byteMatchSetId :: Lens.Lens' UpdateByteMatchSet Prelude.Text
updateByteMatchSet_byteMatchSetId :: (Text -> f Text) -> UpdateByteMatchSet -> f UpdateByteMatchSet
updateByteMatchSet_byteMatchSetId = (UpdateByteMatchSet -> Text)
-> (UpdateByteMatchSet -> Text -> UpdateByteMatchSet)
-> Lens UpdateByteMatchSet UpdateByteMatchSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateByteMatchSet' {Text
byteMatchSetId :: Text
$sel:byteMatchSetId:UpdateByteMatchSet' :: UpdateByteMatchSet -> Text
byteMatchSetId} -> Text
byteMatchSetId) (\s :: UpdateByteMatchSet
s@UpdateByteMatchSet' {} Text
a -> UpdateByteMatchSet
s {$sel:byteMatchSetId:UpdateByteMatchSet' :: Text
byteMatchSetId = Text
a} :: UpdateByteMatchSet)

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

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

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

instance Prelude.NFData UpdateByteMatchSet

instance Core.ToHeaders UpdateByteMatchSet where
  toHeaders :: UpdateByteMatchSet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateByteMatchSet -> 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.UpdateByteMatchSet" ::
                          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 UpdateByteMatchSet where
  toJSON :: UpdateByteMatchSet -> Value
toJSON UpdateByteMatchSet' {NonEmpty ByteMatchSetUpdate
Text
updates :: NonEmpty ByteMatchSetUpdate
changeToken :: Text
byteMatchSetId :: Text
$sel:updates:UpdateByteMatchSet' :: UpdateByteMatchSet -> NonEmpty ByteMatchSetUpdate
$sel:changeToken:UpdateByteMatchSet' :: UpdateByteMatchSet -> Text
$sel:byteMatchSetId:UpdateByteMatchSet' :: UpdateByteMatchSet -> 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
"ByteMatchSetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
byteMatchSetId),
            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 ByteMatchSetUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty ByteMatchSetUpdate
updates)
          ]
      )

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

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

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

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

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

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

instance Prelude.NFData UpdateByteMatchSetResponse