{-# 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-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)
module Amazonka.Pinpoint.Types.UpdateAttributesRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(UpdateAttributesRequest -> UpdateAttributesRequest -> Bool)
-> (UpdateAttributesRequest -> UpdateAttributesRequest -> Bool)
-> Eq UpdateAttributesRequest
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]
(Int -> ReadS UpdateAttributesRequest)
-> ReadS [UpdateAttributesRequest]
-> ReadPrec UpdateAttributesRequest
-> ReadPrec [UpdateAttributesRequest]
-> Read 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
(Int -> UpdateAttributesRequest -> ShowS)
-> (UpdateAttributesRequest -> String)
-> ([UpdateAttributesRequest] -> ShowS)
-> Show UpdateAttributesRequest
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.
 UpdateAttributesRequest -> Rep UpdateAttributesRequest x)
-> (forall x.
    Rep UpdateAttributesRequest x -> UpdateAttributesRequest)
-> Generic UpdateAttributesRequest
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' :: Maybe [Text] -> UpdateAttributesRequest
UpdateAttributesRequest'
    { $sel:blacklist:UpdateAttributesRequest' :: Maybe [Text]
blacklist =
        Maybe [Text]
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 :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateAttributesRequest -> f UpdateAttributesRequest
updateAttributesRequest_blacklist = (UpdateAttributesRequest -> Maybe [Text])
-> (UpdateAttributesRequest
    -> Maybe [Text] -> UpdateAttributesRequest)
-> Lens
     UpdateAttributesRequest
     UpdateAttributesRequest
     (Maybe [Text])
     (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateAttributesRequest -> f UpdateAttributesRequest)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateAttributesRequest
-> f UpdateAttributesRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.Hashable UpdateAttributesRequest

instance Prelude.NFData UpdateAttributesRequest

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