{-# 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.CognitoIdentity.SetPrincipalTagAttributeMap
-- 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)
--
-- You can use this operation to use default (username and clientID)
-- attribute or custom attribute mappings.
module Amazonka.CognitoIdentity.SetPrincipalTagAttributeMap
  ( -- * Creating a Request
    SetPrincipalTagAttributeMap (..),
    newSetPrincipalTagAttributeMap,

    -- * Request Lenses
    setPrincipalTagAttributeMap_principalTags,
    setPrincipalTagAttributeMap_useDefaults,
    setPrincipalTagAttributeMap_identityPoolId,
    setPrincipalTagAttributeMap_identityProviderName,

    -- * Destructuring the Response
    SetPrincipalTagAttributeMapResponse (..),
    newSetPrincipalTagAttributeMapResponse,

    -- * Response Lenses
    setPrincipalTagAttributeMapResponse_identityPoolId,
    setPrincipalTagAttributeMapResponse_identityProviderName,
    setPrincipalTagAttributeMapResponse_principalTags,
    setPrincipalTagAttributeMapResponse_useDefaults,
    setPrincipalTagAttributeMapResponse_httpStatus,
  )
where

import Amazonka.CognitoIdentity.Types
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

-- | /See:/ 'newSetPrincipalTagAttributeMap' smart constructor.
data SetPrincipalTagAttributeMap = SetPrincipalTagAttributeMap'
  { -- | You can use this operation to add principal tags.
    SetPrincipalTagAttributeMap -> Maybe (HashMap Text Text)
principalTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | You can use this operation to use default (username and clientID)
    -- attribute mappings.
    SetPrincipalTagAttributeMap -> Maybe Bool
useDefaults :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the Identity Pool you want to set attribute mappings for.
    SetPrincipalTagAttributeMap -> Text
identityPoolId :: Prelude.Text,
    -- | The provider name you want to use for attribute mappings.
    SetPrincipalTagAttributeMap -> Text
identityProviderName :: Prelude.Text
  }
  deriving (SetPrincipalTagAttributeMap -> SetPrincipalTagAttributeMap -> Bool
(SetPrincipalTagAttributeMap
 -> SetPrincipalTagAttributeMap -> Bool)
-> (SetPrincipalTagAttributeMap
    -> SetPrincipalTagAttributeMap -> Bool)
-> Eq SetPrincipalTagAttributeMap
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetPrincipalTagAttributeMap -> SetPrincipalTagAttributeMap -> Bool
$c/= :: SetPrincipalTagAttributeMap -> SetPrincipalTagAttributeMap -> Bool
== :: SetPrincipalTagAttributeMap -> SetPrincipalTagAttributeMap -> Bool
$c== :: SetPrincipalTagAttributeMap -> SetPrincipalTagAttributeMap -> Bool
Prelude.Eq, ReadPrec [SetPrincipalTagAttributeMap]
ReadPrec SetPrincipalTagAttributeMap
Int -> ReadS SetPrincipalTagAttributeMap
ReadS [SetPrincipalTagAttributeMap]
(Int -> ReadS SetPrincipalTagAttributeMap)
-> ReadS [SetPrincipalTagAttributeMap]
-> ReadPrec SetPrincipalTagAttributeMap
-> ReadPrec [SetPrincipalTagAttributeMap]
-> Read SetPrincipalTagAttributeMap
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetPrincipalTagAttributeMap]
$creadListPrec :: ReadPrec [SetPrincipalTagAttributeMap]
readPrec :: ReadPrec SetPrincipalTagAttributeMap
$creadPrec :: ReadPrec SetPrincipalTagAttributeMap
readList :: ReadS [SetPrincipalTagAttributeMap]
$creadList :: ReadS [SetPrincipalTagAttributeMap]
readsPrec :: Int -> ReadS SetPrincipalTagAttributeMap
$creadsPrec :: Int -> ReadS SetPrincipalTagAttributeMap
Prelude.Read, Int -> SetPrincipalTagAttributeMap -> ShowS
[SetPrincipalTagAttributeMap] -> ShowS
SetPrincipalTagAttributeMap -> String
(Int -> SetPrincipalTagAttributeMap -> ShowS)
-> (SetPrincipalTagAttributeMap -> String)
-> ([SetPrincipalTagAttributeMap] -> ShowS)
-> Show SetPrincipalTagAttributeMap
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetPrincipalTagAttributeMap] -> ShowS
$cshowList :: [SetPrincipalTagAttributeMap] -> ShowS
show :: SetPrincipalTagAttributeMap -> String
$cshow :: SetPrincipalTagAttributeMap -> String
showsPrec :: Int -> SetPrincipalTagAttributeMap -> ShowS
$cshowsPrec :: Int -> SetPrincipalTagAttributeMap -> ShowS
Prelude.Show, (forall x.
 SetPrincipalTagAttributeMap -> Rep SetPrincipalTagAttributeMap x)
-> (forall x.
    Rep SetPrincipalTagAttributeMap x -> SetPrincipalTagAttributeMap)
-> Generic SetPrincipalTagAttributeMap
forall x.
Rep SetPrincipalTagAttributeMap x -> SetPrincipalTagAttributeMap
forall x.
SetPrincipalTagAttributeMap -> Rep SetPrincipalTagAttributeMap x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetPrincipalTagAttributeMap x -> SetPrincipalTagAttributeMap
$cfrom :: forall x.
SetPrincipalTagAttributeMap -> Rep SetPrincipalTagAttributeMap x
Prelude.Generic)

-- |
-- Create a value of 'SetPrincipalTagAttributeMap' 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:
--
-- 'principalTags', 'setPrincipalTagAttributeMap_principalTags' - You can use this operation to add principal tags.
--
-- 'useDefaults', 'setPrincipalTagAttributeMap_useDefaults' - You can use this operation to use default (username and clientID)
-- attribute mappings.
--
-- 'identityPoolId', 'setPrincipalTagAttributeMap_identityPoolId' - The ID of the Identity Pool you want to set attribute mappings for.
--
-- 'identityProviderName', 'setPrincipalTagAttributeMap_identityProviderName' - The provider name you want to use for attribute mappings.
newSetPrincipalTagAttributeMap ::
  -- | 'identityPoolId'
  Prelude.Text ->
  -- | 'identityProviderName'
  Prelude.Text ->
  SetPrincipalTagAttributeMap
newSetPrincipalTagAttributeMap :: Text -> Text -> SetPrincipalTagAttributeMap
newSetPrincipalTagAttributeMap
  Text
pIdentityPoolId_
  Text
pIdentityProviderName_ =
    SetPrincipalTagAttributeMap' :: Maybe (HashMap Text Text)
-> Maybe Bool -> Text -> Text -> SetPrincipalTagAttributeMap
SetPrincipalTagAttributeMap'
      { $sel:principalTags:SetPrincipalTagAttributeMap' :: Maybe (HashMap Text Text)
principalTags =
          Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:useDefaults:SetPrincipalTagAttributeMap' :: Maybe Bool
useDefaults = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:identityPoolId:SetPrincipalTagAttributeMap' :: Text
identityPoolId = Text
pIdentityPoolId_,
        $sel:identityProviderName:SetPrincipalTagAttributeMap' :: Text
identityProviderName = Text
pIdentityProviderName_
      }

-- | You can use this operation to add principal tags.
setPrincipalTagAttributeMap_principalTags :: Lens.Lens' SetPrincipalTagAttributeMap (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
setPrincipalTagAttributeMap_principalTags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SetPrincipalTagAttributeMap -> f SetPrincipalTagAttributeMap
setPrincipalTagAttributeMap_principalTags = (SetPrincipalTagAttributeMap -> Maybe (HashMap Text Text))
-> (SetPrincipalTagAttributeMap
    -> Maybe (HashMap Text Text) -> SetPrincipalTagAttributeMap)
-> Lens
     SetPrincipalTagAttributeMap
     SetPrincipalTagAttributeMap
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetPrincipalTagAttributeMap' {Maybe (HashMap Text Text)
principalTags :: Maybe (HashMap Text Text)
$sel:principalTags:SetPrincipalTagAttributeMap' :: SetPrincipalTagAttributeMap -> Maybe (HashMap Text Text)
principalTags} -> Maybe (HashMap Text Text)
principalTags) (\s :: SetPrincipalTagAttributeMap
s@SetPrincipalTagAttributeMap' {} Maybe (HashMap Text Text)
a -> SetPrincipalTagAttributeMap
s {$sel:principalTags:SetPrincipalTagAttributeMap' :: Maybe (HashMap Text Text)
principalTags = Maybe (HashMap Text Text)
a} :: SetPrincipalTagAttributeMap) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> SetPrincipalTagAttributeMap -> f SetPrincipalTagAttributeMap)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SetPrincipalTagAttributeMap
-> f SetPrincipalTagAttributeMap
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | You can use this operation to use default (username and clientID)
-- attribute mappings.
setPrincipalTagAttributeMap_useDefaults :: Lens.Lens' SetPrincipalTagAttributeMap (Prelude.Maybe Prelude.Bool)
setPrincipalTagAttributeMap_useDefaults :: (Maybe Bool -> f (Maybe Bool))
-> SetPrincipalTagAttributeMap -> f SetPrincipalTagAttributeMap
setPrincipalTagAttributeMap_useDefaults = (SetPrincipalTagAttributeMap -> Maybe Bool)
-> (SetPrincipalTagAttributeMap
    -> Maybe Bool -> SetPrincipalTagAttributeMap)
-> Lens
     SetPrincipalTagAttributeMap
     SetPrincipalTagAttributeMap
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetPrincipalTagAttributeMap' {Maybe Bool
useDefaults :: Maybe Bool
$sel:useDefaults:SetPrincipalTagAttributeMap' :: SetPrincipalTagAttributeMap -> Maybe Bool
useDefaults} -> Maybe Bool
useDefaults) (\s :: SetPrincipalTagAttributeMap
s@SetPrincipalTagAttributeMap' {} Maybe Bool
a -> SetPrincipalTagAttributeMap
s {$sel:useDefaults:SetPrincipalTagAttributeMap' :: Maybe Bool
useDefaults = Maybe Bool
a} :: SetPrincipalTagAttributeMap)

-- | The ID of the Identity Pool you want to set attribute mappings for.
setPrincipalTagAttributeMap_identityPoolId :: Lens.Lens' SetPrincipalTagAttributeMap Prelude.Text
setPrincipalTagAttributeMap_identityPoolId :: (Text -> f Text)
-> SetPrincipalTagAttributeMap -> f SetPrincipalTagAttributeMap
setPrincipalTagAttributeMap_identityPoolId = (SetPrincipalTagAttributeMap -> Text)
-> (SetPrincipalTagAttributeMap
    -> Text -> SetPrincipalTagAttributeMap)
-> Lens
     SetPrincipalTagAttributeMap SetPrincipalTagAttributeMap Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetPrincipalTagAttributeMap' {Text
identityPoolId :: Text
$sel:identityPoolId:SetPrincipalTagAttributeMap' :: SetPrincipalTagAttributeMap -> Text
identityPoolId} -> Text
identityPoolId) (\s :: SetPrincipalTagAttributeMap
s@SetPrincipalTagAttributeMap' {} Text
a -> SetPrincipalTagAttributeMap
s {$sel:identityPoolId:SetPrincipalTagAttributeMap' :: Text
identityPoolId = Text
a} :: SetPrincipalTagAttributeMap)

-- | The provider name you want to use for attribute mappings.
setPrincipalTagAttributeMap_identityProviderName :: Lens.Lens' SetPrincipalTagAttributeMap Prelude.Text
setPrincipalTagAttributeMap_identityProviderName :: (Text -> f Text)
-> SetPrincipalTagAttributeMap -> f SetPrincipalTagAttributeMap
setPrincipalTagAttributeMap_identityProviderName = (SetPrincipalTagAttributeMap -> Text)
-> (SetPrincipalTagAttributeMap
    -> Text -> SetPrincipalTagAttributeMap)
-> Lens
     SetPrincipalTagAttributeMap SetPrincipalTagAttributeMap Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetPrincipalTagAttributeMap' {Text
identityProviderName :: Text
$sel:identityProviderName:SetPrincipalTagAttributeMap' :: SetPrincipalTagAttributeMap -> Text
identityProviderName} -> Text
identityProviderName) (\s :: SetPrincipalTagAttributeMap
s@SetPrincipalTagAttributeMap' {} Text
a -> SetPrincipalTagAttributeMap
s {$sel:identityProviderName:SetPrincipalTagAttributeMap' :: Text
identityProviderName = Text
a} :: SetPrincipalTagAttributeMap)

instance Core.AWSRequest SetPrincipalTagAttributeMap where
  type
    AWSResponse SetPrincipalTagAttributeMap =
      SetPrincipalTagAttributeMapResponse
  request :: SetPrincipalTagAttributeMap -> Request SetPrincipalTagAttributeMap
request = Service
-> SetPrincipalTagAttributeMap
-> Request SetPrincipalTagAttributeMap
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy SetPrincipalTagAttributeMap
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SetPrincipalTagAttributeMap)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse SetPrincipalTagAttributeMap))
-> Logger
-> Service
-> Proxy SetPrincipalTagAttributeMap
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SetPrincipalTagAttributeMap)))
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
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Int
-> SetPrincipalTagAttributeMapResponse
SetPrincipalTagAttributeMapResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe Bool
 -> Int
 -> SetPrincipalTagAttributeMapResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Bool
      -> Int
      -> SetPrincipalTagAttributeMapResponse)
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
"IdentityPoolId")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Bool
   -> Int
   -> SetPrincipalTagAttributeMapResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Maybe Bool -> Int -> SetPrincipalTagAttributeMapResponse)
forall (f :: * -> *) a b. Applicative f => 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
"IdentityProviderName")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Maybe Bool -> Int -> SetPrincipalTagAttributeMapResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String (Maybe Bool -> Int -> SetPrincipalTagAttributeMapResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PrincipalTags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe Bool -> Int -> SetPrincipalTagAttributeMapResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> SetPrincipalTagAttributeMapResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UseDefaults")
            Either String (Int -> SetPrincipalTagAttributeMapResponse)
-> Either String Int
-> Either String SetPrincipalTagAttributeMapResponse
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 SetPrincipalTagAttributeMap

instance Prelude.NFData SetPrincipalTagAttributeMap

instance Core.ToHeaders SetPrincipalTagAttributeMap where
  toHeaders :: SetPrincipalTagAttributeMap -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SetPrincipalTagAttributeMap -> 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
"AWSCognitoIdentityService.SetPrincipalTagAttributeMap" ::
                          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 SetPrincipalTagAttributeMap where
  toJSON :: SetPrincipalTagAttributeMap -> Value
toJSON SetPrincipalTagAttributeMap' {Maybe Bool
Maybe (HashMap Text Text)
Text
identityProviderName :: Text
identityPoolId :: Text
useDefaults :: Maybe Bool
principalTags :: Maybe (HashMap Text Text)
$sel:identityProviderName:SetPrincipalTagAttributeMap' :: SetPrincipalTagAttributeMap -> Text
$sel:identityPoolId:SetPrincipalTagAttributeMap' :: SetPrincipalTagAttributeMap -> Text
$sel:useDefaults:SetPrincipalTagAttributeMap' :: SetPrincipalTagAttributeMap -> Maybe Bool
$sel:principalTags:SetPrincipalTagAttributeMap' :: SetPrincipalTagAttributeMap -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"PrincipalTags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
principalTags,
            (Text
"UseDefaults" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
useDefaults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"IdentityPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
identityPoolId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"IdentityProviderName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
identityProviderName
              )
          ]
      )

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

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

-- | /See:/ 'newSetPrincipalTagAttributeMapResponse' smart constructor.
data SetPrincipalTagAttributeMapResponse = SetPrincipalTagAttributeMapResponse'
  { -- | The ID of the Identity Pool you want to set attribute mappings for.
    SetPrincipalTagAttributeMapResponse -> Maybe Text
identityPoolId :: Prelude.Maybe Prelude.Text,
    -- | The provider name you want to use for attribute mappings.
    SetPrincipalTagAttributeMapResponse -> Maybe Text
identityProviderName :: Prelude.Maybe Prelude.Text,
    -- | You can use this operation to add principal tags. The
    -- @PrincipalTags@operation enables you to reference user attributes in
    -- your IAM permissions policy.
    SetPrincipalTagAttributeMapResponse -> Maybe (HashMap Text Text)
principalTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | You can use this operation to select default (username and clientID)
    -- attribute mappings.
    SetPrincipalTagAttributeMapResponse -> Maybe Bool
useDefaults :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    SetPrincipalTagAttributeMapResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SetPrincipalTagAttributeMapResponse
-> SetPrincipalTagAttributeMapResponse -> Bool
(SetPrincipalTagAttributeMapResponse
 -> SetPrincipalTagAttributeMapResponse -> Bool)
-> (SetPrincipalTagAttributeMapResponse
    -> SetPrincipalTagAttributeMapResponse -> Bool)
-> Eq SetPrincipalTagAttributeMapResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetPrincipalTagAttributeMapResponse
-> SetPrincipalTagAttributeMapResponse -> Bool
$c/= :: SetPrincipalTagAttributeMapResponse
-> SetPrincipalTagAttributeMapResponse -> Bool
== :: SetPrincipalTagAttributeMapResponse
-> SetPrincipalTagAttributeMapResponse -> Bool
$c== :: SetPrincipalTagAttributeMapResponse
-> SetPrincipalTagAttributeMapResponse -> Bool
Prelude.Eq, ReadPrec [SetPrincipalTagAttributeMapResponse]
ReadPrec SetPrincipalTagAttributeMapResponse
Int -> ReadS SetPrincipalTagAttributeMapResponse
ReadS [SetPrincipalTagAttributeMapResponse]
(Int -> ReadS SetPrincipalTagAttributeMapResponse)
-> ReadS [SetPrincipalTagAttributeMapResponse]
-> ReadPrec SetPrincipalTagAttributeMapResponse
-> ReadPrec [SetPrincipalTagAttributeMapResponse]
-> Read SetPrincipalTagAttributeMapResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetPrincipalTagAttributeMapResponse]
$creadListPrec :: ReadPrec [SetPrincipalTagAttributeMapResponse]
readPrec :: ReadPrec SetPrincipalTagAttributeMapResponse
$creadPrec :: ReadPrec SetPrincipalTagAttributeMapResponse
readList :: ReadS [SetPrincipalTagAttributeMapResponse]
$creadList :: ReadS [SetPrincipalTagAttributeMapResponse]
readsPrec :: Int -> ReadS SetPrincipalTagAttributeMapResponse
$creadsPrec :: Int -> ReadS SetPrincipalTagAttributeMapResponse
Prelude.Read, Int -> SetPrincipalTagAttributeMapResponse -> ShowS
[SetPrincipalTagAttributeMapResponse] -> ShowS
SetPrincipalTagAttributeMapResponse -> String
(Int -> SetPrincipalTagAttributeMapResponse -> ShowS)
-> (SetPrincipalTagAttributeMapResponse -> String)
-> ([SetPrincipalTagAttributeMapResponse] -> ShowS)
-> Show SetPrincipalTagAttributeMapResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetPrincipalTagAttributeMapResponse] -> ShowS
$cshowList :: [SetPrincipalTagAttributeMapResponse] -> ShowS
show :: SetPrincipalTagAttributeMapResponse -> String
$cshow :: SetPrincipalTagAttributeMapResponse -> String
showsPrec :: Int -> SetPrincipalTagAttributeMapResponse -> ShowS
$cshowsPrec :: Int -> SetPrincipalTagAttributeMapResponse -> ShowS
Prelude.Show, (forall x.
 SetPrincipalTagAttributeMapResponse
 -> Rep SetPrincipalTagAttributeMapResponse x)
-> (forall x.
    Rep SetPrincipalTagAttributeMapResponse x
    -> SetPrincipalTagAttributeMapResponse)
-> Generic SetPrincipalTagAttributeMapResponse
forall x.
Rep SetPrincipalTagAttributeMapResponse x
-> SetPrincipalTagAttributeMapResponse
forall x.
SetPrincipalTagAttributeMapResponse
-> Rep SetPrincipalTagAttributeMapResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetPrincipalTagAttributeMapResponse x
-> SetPrincipalTagAttributeMapResponse
$cfrom :: forall x.
SetPrincipalTagAttributeMapResponse
-> Rep SetPrincipalTagAttributeMapResponse x
Prelude.Generic)

-- |
-- Create a value of 'SetPrincipalTagAttributeMapResponse' 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:
--
-- 'identityPoolId', 'setPrincipalTagAttributeMapResponse_identityPoolId' - The ID of the Identity Pool you want to set attribute mappings for.
--
-- 'identityProviderName', 'setPrincipalTagAttributeMapResponse_identityProviderName' - The provider name you want to use for attribute mappings.
--
-- 'principalTags', 'setPrincipalTagAttributeMapResponse_principalTags' - You can use this operation to add principal tags. The
-- @PrincipalTags@operation enables you to reference user attributes in
-- your IAM permissions policy.
--
-- 'useDefaults', 'setPrincipalTagAttributeMapResponse_useDefaults' - You can use this operation to select default (username and clientID)
-- attribute mappings.
--
-- 'httpStatus', 'setPrincipalTagAttributeMapResponse_httpStatus' - The response's http status code.
newSetPrincipalTagAttributeMapResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SetPrincipalTagAttributeMapResponse
newSetPrincipalTagAttributeMapResponse :: Int -> SetPrincipalTagAttributeMapResponse
newSetPrincipalTagAttributeMapResponse Int
pHttpStatus_ =
  SetPrincipalTagAttributeMapResponse' :: Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Int
-> SetPrincipalTagAttributeMapResponse
SetPrincipalTagAttributeMapResponse'
    { $sel:identityPoolId:SetPrincipalTagAttributeMapResponse' :: Maybe Text
identityPoolId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:identityProviderName:SetPrincipalTagAttributeMapResponse' :: Maybe Text
identityProviderName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:principalTags:SetPrincipalTagAttributeMapResponse' :: Maybe (HashMap Text Text)
principalTags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:useDefaults:SetPrincipalTagAttributeMapResponse' :: Maybe Bool
useDefaults = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SetPrincipalTagAttributeMapResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ID of the Identity Pool you want to set attribute mappings for.
setPrincipalTagAttributeMapResponse_identityPoolId :: Lens.Lens' SetPrincipalTagAttributeMapResponse (Prelude.Maybe Prelude.Text)
setPrincipalTagAttributeMapResponse_identityPoolId :: (Maybe Text -> f (Maybe Text))
-> SetPrincipalTagAttributeMapResponse
-> f SetPrincipalTagAttributeMapResponse
setPrincipalTagAttributeMapResponse_identityPoolId = (SetPrincipalTagAttributeMapResponse -> Maybe Text)
-> (SetPrincipalTagAttributeMapResponse
    -> Maybe Text -> SetPrincipalTagAttributeMapResponse)
-> Lens
     SetPrincipalTagAttributeMapResponse
     SetPrincipalTagAttributeMapResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetPrincipalTagAttributeMapResponse' {Maybe Text
identityPoolId :: Maybe Text
$sel:identityPoolId:SetPrincipalTagAttributeMapResponse' :: SetPrincipalTagAttributeMapResponse -> Maybe Text
identityPoolId} -> Maybe Text
identityPoolId) (\s :: SetPrincipalTagAttributeMapResponse
s@SetPrincipalTagAttributeMapResponse' {} Maybe Text
a -> SetPrincipalTagAttributeMapResponse
s {$sel:identityPoolId:SetPrincipalTagAttributeMapResponse' :: Maybe Text
identityPoolId = Maybe Text
a} :: SetPrincipalTagAttributeMapResponse)

-- | The provider name you want to use for attribute mappings.
setPrincipalTagAttributeMapResponse_identityProviderName :: Lens.Lens' SetPrincipalTagAttributeMapResponse (Prelude.Maybe Prelude.Text)
setPrincipalTagAttributeMapResponse_identityProviderName :: (Maybe Text -> f (Maybe Text))
-> SetPrincipalTagAttributeMapResponse
-> f SetPrincipalTagAttributeMapResponse
setPrincipalTagAttributeMapResponse_identityProviderName = (SetPrincipalTagAttributeMapResponse -> Maybe Text)
-> (SetPrincipalTagAttributeMapResponse
    -> Maybe Text -> SetPrincipalTagAttributeMapResponse)
-> Lens
     SetPrincipalTagAttributeMapResponse
     SetPrincipalTagAttributeMapResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetPrincipalTagAttributeMapResponse' {Maybe Text
identityProviderName :: Maybe Text
$sel:identityProviderName:SetPrincipalTagAttributeMapResponse' :: SetPrincipalTagAttributeMapResponse -> Maybe Text
identityProviderName} -> Maybe Text
identityProviderName) (\s :: SetPrincipalTagAttributeMapResponse
s@SetPrincipalTagAttributeMapResponse' {} Maybe Text
a -> SetPrincipalTagAttributeMapResponse
s {$sel:identityProviderName:SetPrincipalTagAttributeMapResponse' :: Maybe Text
identityProviderName = Maybe Text
a} :: SetPrincipalTagAttributeMapResponse)

-- | You can use this operation to add principal tags. The
-- @PrincipalTags@operation enables you to reference user attributes in
-- your IAM permissions policy.
setPrincipalTagAttributeMapResponse_principalTags :: Lens.Lens' SetPrincipalTagAttributeMapResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
setPrincipalTagAttributeMapResponse_principalTags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SetPrincipalTagAttributeMapResponse
-> f SetPrincipalTagAttributeMapResponse
setPrincipalTagAttributeMapResponse_principalTags = (SetPrincipalTagAttributeMapResponse -> Maybe (HashMap Text Text))
-> (SetPrincipalTagAttributeMapResponse
    -> Maybe (HashMap Text Text)
    -> SetPrincipalTagAttributeMapResponse)
-> Lens
     SetPrincipalTagAttributeMapResponse
     SetPrincipalTagAttributeMapResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetPrincipalTagAttributeMapResponse' {Maybe (HashMap Text Text)
principalTags :: Maybe (HashMap Text Text)
$sel:principalTags:SetPrincipalTagAttributeMapResponse' :: SetPrincipalTagAttributeMapResponse -> Maybe (HashMap Text Text)
principalTags} -> Maybe (HashMap Text Text)
principalTags) (\s :: SetPrincipalTagAttributeMapResponse
s@SetPrincipalTagAttributeMapResponse' {} Maybe (HashMap Text Text)
a -> SetPrincipalTagAttributeMapResponse
s {$sel:principalTags:SetPrincipalTagAttributeMapResponse' :: Maybe (HashMap Text Text)
principalTags = Maybe (HashMap Text Text)
a} :: SetPrincipalTagAttributeMapResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> SetPrincipalTagAttributeMapResponse
 -> f SetPrincipalTagAttributeMapResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SetPrincipalTagAttributeMapResponse
-> f SetPrincipalTagAttributeMapResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | You can use this operation to select default (username and clientID)
-- attribute mappings.
setPrincipalTagAttributeMapResponse_useDefaults :: Lens.Lens' SetPrincipalTagAttributeMapResponse (Prelude.Maybe Prelude.Bool)
setPrincipalTagAttributeMapResponse_useDefaults :: (Maybe Bool -> f (Maybe Bool))
-> SetPrincipalTagAttributeMapResponse
-> f SetPrincipalTagAttributeMapResponse
setPrincipalTagAttributeMapResponse_useDefaults = (SetPrincipalTagAttributeMapResponse -> Maybe Bool)
-> (SetPrincipalTagAttributeMapResponse
    -> Maybe Bool -> SetPrincipalTagAttributeMapResponse)
-> Lens
     SetPrincipalTagAttributeMapResponse
     SetPrincipalTagAttributeMapResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetPrincipalTagAttributeMapResponse' {Maybe Bool
useDefaults :: Maybe Bool
$sel:useDefaults:SetPrincipalTagAttributeMapResponse' :: SetPrincipalTagAttributeMapResponse -> Maybe Bool
useDefaults} -> Maybe Bool
useDefaults) (\s :: SetPrincipalTagAttributeMapResponse
s@SetPrincipalTagAttributeMapResponse' {} Maybe Bool
a -> SetPrincipalTagAttributeMapResponse
s {$sel:useDefaults:SetPrincipalTagAttributeMapResponse' :: Maybe Bool
useDefaults = Maybe Bool
a} :: SetPrincipalTagAttributeMapResponse)

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

instance
  Prelude.NFData
    SetPrincipalTagAttributeMapResponse