{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Pinpoint.Types.UpdateAttributesRequest
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Pinpoint.Types.UpdateAttributesRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Specifies one or more attributes to remove from all the endpoints that
-- are associated with an application.
--
-- /See:/ 'newUpdateAttributesRequest' smart constructor.
data UpdateAttributesRequest = UpdateAttributesRequest'
  { -- | An array of the attributes to remove from all the endpoints that are
    -- associated with the application. The array can specify the complete,
    -- exact name of each attribute to remove or it can specify a glob pattern
    -- that an attribute name must match in order for the attribute to be
    -- removed.
    UpdateAttributesRequest -> Maybe [Text]
blacklist :: Prelude.Maybe [Prelude.Text]
  }
  deriving (UpdateAttributesRequest -> UpdateAttributesRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAttributesRequest -> UpdateAttributesRequest -> Bool
$c/= :: UpdateAttributesRequest -> UpdateAttributesRequest -> Bool
== :: UpdateAttributesRequest -> UpdateAttributesRequest -> Bool
$c== :: UpdateAttributesRequest -> UpdateAttributesRequest -> Bool
Prelude.Eq, ReadPrec [UpdateAttributesRequest]
ReadPrec UpdateAttributesRequest
Int -> ReadS UpdateAttributesRequest
ReadS [UpdateAttributesRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAttributesRequest]
$creadListPrec :: ReadPrec [UpdateAttributesRequest]
readPrec :: ReadPrec UpdateAttributesRequest
$creadPrec :: ReadPrec UpdateAttributesRequest
readList :: ReadS [UpdateAttributesRequest]
$creadList :: ReadS [UpdateAttributesRequest]
readsPrec :: Int -> ReadS UpdateAttributesRequest
$creadsPrec :: Int -> ReadS UpdateAttributesRequest
Prelude.Read, Int -> UpdateAttributesRequest -> ShowS
[UpdateAttributesRequest] -> ShowS
UpdateAttributesRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAttributesRequest] -> ShowS
$cshowList :: [UpdateAttributesRequest] -> ShowS
show :: UpdateAttributesRequest -> String
$cshow :: UpdateAttributesRequest -> String
showsPrec :: Int -> UpdateAttributesRequest -> ShowS
$cshowsPrec :: Int -> UpdateAttributesRequest -> ShowS
Prelude.Show, forall x. Rep UpdateAttributesRequest x -> UpdateAttributesRequest
forall x. UpdateAttributesRequest -> Rep UpdateAttributesRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAttributesRequest x -> UpdateAttributesRequest
$cfrom :: forall x. UpdateAttributesRequest -> Rep UpdateAttributesRequest x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAttributesRequest' 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:
--
-- 'blacklist', 'updateAttributesRequest_blacklist' - An array of the attributes to remove from all the endpoints that are
-- associated with the application. The array can specify the complete,
-- exact name of each attribute to remove or it can specify a glob pattern
-- that an attribute name must match in order for the attribute to be
-- removed.
newUpdateAttributesRequest ::
  UpdateAttributesRequest
newUpdateAttributesRequest :: UpdateAttributesRequest
newUpdateAttributesRequest =
  UpdateAttributesRequest'
    { $sel:blacklist:UpdateAttributesRequest' :: Maybe [Text]
blacklist =
        forall a. Maybe a
Prelude.Nothing
    }

-- | An array of the attributes to remove from all the endpoints that are
-- associated with the application. The array can specify the complete,
-- exact name of each attribute to remove or it can specify a glob pattern
-- that an attribute name must match in order for the attribute to be
-- removed.
updateAttributesRequest_blacklist :: Lens.Lens' UpdateAttributesRequest (Prelude.Maybe [Prelude.Text])
updateAttributesRequest_blacklist :: Lens' UpdateAttributesRequest (Maybe [Text])
updateAttributesRequest_blacklist = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAttributesRequest' {Maybe [Text]
blacklist :: Maybe [Text]
$sel:blacklist:UpdateAttributesRequest' :: UpdateAttributesRequest -> Maybe [Text]
blacklist} -> Maybe [Text]
blacklist) (\s :: UpdateAttributesRequest
s@UpdateAttributesRequest' {} Maybe [Text]
a -> UpdateAttributesRequest
s {$sel:blacklist:UpdateAttributesRequest' :: Maybe [Text]
blacklist = Maybe [Text]
a} :: UpdateAttributesRequest) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.Hashable UpdateAttributesRequest where
  hashWithSalt :: Int -> UpdateAttributesRequest -> Int
hashWithSalt Int
_salt UpdateAttributesRequest' {Maybe [Text]
blacklist :: Maybe [Text]
$sel:blacklist:UpdateAttributesRequest' :: UpdateAttributesRequest -> Maybe [Text]
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
blacklist

instance Prelude.NFData UpdateAttributesRequest where
  rnf :: UpdateAttributesRequest -> ()
rnf UpdateAttributesRequest' {Maybe [Text]
blacklist :: Maybe [Text]
$sel:blacklist:UpdateAttributesRequest' :: UpdateAttributesRequest -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
blacklist

instance Data.ToJSON UpdateAttributesRequest where
  toJSON :: UpdateAttributesRequest -> Value
toJSON UpdateAttributesRequest' {Maybe [Text]
blacklist :: Maybe [Text]
$sel:blacklist:UpdateAttributesRequest' :: UpdateAttributesRequest -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"Blacklist" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
blacklist]
      )