{-# 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.UpdateSizeConstraintSet
-- 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 SizeConstraint objects (filters) in a
-- SizeConstraintSet. For each @SizeConstraint@ object, you specify the
-- following values:
--
-- -   Whether to insert or delete the object from the array. If you want
--     to change a @SizeConstraintSetUpdate@ object, you delete the
--     existing object and add a new one.
--
-- -   The part of a web request that you want AWS WAF to evaluate, such as
--     the length of a query string or the length of the @User-Agent@
--     header.
--
-- -   Whether to perform any transformations on the request, such as
--     converting it to lowercase, before checking its length. Note that
--     transformations of the request body are not supported because the
--     AWS resource forwards only the first @8192@ bytes of your request to
--     AWS WAF.
--
--     You can only specify a single type of TextTransformation.
--
-- -   A @ComparisonOperator@ used for evaluating the selected part of the
--     request against the specified @Size@, such as equals, greater than,
--     less than, and so on.
--
-- -   The length, in bytes, that you want AWS WAF to watch for in selected
--     part of the request. The length is computed after applying the
--     transformation.
--
-- For example, you can add a @SizeConstraintSetUpdate@ object that matches
-- web requests in which the length of the @User-Agent@ header is greater
-- than 100 bytes. You can then configure AWS WAF to block those requests.
--
-- To create and configure a @SizeConstraintSet@, perform the following
-- steps:
--
-- 1.  Create a @SizeConstraintSet.@ For more information, see
--     CreateSizeConstraintSet.
--
-- 2.  Use GetChangeToken to get the change token that you provide in the
--     @ChangeToken@ parameter of an @UpdateSizeConstraintSet@ request.
--
-- 3.  Submit an @UpdateSizeConstraintSet@ 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.UpdateSizeConstraintSet
  ( -- * Creating a Request
    UpdateSizeConstraintSet (..),
    newUpdateSizeConstraintSet,

    -- * Request Lenses
    updateSizeConstraintSet_sizeConstraintSetId,
    updateSizeConstraintSet_changeToken,
    updateSizeConstraintSet_updates,

    -- * Destructuring the Response
    UpdateSizeConstraintSetResponse (..),
    newUpdateSizeConstraintSetResponse,

    -- * Response Lenses
    updateSizeConstraintSetResponse_changeToken,
    updateSizeConstraintSetResponse_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:/ 'newUpdateSizeConstraintSet' smart constructor.
data UpdateSizeConstraintSet = UpdateSizeConstraintSet'
  { -- | The @SizeConstraintSetId@ of the SizeConstraintSet that you want to
    -- update. @SizeConstraintSetId@ is returned by CreateSizeConstraintSet and
    -- by ListSizeConstraintSets.
    UpdateSizeConstraintSet -> Text
sizeConstraintSetId :: Prelude.Text,
    -- | The value returned by the most recent call to GetChangeToken.
    UpdateSizeConstraintSet -> Text
changeToken :: Prelude.Text,
    -- | An array of @SizeConstraintSetUpdate@ objects that you want to insert
    -- into or delete from a SizeConstraintSet. For more information, see the
    -- applicable data types:
    --
    -- -   SizeConstraintSetUpdate: Contains @Action@ and @SizeConstraint@
    --
    -- -   SizeConstraint: Contains @FieldToMatch@, @TextTransformation@,
    --     @ComparisonOperator@, and @Size@
    --
    -- -   FieldToMatch: Contains @Data@ and @Type@
    UpdateSizeConstraintSet -> NonEmpty SizeConstraintSetUpdate
updates :: Prelude.NonEmpty SizeConstraintSetUpdate
  }
  deriving (UpdateSizeConstraintSet -> UpdateSizeConstraintSet -> Bool
(UpdateSizeConstraintSet -> UpdateSizeConstraintSet -> Bool)
-> (UpdateSizeConstraintSet -> UpdateSizeConstraintSet -> Bool)
-> Eq UpdateSizeConstraintSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSizeConstraintSet -> UpdateSizeConstraintSet -> Bool
$c/= :: UpdateSizeConstraintSet -> UpdateSizeConstraintSet -> Bool
== :: UpdateSizeConstraintSet -> UpdateSizeConstraintSet -> Bool
$c== :: UpdateSizeConstraintSet -> UpdateSizeConstraintSet -> Bool
Prelude.Eq, ReadPrec [UpdateSizeConstraintSet]
ReadPrec UpdateSizeConstraintSet
Int -> ReadS UpdateSizeConstraintSet
ReadS [UpdateSizeConstraintSet]
(Int -> ReadS UpdateSizeConstraintSet)
-> ReadS [UpdateSizeConstraintSet]
-> ReadPrec UpdateSizeConstraintSet
-> ReadPrec [UpdateSizeConstraintSet]
-> Read UpdateSizeConstraintSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSizeConstraintSet]
$creadListPrec :: ReadPrec [UpdateSizeConstraintSet]
readPrec :: ReadPrec UpdateSizeConstraintSet
$creadPrec :: ReadPrec UpdateSizeConstraintSet
readList :: ReadS [UpdateSizeConstraintSet]
$creadList :: ReadS [UpdateSizeConstraintSet]
readsPrec :: Int -> ReadS UpdateSizeConstraintSet
$creadsPrec :: Int -> ReadS UpdateSizeConstraintSet
Prelude.Read, Int -> UpdateSizeConstraintSet -> ShowS
[UpdateSizeConstraintSet] -> ShowS
UpdateSizeConstraintSet -> String
(Int -> UpdateSizeConstraintSet -> ShowS)
-> (UpdateSizeConstraintSet -> String)
-> ([UpdateSizeConstraintSet] -> ShowS)
-> Show UpdateSizeConstraintSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSizeConstraintSet] -> ShowS
$cshowList :: [UpdateSizeConstraintSet] -> ShowS
show :: UpdateSizeConstraintSet -> String
$cshow :: UpdateSizeConstraintSet -> String
showsPrec :: Int -> UpdateSizeConstraintSet -> ShowS
$cshowsPrec :: Int -> UpdateSizeConstraintSet -> ShowS
Prelude.Show, (forall x.
 UpdateSizeConstraintSet -> Rep UpdateSizeConstraintSet x)
-> (forall x.
    Rep UpdateSizeConstraintSet x -> UpdateSizeConstraintSet)
-> Generic UpdateSizeConstraintSet
forall x. Rep UpdateSizeConstraintSet x -> UpdateSizeConstraintSet
forall x. UpdateSizeConstraintSet -> Rep UpdateSizeConstraintSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateSizeConstraintSet x -> UpdateSizeConstraintSet
$cfrom :: forall x. UpdateSizeConstraintSet -> Rep UpdateSizeConstraintSet x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSizeConstraintSet' 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:
--
-- 'sizeConstraintSetId', 'updateSizeConstraintSet_sizeConstraintSetId' - The @SizeConstraintSetId@ of the SizeConstraintSet that you want to
-- update. @SizeConstraintSetId@ is returned by CreateSizeConstraintSet and
-- by ListSizeConstraintSets.
--
-- 'changeToken', 'updateSizeConstraintSet_changeToken' - The value returned by the most recent call to GetChangeToken.
--
-- 'updates', 'updateSizeConstraintSet_updates' - An array of @SizeConstraintSetUpdate@ objects that you want to insert
-- into or delete from a SizeConstraintSet. For more information, see the
-- applicable data types:
--
-- -   SizeConstraintSetUpdate: Contains @Action@ and @SizeConstraint@
--
-- -   SizeConstraint: Contains @FieldToMatch@, @TextTransformation@,
--     @ComparisonOperator@, and @Size@
--
-- -   FieldToMatch: Contains @Data@ and @Type@
newUpdateSizeConstraintSet ::
  -- | 'sizeConstraintSetId'
  Prelude.Text ->
  -- | 'changeToken'
  Prelude.Text ->
  -- | 'updates'
  Prelude.NonEmpty SizeConstraintSetUpdate ->
  UpdateSizeConstraintSet
newUpdateSizeConstraintSet :: Text
-> Text
-> NonEmpty SizeConstraintSetUpdate
-> UpdateSizeConstraintSet
newUpdateSizeConstraintSet
  Text
pSizeConstraintSetId_
  Text
pChangeToken_
  NonEmpty SizeConstraintSetUpdate
pUpdates_ =
    UpdateSizeConstraintSet' :: Text
-> Text
-> NonEmpty SizeConstraintSetUpdate
-> UpdateSizeConstraintSet
UpdateSizeConstraintSet'
      { $sel:sizeConstraintSetId:UpdateSizeConstraintSet' :: Text
sizeConstraintSetId =
          Text
pSizeConstraintSetId_,
        $sel:changeToken:UpdateSizeConstraintSet' :: Text
changeToken = Text
pChangeToken_,
        $sel:updates:UpdateSizeConstraintSet' :: NonEmpty SizeConstraintSetUpdate
updates = Tagged
  (NonEmpty SizeConstraintSetUpdate)
  (Identity (NonEmpty SizeConstraintSetUpdate))
-> Tagged
     (NonEmpty SizeConstraintSetUpdate)
     (Identity (NonEmpty SizeConstraintSetUpdate))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty SizeConstraintSetUpdate)
   (Identity (NonEmpty SizeConstraintSetUpdate))
 -> Tagged
      (NonEmpty SizeConstraintSetUpdate)
      (Identity (NonEmpty SizeConstraintSetUpdate)))
-> NonEmpty SizeConstraintSetUpdate
-> NonEmpty SizeConstraintSetUpdate
forall t b. AReview t b -> b -> t
Lens.# NonEmpty SizeConstraintSetUpdate
pUpdates_
      }

-- | The @SizeConstraintSetId@ of the SizeConstraintSet that you want to
-- update. @SizeConstraintSetId@ is returned by CreateSizeConstraintSet and
-- by ListSizeConstraintSets.
updateSizeConstraintSet_sizeConstraintSetId :: Lens.Lens' UpdateSizeConstraintSet Prelude.Text
updateSizeConstraintSet_sizeConstraintSetId :: (Text -> f Text)
-> UpdateSizeConstraintSet -> f UpdateSizeConstraintSet
updateSizeConstraintSet_sizeConstraintSetId = (UpdateSizeConstraintSet -> Text)
-> (UpdateSizeConstraintSet -> Text -> UpdateSizeConstraintSet)
-> Lens UpdateSizeConstraintSet UpdateSizeConstraintSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSizeConstraintSet' {Text
sizeConstraintSetId :: Text
$sel:sizeConstraintSetId:UpdateSizeConstraintSet' :: UpdateSizeConstraintSet -> Text
sizeConstraintSetId} -> Text
sizeConstraintSetId) (\s :: UpdateSizeConstraintSet
s@UpdateSizeConstraintSet' {} Text
a -> UpdateSizeConstraintSet
s {$sel:sizeConstraintSetId:UpdateSizeConstraintSet' :: Text
sizeConstraintSetId = Text
a} :: UpdateSizeConstraintSet)

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

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

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

instance Prelude.NFData UpdateSizeConstraintSet

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

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

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

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

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

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

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

instance
  Prelude.NFData
    UpdateSizeConstraintSetResponse