{-# 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.UpdateRuleGroup
-- 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 ActivatedRule objects in a @RuleGroup@.
--
-- You can only insert @REGULAR@ rules into a rule group.
--
-- You can have a maximum of ten rules per rule group.
--
-- To create and configure a @RuleGroup@, perform the following steps:
--
-- 1.  Create and update the @Rules@ that you want to include in the
--     @RuleGroup@. See CreateRule.
--
-- 2.  Use @GetChangeToken@ to get the change token that you provide in the
--     @ChangeToken@ parameter of an UpdateRuleGroup request.
--
-- 3.  Submit an @UpdateRuleGroup@ request to add @Rules@ to the
--     @RuleGroup@.
--
-- 4.  Create and update a @WebACL@ that contains the @RuleGroup@. See
--     CreateWebACL.
--
-- If you want to replace one @Rule@ with another, you delete the existing
-- one and add the new one.
--
-- 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.UpdateRuleGroup
  ( -- * Creating a Request
    UpdateRuleGroup (..),
    newUpdateRuleGroup,

    -- * Request Lenses
    updateRuleGroup_ruleGroupId,
    updateRuleGroup_updates,
    updateRuleGroup_changeToken,

    -- * Destructuring the Response
    UpdateRuleGroupResponse (..),
    newUpdateRuleGroupResponse,

    -- * Response Lenses
    updateRuleGroupResponse_changeToken,
    updateRuleGroupResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WAFRegional.Types

-- | /See:/ 'newUpdateRuleGroup' smart constructor.
data UpdateRuleGroup = UpdateRuleGroup'
  { -- | The @RuleGroupId@ of the RuleGroup that you want to update.
    -- @RuleGroupId@ is returned by CreateRuleGroup and by ListRuleGroups.
    UpdateRuleGroup -> Text
ruleGroupId :: Prelude.Text,
    -- | An array of @RuleGroupUpdate@ objects that you want to insert into or
    -- delete from a RuleGroup.
    --
    -- You can only insert @REGULAR@ rules into a rule group.
    --
    -- @ActivatedRule|OverrideAction@ applies only when updating or adding a
    -- @RuleGroup@ to a @WebACL@. In this case you do not use
    -- @ActivatedRule|Action@. For all other update requests,
    -- @ActivatedRule|Action@ is used instead of
    -- @ActivatedRule|OverrideAction@.
    UpdateRuleGroup -> NonEmpty RuleGroupUpdate
updates :: Prelude.NonEmpty RuleGroupUpdate,
    -- | The value returned by the most recent call to GetChangeToken.
    UpdateRuleGroup -> Text
changeToken :: Prelude.Text
  }
  deriving (UpdateRuleGroup -> UpdateRuleGroup -> Bool
(UpdateRuleGroup -> UpdateRuleGroup -> Bool)
-> (UpdateRuleGroup -> UpdateRuleGroup -> Bool)
-> Eq UpdateRuleGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRuleGroup -> UpdateRuleGroup -> Bool
$c/= :: UpdateRuleGroup -> UpdateRuleGroup -> Bool
== :: UpdateRuleGroup -> UpdateRuleGroup -> Bool
$c== :: UpdateRuleGroup -> UpdateRuleGroup -> Bool
Prelude.Eq, ReadPrec [UpdateRuleGroup]
ReadPrec UpdateRuleGroup
Int -> ReadS UpdateRuleGroup
ReadS [UpdateRuleGroup]
(Int -> ReadS UpdateRuleGroup)
-> ReadS [UpdateRuleGroup]
-> ReadPrec UpdateRuleGroup
-> ReadPrec [UpdateRuleGroup]
-> Read UpdateRuleGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRuleGroup]
$creadListPrec :: ReadPrec [UpdateRuleGroup]
readPrec :: ReadPrec UpdateRuleGroup
$creadPrec :: ReadPrec UpdateRuleGroup
readList :: ReadS [UpdateRuleGroup]
$creadList :: ReadS [UpdateRuleGroup]
readsPrec :: Int -> ReadS UpdateRuleGroup
$creadsPrec :: Int -> ReadS UpdateRuleGroup
Prelude.Read, Int -> UpdateRuleGroup -> ShowS
[UpdateRuleGroup] -> ShowS
UpdateRuleGroup -> String
(Int -> UpdateRuleGroup -> ShowS)
-> (UpdateRuleGroup -> String)
-> ([UpdateRuleGroup] -> ShowS)
-> Show UpdateRuleGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRuleGroup] -> ShowS
$cshowList :: [UpdateRuleGroup] -> ShowS
show :: UpdateRuleGroup -> String
$cshow :: UpdateRuleGroup -> String
showsPrec :: Int -> UpdateRuleGroup -> ShowS
$cshowsPrec :: Int -> UpdateRuleGroup -> ShowS
Prelude.Show, (forall x. UpdateRuleGroup -> Rep UpdateRuleGroup x)
-> (forall x. Rep UpdateRuleGroup x -> UpdateRuleGroup)
-> Generic UpdateRuleGroup
forall x. Rep UpdateRuleGroup x -> UpdateRuleGroup
forall x. UpdateRuleGroup -> Rep UpdateRuleGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRuleGroup x -> UpdateRuleGroup
$cfrom :: forall x. UpdateRuleGroup -> Rep UpdateRuleGroup x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRuleGroup' 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:
--
-- 'ruleGroupId', 'updateRuleGroup_ruleGroupId' - The @RuleGroupId@ of the RuleGroup that you want to update.
-- @RuleGroupId@ is returned by CreateRuleGroup and by ListRuleGroups.
--
-- 'updates', 'updateRuleGroup_updates' - An array of @RuleGroupUpdate@ objects that you want to insert into or
-- delete from a RuleGroup.
--
-- You can only insert @REGULAR@ rules into a rule group.
--
-- @ActivatedRule|OverrideAction@ applies only when updating or adding a
-- @RuleGroup@ to a @WebACL@. In this case you do not use
-- @ActivatedRule|Action@. For all other update requests,
-- @ActivatedRule|Action@ is used instead of
-- @ActivatedRule|OverrideAction@.
--
-- 'changeToken', 'updateRuleGroup_changeToken' - The value returned by the most recent call to GetChangeToken.
newUpdateRuleGroup ::
  -- | 'ruleGroupId'
  Prelude.Text ->
  -- | 'updates'
  Prelude.NonEmpty RuleGroupUpdate ->
  -- | 'changeToken'
  Prelude.Text ->
  UpdateRuleGroup
newUpdateRuleGroup :: Text -> NonEmpty RuleGroupUpdate -> Text -> UpdateRuleGroup
newUpdateRuleGroup
  Text
pRuleGroupId_
  NonEmpty RuleGroupUpdate
pUpdates_
  Text
pChangeToken_ =
    UpdateRuleGroup' :: Text -> NonEmpty RuleGroupUpdate -> Text -> UpdateRuleGroup
UpdateRuleGroup'
      { $sel:ruleGroupId:UpdateRuleGroup' :: Text
ruleGroupId = Text
pRuleGroupId_,
        $sel:updates:UpdateRuleGroup' :: NonEmpty RuleGroupUpdate
updates = Tagged
  (NonEmpty RuleGroupUpdate) (Identity (NonEmpty RuleGroupUpdate))
-> Tagged
     (NonEmpty RuleGroupUpdate) (Identity (NonEmpty RuleGroupUpdate))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty RuleGroupUpdate) (Identity (NonEmpty RuleGroupUpdate))
 -> Tagged
      (NonEmpty RuleGroupUpdate) (Identity (NonEmpty RuleGroupUpdate)))
-> NonEmpty RuleGroupUpdate -> NonEmpty RuleGroupUpdate
forall t b. AReview t b -> b -> t
Lens.# NonEmpty RuleGroupUpdate
pUpdates_,
        $sel:changeToken:UpdateRuleGroup' :: Text
changeToken = Text
pChangeToken_
      }

-- | The @RuleGroupId@ of the RuleGroup that you want to update.
-- @RuleGroupId@ is returned by CreateRuleGroup and by ListRuleGroups.
updateRuleGroup_ruleGroupId :: Lens.Lens' UpdateRuleGroup Prelude.Text
updateRuleGroup_ruleGroupId :: (Text -> f Text) -> UpdateRuleGroup -> f UpdateRuleGroup
updateRuleGroup_ruleGroupId = (UpdateRuleGroup -> Text)
-> (UpdateRuleGroup -> Text -> UpdateRuleGroup)
-> Lens UpdateRuleGroup UpdateRuleGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuleGroup' {Text
ruleGroupId :: Text
$sel:ruleGroupId:UpdateRuleGroup' :: UpdateRuleGroup -> Text
ruleGroupId} -> Text
ruleGroupId) (\s :: UpdateRuleGroup
s@UpdateRuleGroup' {} Text
a -> UpdateRuleGroup
s {$sel:ruleGroupId:UpdateRuleGroup' :: Text
ruleGroupId = Text
a} :: UpdateRuleGroup)

-- | An array of @RuleGroupUpdate@ objects that you want to insert into or
-- delete from a RuleGroup.
--
-- You can only insert @REGULAR@ rules into a rule group.
--
-- @ActivatedRule|OverrideAction@ applies only when updating or adding a
-- @RuleGroup@ to a @WebACL@. In this case you do not use
-- @ActivatedRule|Action@. For all other update requests,
-- @ActivatedRule|Action@ is used instead of
-- @ActivatedRule|OverrideAction@.
updateRuleGroup_updates :: Lens.Lens' UpdateRuleGroup (Prelude.NonEmpty RuleGroupUpdate)
updateRuleGroup_updates :: (NonEmpty RuleGroupUpdate -> f (NonEmpty RuleGroupUpdate))
-> UpdateRuleGroup -> f UpdateRuleGroup
updateRuleGroup_updates = (UpdateRuleGroup -> NonEmpty RuleGroupUpdate)
-> (UpdateRuleGroup -> NonEmpty RuleGroupUpdate -> UpdateRuleGroup)
-> Lens
     UpdateRuleGroup
     UpdateRuleGroup
     (NonEmpty RuleGroupUpdate)
     (NonEmpty RuleGroupUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuleGroup' {NonEmpty RuleGroupUpdate
updates :: NonEmpty RuleGroupUpdate
$sel:updates:UpdateRuleGroup' :: UpdateRuleGroup -> NonEmpty RuleGroupUpdate
updates} -> NonEmpty RuleGroupUpdate
updates) (\s :: UpdateRuleGroup
s@UpdateRuleGroup' {} NonEmpty RuleGroupUpdate
a -> UpdateRuleGroup
s {$sel:updates:UpdateRuleGroup' :: NonEmpty RuleGroupUpdate
updates = NonEmpty RuleGroupUpdate
a} :: UpdateRuleGroup) ((NonEmpty RuleGroupUpdate -> f (NonEmpty RuleGroupUpdate))
 -> UpdateRuleGroup -> f UpdateRuleGroup)
-> ((NonEmpty RuleGroupUpdate -> f (NonEmpty RuleGroupUpdate))
    -> NonEmpty RuleGroupUpdate -> f (NonEmpty RuleGroupUpdate))
-> (NonEmpty RuleGroupUpdate -> f (NonEmpty RuleGroupUpdate))
-> UpdateRuleGroup
-> f UpdateRuleGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty RuleGroupUpdate -> f (NonEmpty RuleGroupUpdate))
-> NonEmpty RuleGroupUpdate -> f (NonEmpty RuleGroupUpdate)
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.
updateRuleGroup_changeToken :: Lens.Lens' UpdateRuleGroup Prelude.Text
updateRuleGroup_changeToken :: (Text -> f Text) -> UpdateRuleGroup -> f UpdateRuleGroup
updateRuleGroup_changeToken = (UpdateRuleGroup -> Text)
-> (UpdateRuleGroup -> Text -> UpdateRuleGroup)
-> Lens UpdateRuleGroup UpdateRuleGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuleGroup' {Text
changeToken :: Text
$sel:changeToken:UpdateRuleGroup' :: UpdateRuleGroup -> Text
changeToken} -> Text
changeToken) (\s :: UpdateRuleGroup
s@UpdateRuleGroup' {} Text
a -> UpdateRuleGroup
s {$sel:changeToken:UpdateRuleGroup' :: Text
changeToken = Text
a} :: UpdateRuleGroup)

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

instance Prelude.NFData UpdateRuleGroup

instance Core.ToHeaders UpdateRuleGroup where
  toHeaders :: UpdateRuleGroup -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateRuleGroup -> 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.UpdateRuleGroup" ::
                          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 UpdateRuleGroup where
  toJSON :: UpdateRuleGroup -> Value
toJSON UpdateRuleGroup' {NonEmpty RuleGroupUpdate
Text
changeToken :: Text
updates :: NonEmpty RuleGroupUpdate
ruleGroupId :: Text
$sel:changeToken:UpdateRuleGroup' :: UpdateRuleGroup -> Text
$sel:updates:UpdateRuleGroup' :: UpdateRuleGroup -> NonEmpty RuleGroupUpdate
$sel:ruleGroupId:UpdateRuleGroup' :: UpdateRuleGroup -> 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
"RuleGroupId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
ruleGroupId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Updates" Text -> NonEmpty RuleGroupUpdate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty RuleGroupUpdate
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 UpdateRuleGroup where
  toPath :: UpdateRuleGroup -> ByteString
toPath = ByteString -> UpdateRuleGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

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

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

instance Prelude.NFData UpdateRuleGroupResponse