{-# 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.UpdateGeoMatchSet
-- 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 GeoMatchConstraint objects in an @GeoMatchSet@. For
-- each @GeoMatchConstraint@ object, you specify the following values:
--
-- -   Whether to insert or delete the object from the array. If you want
--     to change an @GeoMatchConstraint@ object, you delete the existing
--     object and add a new one.
--
-- -   The @Type@. The only valid value for @Type@ is @Country@.
--
-- -   The @Value@, which is a two character code for the country to add to
--     the @GeoMatchConstraint@ object. Valid codes are listed in
--     GeoMatchConstraint$Value.
--
-- To create and configure an @GeoMatchSet@, perform the following steps:
--
-- 1.  Submit a CreateGeoMatchSet request.
--
-- 2.  Use GetChangeToken to get the change token that you provide in the
--     @ChangeToken@ parameter of an UpdateGeoMatchSet request.
--
-- 3.  Submit an @UpdateGeoMatchSet@ request to specify the country that
--     you want AWS WAF to watch for.
--
-- When you update an @GeoMatchSet@, you specify the country that you want
-- to add and\/or the country that you want to delete. If you want to
-- change a country, you delete the existing country 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.WAF.UpdateGeoMatchSet
  ( -- * Creating a Request
    UpdateGeoMatchSet (..),
    newUpdateGeoMatchSet,

    -- * Request Lenses
    updateGeoMatchSet_geoMatchSetId,
    updateGeoMatchSet_changeToken,
    updateGeoMatchSet_updates,

    -- * Destructuring the Response
    UpdateGeoMatchSetResponse (..),
    newUpdateGeoMatchSetResponse,

    -- * Response Lenses
    updateGeoMatchSetResponse_changeToken,
    updateGeoMatchSetResponse_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:/ 'newUpdateGeoMatchSet' smart constructor.
data UpdateGeoMatchSet = UpdateGeoMatchSet'
  { -- | The @GeoMatchSetId@ of the GeoMatchSet that you want to update.
    -- @GeoMatchSetId@ is returned by CreateGeoMatchSet and by
    -- ListGeoMatchSets.
    UpdateGeoMatchSet -> Text
geoMatchSetId :: Prelude.Text,
    -- | The value returned by the most recent call to GetChangeToken.
    UpdateGeoMatchSet -> Text
changeToken :: Prelude.Text,
    -- | An array of @GeoMatchSetUpdate@ objects that you want to insert into or
    -- delete from an GeoMatchSet. For more information, see the applicable
    -- data types:
    --
    -- -   GeoMatchSetUpdate: Contains @Action@ and @GeoMatchConstraint@
    --
    -- -   GeoMatchConstraint: Contains @Type@ and @Value@
    --
    --     You can have only one @Type@ and @Value@ per @GeoMatchConstraint@.
    --     To add multiple countries, include multiple @GeoMatchSetUpdate@
    --     objects in your request.
    UpdateGeoMatchSet -> NonEmpty GeoMatchSetUpdate
updates :: Prelude.NonEmpty GeoMatchSetUpdate
  }
  deriving (UpdateGeoMatchSet -> UpdateGeoMatchSet -> Bool
(UpdateGeoMatchSet -> UpdateGeoMatchSet -> Bool)
-> (UpdateGeoMatchSet -> UpdateGeoMatchSet -> Bool)
-> Eq UpdateGeoMatchSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateGeoMatchSet -> UpdateGeoMatchSet -> Bool
$c/= :: UpdateGeoMatchSet -> UpdateGeoMatchSet -> Bool
== :: UpdateGeoMatchSet -> UpdateGeoMatchSet -> Bool
$c== :: UpdateGeoMatchSet -> UpdateGeoMatchSet -> Bool
Prelude.Eq, ReadPrec [UpdateGeoMatchSet]
ReadPrec UpdateGeoMatchSet
Int -> ReadS UpdateGeoMatchSet
ReadS [UpdateGeoMatchSet]
(Int -> ReadS UpdateGeoMatchSet)
-> ReadS [UpdateGeoMatchSet]
-> ReadPrec UpdateGeoMatchSet
-> ReadPrec [UpdateGeoMatchSet]
-> Read UpdateGeoMatchSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateGeoMatchSet]
$creadListPrec :: ReadPrec [UpdateGeoMatchSet]
readPrec :: ReadPrec UpdateGeoMatchSet
$creadPrec :: ReadPrec UpdateGeoMatchSet
readList :: ReadS [UpdateGeoMatchSet]
$creadList :: ReadS [UpdateGeoMatchSet]
readsPrec :: Int -> ReadS UpdateGeoMatchSet
$creadsPrec :: Int -> ReadS UpdateGeoMatchSet
Prelude.Read, Int -> UpdateGeoMatchSet -> ShowS
[UpdateGeoMatchSet] -> ShowS
UpdateGeoMatchSet -> String
(Int -> UpdateGeoMatchSet -> ShowS)
-> (UpdateGeoMatchSet -> String)
-> ([UpdateGeoMatchSet] -> ShowS)
-> Show UpdateGeoMatchSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateGeoMatchSet] -> ShowS
$cshowList :: [UpdateGeoMatchSet] -> ShowS
show :: UpdateGeoMatchSet -> String
$cshow :: UpdateGeoMatchSet -> String
showsPrec :: Int -> UpdateGeoMatchSet -> ShowS
$cshowsPrec :: Int -> UpdateGeoMatchSet -> ShowS
Prelude.Show, (forall x. UpdateGeoMatchSet -> Rep UpdateGeoMatchSet x)
-> (forall x. Rep UpdateGeoMatchSet x -> UpdateGeoMatchSet)
-> Generic UpdateGeoMatchSet
forall x. Rep UpdateGeoMatchSet x -> UpdateGeoMatchSet
forall x. UpdateGeoMatchSet -> Rep UpdateGeoMatchSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateGeoMatchSet x -> UpdateGeoMatchSet
$cfrom :: forall x. UpdateGeoMatchSet -> Rep UpdateGeoMatchSet x
Prelude.Generic)

-- |
-- Create a value of 'UpdateGeoMatchSet' 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:
--
-- 'geoMatchSetId', 'updateGeoMatchSet_geoMatchSetId' - The @GeoMatchSetId@ of the GeoMatchSet that you want to update.
-- @GeoMatchSetId@ is returned by CreateGeoMatchSet and by
-- ListGeoMatchSets.
--
-- 'changeToken', 'updateGeoMatchSet_changeToken' - The value returned by the most recent call to GetChangeToken.
--
-- 'updates', 'updateGeoMatchSet_updates' - An array of @GeoMatchSetUpdate@ objects that you want to insert into or
-- delete from an GeoMatchSet. For more information, see the applicable
-- data types:
--
-- -   GeoMatchSetUpdate: Contains @Action@ and @GeoMatchConstraint@
--
-- -   GeoMatchConstraint: Contains @Type@ and @Value@
--
--     You can have only one @Type@ and @Value@ per @GeoMatchConstraint@.
--     To add multiple countries, include multiple @GeoMatchSetUpdate@
--     objects in your request.
newUpdateGeoMatchSet ::
  -- | 'geoMatchSetId'
  Prelude.Text ->
  -- | 'changeToken'
  Prelude.Text ->
  -- | 'updates'
  Prelude.NonEmpty GeoMatchSetUpdate ->
  UpdateGeoMatchSet
newUpdateGeoMatchSet :: Text -> Text -> NonEmpty GeoMatchSetUpdate -> UpdateGeoMatchSet
newUpdateGeoMatchSet
  Text
pGeoMatchSetId_
  Text
pChangeToken_
  NonEmpty GeoMatchSetUpdate
pUpdates_ =
    UpdateGeoMatchSet' :: Text -> Text -> NonEmpty GeoMatchSetUpdate -> UpdateGeoMatchSet
UpdateGeoMatchSet'
      { $sel:geoMatchSetId:UpdateGeoMatchSet' :: Text
geoMatchSetId = Text
pGeoMatchSetId_,
        $sel:changeToken:UpdateGeoMatchSet' :: Text
changeToken = Text
pChangeToken_,
        $sel:updates:UpdateGeoMatchSet' :: NonEmpty GeoMatchSetUpdate
updates = Tagged
  (NonEmpty GeoMatchSetUpdate)
  (Identity (NonEmpty GeoMatchSetUpdate))
-> Tagged
     (NonEmpty GeoMatchSetUpdate)
     (Identity (NonEmpty GeoMatchSetUpdate))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty GeoMatchSetUpdate)
   (Identity (NonEmpty GeoMatchSetUpdate))
 -> Tagged
      (NonEmpty GeoMatchSetUpdate)
      (Identity (NonEmpty GeoMatchSetUpdate)))
-> NonEmpty GeoMatchSetUpdate -> NonEmpty GeoMatchSetUpdate
forall t b. AReview t b -> b -> t
Lens.# NonEmpty GeoMatchSetUpdate
pUpdates_
      }

-- | The @GeoMatchSetId@ of the GeoMatchSet that you want to update.
-- @GeoMatchSetId@ is returned by CreateGeoMatchSet and by
-- ListGeoMatchSets.
updateGeoMatchSet_geoMatchSetId :: Lens.Lens' UpdateGeoMatchSet Prelude.Text
updateGeoMatchSet_geoMatchSetId :: (Text -> f Text) -> UpdateGeoMatchSet -> f UpdateGeoMatchSet
updateGeoMatchSet_geoMatchSetId = (UpdateGeoMatchSet -> Text)
-> (UpdateGeoMatchSet -> Text -> UpdateGeoMatchSet)
-> Lens UpdateGeoMatchSet UpdateGeoMatchSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGeoMatchSet' {Text
geoMatchSetId :: Text
$sel:geoMatchSetId:UpdateGeoMatchSet' :: UpdateGeoMatchSet -> Text
geoMatchSetId} -> Text
geoMatchSetId) (\s :: UpdateGeoMatchSet
s@UpdateGeoMatchSet' {} Text
a -> UpdateGeoMatchSet
s {$sel:geoMatchSetId:UpdateGeoMatchSet' :: Text
geoMatchSetId = Text
a} :: UpdateGeoMatchSet)

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

-- | An array of @GeoMatchSetUpdate@ objects that you want to insert into or
-- delete from an GeoMatchSet. For more information, see the applicable
-- data types:
--
-- -   GeoMatchSetUpdate: Contains @Action@ and @GeoMatchConstraint@
--
-- -   GeoMatchConstraint: Contains @Type@ and @Value@
--
--     You can have only one @Type@ and @Value@ per @GeoMatchConstraint@.
--     To add multiple countries, include multiple @GeoMatchSetUpdate@
--     objects in your request.
updateGeoMatchSet_updates :: Lens.Lens' UpdateGeoMatchSet (Prelude.NonEmpty GeoMatchSetUpdate)
updateGeoMatchSet_updates :: (NonEmpty GeoMatchSetUpdate -> f (NonEmpty GeoMatchSetUpdate))
-> UpdateGeoMatchSet -> f UpdateGeoMatchSet
updateGeoMatchSet_updates = (UpdateGeoMatchSet -> NonEmpty GeoMatchSetUpdate)
-> (UpdateGeoMatchSet
    -> NonEmpty GeoMatchSetUpdate -> UpdateGeoMatchSet)
-> Lens
     UpdateGeoMatchSet
     UpdateGeoMatchSet
     (NonEmpty GeoMatchSetUpdate)
     (NonEmpty GeoMatchSetUpdate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateGeoMatchSet' {NonEmpty GeoMatchSetUpdate
updates :: NonEmpty GeoMatchSetUpdate
$sel:updates:UpdateGeoMatchSet' :: UpdateGeoMatchSet -> NonEmpty GeoMatchSetUpdate
updates} -> NonEmpty GeoMatchSetUpdate
updates) (\s :: UpdateGeoMatchSet
s@UpdateGeoMatchSet' {} NonEmpty GeoMatchSetUpdate
a -> UpdateGeoMatchSet
s {$sel:updates:UpdateGeoMatchSet' :: NonEmpty GeoMatchSetUpdate
updates = NonEmpty GeoMatchSetUpdate
a} :: UpdateGeoMatchSet) ((NonEmpty GeoMatchSetUpdate -> f (NonEmpty GeoMatchSetUpdate))
 -> UpdateGeoMatchSet -> f UpdateGeoMatchSet)
-> ((NonEmpty GeoMatchSetUpdate -> f (NonEmpty GeoMatchSetUpdate))
    -> NonEmpty GeoMatchSetUpdate -> f (NonEmpty GeoMatchSetUpdate))
-> (NonEmpty GeoMatchSetUpdate -> f (NonEmpty GeoMatchSetUpdate))
-> UpdateGeoMatchSet
-> f UpdateGeoMatchSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty GeoMatchSetUpdate -> f (NonEmpty GeoMatchSetUpdate))
-> NonEmpty GeoMatchSetUpdate -> f (NonEmpty GeoMatchSetUpdate)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData UpdateGeoMatchSet

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

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

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

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

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

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

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

instance Prelude.NFData UpdateGeoMatchSetResponse