{-# 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.CognitoIdentityProvider.UpdateUserAttributes
-- 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)
--
-- Allows a user to update a specific attribute (one at a time).
--
-- This action might generate an SMS text message. Starting June 1, 2021,
-- U.S. telecom carriers require that you register an origination phone
-- number before you can send SMS messages to U.S. phone numbers. If you
-- use SMS text messages in Amazon Cognito, you must register a phone
-- number with
-- <https://console.aws.amazon.com/pinpoint/home/ Amazon Pinpoint>. Cognito
-- will use the the registered number automatically. Otherwise, Cognito
-- users that must receive SMS messages might be unable to sign up,
-- activate their accounts, or sign in.
--
-- If you have never used SMS text messages with Amazon Cognito or any
-- other Amazon Web Service, Amazon SNS might place your account in SMS
-- sandbox. In
-- /<https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html sandbox mode>/
-- , you’ll have limitations, such as sending messages to only verified
-- phone numbers. After testing in the sandbox environment, you can move
-- out of the SMS sandbox and into production. For more information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-sms-userpool-settings.html SMS message settings for Cognito User Pools>
-- in the /Amazon Cognito Developer Guide/.
module Amazonka.CognitoIdentityProvider.UpdateUserAttributes
  ( -- * Creating a Request
    UpdateUserAttributes (..),
    newUpdateUserAttributes,

    -- * Request Lenses
    updateUserAttributes_clientMetadata,
    updateUserAttributes_userAttributes,
    updateUserAttributes_accessToken,

    -- * Destructuring the Response
    UpdateUserAttributesResponse (..),
    newUpdateUserAttributesResponse,

    -- * Response Lenses
    updateUserAttributesResponse_codeDeliveryDetailsList,
    updateUserAttributesResponse_httpStatus,
  )
where

import Amazonka.CognitoIdentityProvider.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

-- | Represents the request to update user attributes.
--
-- /See:/ 'newUpdateUserAttributes' smart constructor.
data UpdateUserAttributes = UpdateUserAttributes'
  { -- | A map of custom key-value pairs that you can provide as input for any
    -- custom workflows that this action triggers.
    --
    -- You create custom workflows by assigning Lambda functions to user pool
    -- triggers. When you use the UpdateUserAttributes API action, Amazon
    -- Cognito invokes the function that is assigned to the /custom message/
    -- trigger. When Amazon Cognito invokes this function, it passes a JSON
    -- payload, which the function receives as input. This payload contains a
    -- @clientMetadata@ attribute, which provides the data that you assigned to
    -- the ClientMetadata parameter in your UpdateUserAttributes request. In
    -- your function code in Lambda, you can process the @clientMetadata@ value
    -- to enhance your workflow for your specific needs.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html Customizing User Pool Workflows with Lambda Triggers>
    -- in the /Amazon Cognito Developer Guide/.
    --
    -- Take the following limitations into consideration when you use the
    -- ClientMetadata parameter:
    --
    -- -   Amazon Cognito does not store the ClientMetadata value. This data is
    --     available only to Lambda triggers that are assigned to a user pool
    --     to support custom workflows. If your user pool configuration does
    --     not include triggers, the ClientMetadata parameter serves no
    --     purpose.
    --
    -- -   Amazon Cognito does not validate the ClientMetadata value.
    --
    -- -   Amazon Cognito does not encrypt the the ClientMetadata value, so
    --     don\'t use it to provide sensitive information.
    UpdateUserAttributes -> Maybe (HashMap Text Text)
clientMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | An array of name-value pairs representing user attributes.
    --
    -- For custom attributes, you must prepend the @custom:@ prefix to the
    -- attribute name.
    UpdateUserAttributes -> [AttributeType]
userAttributes :: [AttributeType],
    -- | The access token for the request to update user attributes.
    UpdateUserAttributes -> Sensitive Text
accessToken :: Core.Sensitive Prelude.Text
  }
  deriving (UpdateUserAttributes -> UpdateUserAttributes -> Bool
(UpdateUserAttributes -> UpdateUserAttributes -> Bool)
-> (UpdateUserAttributes -> UpdateUserAttributes -> Bool)
-> Eq UpdateUserAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserAttributes -> UpdateUserAttributes -> Bool
$c/= :: UpdateUserAttributes -> UpdateUserAttributes -> Bool
== :: UpdateUserAttributes -> UpdateUserAttributes -> Bool
$c== :: UpdateUserAttributes -> UpdateUserAttributes -> Bool
Prelude.Eq, Int -> UpdateUserAttributes -> ShowS
[UpdateUserAttributes] -> ShowS
UpdateUserAttributes -> String
(Int -> UpdateUserAttributes -> ShowS)
-> (UpdateUserAttributes -> String)
-> ([UpdateUserAttributes] -> ShowS)
-> Show UpdateUserAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserAttributes] -> ShowS
$cshowList :: [UpdateUserAttributes] -> ShowS
show :: UpdateUserAttributes -> String
$cshow :: UpdateUserAttributes -> String
showsPrec :: Int -> UpdateUserAttributes -> ShowS
$cshowsPrec :: Int -> UpdateUserAttributes -> ShowS
Prelude.Show, (forall x. UpdateUserAttributes -> Rep UpdateUserAttributes x)
-> (forall x. Rep UpdateUserAttributes x -> UpdateUserAttributes)
-> Generic UpdateUserAttributes
forall x. Rep UpdateUserAttributes x -> UpdateUserAttributes
forall x. UpdateUserAttributes -> Rep UpdateUserAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateUserAttributes x -> UpdateUserAttributes
$cfrom :: forall x. UpdateUserAttributes -> Rep UpdateUserAttributes x
Prelude.Generic)

-- |
-- Create a value of 'UpdateUserAttributes' 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:
--
-- 'clientMetadata', 'updateUserAttributes_clientMetadata' - A map of custom key-value pairs that you can provide as input for any
-- custom workflows that this action triggers.
--
-- You create custom workflows by assigning Lambda functions to user pool
-- triggers. When you use the UpdateUserAttributes API action, Amazon
-- Cognito invokes the function that is assigned to the /custom message/
-- trigger. When Amazon Cognito invokes this function, it passes a JSON
-- payload, which the function receives as input. This payload contains a
-- @clientMetadata@ attribute, which provides the data that you assigned to
-- the ClientMetadata parameter in your UpdateUserAttributes request. In
-- your function code in Lambda, you can process the @clientMetadata@ value
-- to enhance your workflow for your specific needs.
--
-- For more information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html Customizing User Pool Workflows with Lambda Triggers>
-- in the /Amazon Cognito Developer Guide/.
--
-- Take the following limitations into consideration when you use the
-- ClientMetadata parameter:
--
-- -   Amazon Cognito does not store the ClientMetadata value. This data is
--     available only to Lambda triggers that are assigned to a user pool
--     to support custom workflows. If your user pool configuration does
--     not include triggers, the ClientMetadata parameter serves no
--     purpose.
--
-- -   Amazon Cognito does not validate the ClientMetadata value.
--
-- -   Amazon Cognito does not encrypt the the ClientMetadata value, so
--     don\'t use it to provide sensitive information.
--
-- 'userAttributes', 'updateUserAttributes_userAttributes' - An array of name-value pairs representing user attributes.
--
-- For custom attributes, you must prepend the @custom:@ prefix to the
-- attribute name.
--
-- 'accessToken', 'updateUserAttributes_accessToken' - The access token for the request to update user attributes.
newUpdateUserAttributes ::
  -- | 'accessToken'
  Prelude.Text ->
  UpdateUserAttributes
newUpdateUserAttributes :: Text -> UpdateUserAttributes
newUpdateUserAttributes Text
pAccessToken_ =
  UpdateUserAttributes' :: Maybe (HashMap Text Text)
-> [AttributeType] -> Sensitive Text -> UpdateUserAttributes
UpdateUserAttributes'
    { $sel:clientMetadata:UpdateUserAttributes' :: Maybe (HashMap Text Text)
clientMetadata =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:userAttributes:UpdateUserAttributes' :: [AttributeType]
userAttributes = [AttributeType]
forall a. Monoid a => a
Prelude.mempty,
      $sel:accessToken:UpdateUserAttributes' :: Sensitive Text
accessToken = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pAccessToken_
    }

-- | A map of custom key-value pairs that you can provide as input for any
-- custom workflows that this action triggers.
--
-- You create custom workflows by assigning Lambda functions to user pool
-- triggers. When you use the UpdateUserAttributes API action, Amazon
-- Cognito invokes the function that is assigned to the /custom message/
-- trigger. When Amazon Cognito invokes this function, it passes a JSON
-- payload, which the function receives as input. This payload contains a
-- @clientMetadata@ attribute, which provides the data that you assigned to
-- the ClientMetadata parameter in your UpdateUserAttributes request. In
-- your function code in Lambda, you can process the @clientMetadata@ value
-- to enhance your workflow for your specific needs.
--
-- For more information, see
-- <https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html Customizing User Pool Workflows with Lambda Triggers>
-- in the /Amazon Cognito Developer Guide/.
--
-- Take the following limitations into consideration when you use the
-- ClientMetadata parameter:
--
-- -   Amazon Cognito does not store the ClientMetadata value. This data is
--     available only to Lambda triggers that are assigned to a user pool
--     to support custom workflows. If your user pool configuration does
--     not include triggers, the ClientMetadata parameter serves no
--     purpose.
--
-- -   Amazon Cognito does not validate the ClientMetadata value.
--
-- -   Amazon Cognito does not encrypt the the ClientMetadata value, so
--     don\'t use it to provide sensitive information.
updateUserAttributes_clientMetadata :: Lens.Lens' UpdateUserAttributes (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateUserAttributes_clientMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateUserAttributes -> f UpdateUserAttributes
updateUserAttributes_clientMetadata = (UpdateUserAttributes -> Maybe (HashMap Text Text))
-> (UpdateUserAttributes
    -> Maybe (HashMap Text Text) -> UpdateUserAttributes)
-> Lens
     UpdateUserAttributes
     UpdateUserAttributes
     (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 (\UpdateUserAttributes' {Maybe (HashMap Text Text)
clientMetadata :: Maybe (HashMap Text Text)
$sel:clientMetadata:UpdateUserAttributes' :: UpdateUserAttributes -> Maybe (HashMap Text Text)
clientMetadata} -> Maybe (HashMap Text Text)
clientMetadata) (\s :: UpdateUserAttributes
s@UpdateUserAttributes' {} Maybe (HashMap Text Text)
a -> UpdateUserAttributes
s {$sel:clientMetadata:UpdateUserAttributes' :: Maybe (HashMap Text Text)
clientMetadata = Maybe (HashMap Text Text)
a} :: UpdateUserAttributes) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateUserAttributes -> f UpdateUserAttributes)
-> ((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)))
-> UpdateUserAttributes
-> f UpdateUserAttributes
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

-- | An array of name-value pairs representing user attributes.
--
-- For custom attributes, you must prepend the @custom:@ prefix to the
-- attribute name.
updateUserAttributes_userAttributes :: Lens.Lens' UpdateUserAttributes [AttributeType]
updateUserAttributes_userAttributes :: ([AttributeType] -> f [AttributeType])
-> UpdateUserAttributes -> f UpdateUserAttributes
updateUserAttributes_userAttributes = (UpdateUserAttributes -> [AttributeType])
-> (UpdateUserAttributes
    -> [AttributeType] -> UpdateUserAttributes)
-> Lens
     UpdateUserAttributes
     UpdateUserAttributes
     [AttributeType]
     [AttributeType]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserAttributes' {[AttributeType]
userAttributes :: [AttributeType]
$sel:userAttributes:UpdateUserAttributes' :: UpdateUserAttributes -> [AttributeType]
userAttributes} -> [AttributeType]
userAttributes) (\s :: UpdateUserAttributes
s@UpdateUserAttributes' {} [AttributeType]
a -> UpdateUserAttributes
s {$sel:userAttributes:UpdateUserAttributes' :: [AttributeType]
userAttributes = [AttributeType]
a} :: UpdateUserAttributes) (([AttributeType] -> f [AttributeType])
 -> UpdateUserAttributes -> f UpdateUserAttributes)
-> (([AttributeType] -> f [AttributeType])
    -> [AttributeType] -> f [AttributeType])
-> ([AttributeType] -> f [AttributeType])
-> UpdateUserAttributes
-> f UpdateUserAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AttributeType] -> f [AttributeType])
-> [AttributeType] -> f [AttributeType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The access token for the request to update user attributes.
updateUserAttributes_accessToken :: Lens.Lens' UpdateUserAttributes Prelude.Text
updateUserAttributes_accessToken :: (Text -> f Text) -> UpdateUserAttributes -> f UpdateUserAttributes
updateUserAttributes_accessToken = (UpdateUserAttributes -> Sensitive Text)
-> (UpdateUserAttributes -> Sensitive Text -> UpdateUserAttributes)
-> Lens
     UpdateUserAttributes
     UpdateUserAttributes
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserAttributes' {Sensitive Text
accessToken :: Sensitive Text
$sel:accessToken:UpdateUserAttributes' :: UpdateUserAttributes -> Sensitive Text
accessToken} -> Sensitive Text
accessToken) (\s :: UpdateUserAttributes
s@UpdateUserAttributes' {} Sensitive Text
a -> UpdateUserAttributes
s {$sel:accessToken:UpdateUserAttributes' :: Sensitive Text
accessToken = Sensitive Text
a} :: UpdateUserAttributes) ((Sensitive Text -> f (Sensitive Text))
 -> UpdateUserAttributes -> f UpdateUserAttributes)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> UpdateUserAttributes
-> f UpdateUserAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

instance Core.AWSRequest UpdateUserAttributes where
  type
    AWSResponse UpdateUserAttributes =
      UpdateUserAttributesResponse
  request :: UpdateUserAttributes -> Request UpdateUserAttributes
request = Service -> UpdateUserAttributes -> Request UpdateUserAttributes
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateUserAttributes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateUserAttributes)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateUserAttributes))
-> Logger
-> Service
-> Proxy UpdateUserAttributes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateUserAttributes)))
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 [CodeDeliveryDetailsType]
-> Int -> UpdateUserAttributesResponse
UpdateUserAttributesResponse'
            (Maybe [CodeDeliveryDetailsType]
 -> Int -> UpdateUserAttributesResponse)
-> Either String (Maybe [CodeDeliveryDetailsType])
-> Either String (Int -> UpdateUserAttributesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [CodeDeliveryDetailsType]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CodeDeliveryDetailsList"
                            Either String (Maybe (Maybe [CodeDeliveryDetailsType]))
-> Maybe [CodeDeliveryDetailsType]
-> Either String (Maybe [CodeDeliveryDetailsType])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [CodeDeliveryDetailsType]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> UpdateUserAttributesResponse)
-> Either String Int -> Either String UpdateUserAttributesResponse
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 UpdateUserAttributes

instance Prelude.NFData UpdateUserAttributes

instance Core.ToHeaders UpdateUserAttributes where
  toHeaders :: UpdateUserAttributes -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateUserAttributes -> 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
"AWSCognitoIdentityProviderService.UpdateUserAttributes" ::
                          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 UpdateUserAttributes where
  toJSON :: UpdateUserAttributes -> Value
toJSON UpdateUserAttributes' {[AttributeType]
Maybe (HashMap Text Text)
Sensitive Text
accessToken :: Sensitive Text
userAttributes :: [AttributeType]
clientMetadata :: Maybe (HashMap Text Text)
$sel:accessToken:UpdateUserAttributes' :: UpdateUserAttributes -> Sensitive Text
$sel:userAttributes:UpdateUserAttributes' :: UpdateUserAttributes -> [AttributeType]
$sel:clientMetadata:UpdateUserAttributes' :: UpdateUserAttributes -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ClientMetadata" 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)
clientMetadata,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"UserAttributes" Text -> [AttributeType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [AttributeType]
userAttributes),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AccessToken" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
accessToken)
          ]
      )

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

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

-- | Represents the response from the server for the request to update user
-- attributes.
--
-- /See:/ 'newUpdateUserAttributesResponse' smart constructor.
data UpdateUserAttributesResponse = UpdateUserAttributesResponse'
  { -- | The code delivery details list from the server for the request to update
    -- user attributes.
    UpdateUserAttributesResponse -> Maybe [CodeDeliveryDetailsType]
codeDeliveryDetailsList :: Prelude.Maybe [CodeDeliveryDetailsType],
    -- | The response's http status code.
    UpdateUserAttributesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateUserAttributesResponse
-> UpdateUserAttributesResponse -> Bool
(UpdateUserAttributesResponse
 -> UpdateUserAttributesResponse -> Bool)
-> (UpdateUserAttributesResponse
    -> UpdateUserAttributesResponse -> Bool)
-> Eq UpdateUserAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserAttributesResponse
-> UpdateUserAttributesResponse -> Bool
$c/= :: UpdateUserAttributesResponse
-> UpdateUserAttributesResponse -> Bool
== :: UpdateUserAttributesResponse
-> UpdateUserAttributesResponse -> Bool
$c== :: UpdateUserAttributesResponse
-> UpdateUserAttributesResponse -> Bool
Prelude.Eq, ReadPrec [UpdateUserAttributesResponse]
ReadPrec UpdateUserAttributesResponse
Int -> ReadS UpdateUserAttributesResponse
ReadS [UpdateUserAttributesResponse]
(Int -> ReadS UpdateUserAttributesResponse)
-> ReadS [UpdateUserAttributesResponse]
-> ReadPrec UpdateUserAttributesResponse
-> ReadPrec [UpdateUserAttributesResponse]
-> Read UpdateUserAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateUserAttributesResponse]
$creadListPrec :: ReadPrec [UpdateUserAttributesResponse]
readPrec :: ReadPrec UpdateUserAttributesResponse
$creadPrec :: ReadPrec UpdateUserAttributesResponse
readList :: ReadS [UpdateUserAttributesResponse]
$creadList :: ReadS [UpdateUserAttributesResponse]
readsPrec :: Int -> ReadS UpdateUserAttributesResponse
$creadsPrec :: Int -> ReadS UpdateUserAttributesResponse
Prelude.Read, Int -> UpdateUserAttributesResponse -> ShowS
[UpdateUserAttributesResponse] -> ShowS
UpdateUserAttributesResponse -> String
(Int -> UpdateUserAttributesResponse -> ShowS)
-> (UpdateUserAttributesResponse -> String)
-> ([UpdateUserAttributesResponse] -> ShowS)
-> Show UpdateUserAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserAttributesResponse] -> ShowS
$cshowList :: [UpdateUserAttributesResponse] -> ShowS
show :: UpdateUserAttributesResponse -> String
$cshow :: UpdateUserAttributesResponse -> String
showsPrec :: Int -> UpdateUserAttributesResponse -> ShowS
$cshowsPrec :: Int -> UpdateUserAttributesResponse -> ShowS
Prelude.Show, (forall x.
 UpdateUserAttributesResponse -> Rep UpdateUserAttributesResponse x)
-> (forall x.
    Rep UpdateUserAttributesResponse x -> UpdateUserAttributesResponse)
-> Generic UpdateUserAttributesResponse
forall x.
Rep UpdateUserAttributesResponse x -> UpdateUserAttributesResponse
forall x.
UpdateUserAttributesResponse -> Rep UpdateUserAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateUserAttributesResponse x -> UpdateUserAttributesResponse
$cfrom :: forall x.
UpdateUserAttributesResponse -> Rep UpdateUserAttributesResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateUserAttributesResponse' 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:
--
-- 'codeDeliveryDetailsList', 'updateUserAttributesResponse_codeDeliveryDetailsList' - The code delivery details list from the server for the request to update
-- user attributes.
--
-- 'httpStatus', 'updateUserAttributesResponse_httpStatus' - The response's http status code.
newUpdateUserAttributesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateUserAttributesResponse
newUpdateUserAttributesResponse :: Int -> UpdateUserAttributesResponse
newUpdateUserAttributesResponse Int
pHttpStatus_ =
  UpdateUserAttributesResponse' :: Maybe [CodeDeliveryDetailsType]
-> Int -> UpdateUserAttributesResponse
UpdateUserAttributesResponse'
    { $sel:codeDeliveryDetailsList:UpdateUserAttributesResponse' :: Maybe [CodeDeliveryDetailsType]
codeDeliveryDetailsList =
        Maybe [CodeDeliveryDetailsType]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateUserAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The code delivery details list from the server for the request to update
-- user attributes.
updateUserAttributesResponse_codeDeliveryDetailsList :: Lens.Lens' UpdateUserAttributesResponse (Prelude.Maybe [CodeDeliveryDetailsType])
updateUserAttributesResponse_codeDeliveryDetailsList :: (Maybe [CodeDeliveryDetailsType]
 -> f (Maybe [CodeDeliveryDetailsType]))
-> UpdateUserAttributesResponse -> f UpdateUserAttributesResponse
updateUserAttributesResponse_codeDeliveryDetailsList = (UpdateUserAttributesResponse -> Maybe [CodeDeliveryDetailsType])
-> (UpdateUserAttributesResponse
    -> Maybe [CodeDeliveryDetailsType] -> UpdateUserAttributesResponse)
-> Lens
     UpdateUserAttributesResponse
     UpdateUserAttributesResponse
     (Maybe [CodeDeliveryDetailsType])
     (Maybe [CodeDeliveryDetailsType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserAttributesResponse' {Maybe [CodeDeliveryDetailsType]
codeDeliveryDetailsList :: Maybe [CodeDeliveryDetailsType]
$sel:codeDeliveryDetailsList:UpdateUserAttributesResponse' :: UpdateUserAttributesResponse -> Maybe [CodeDeliveryDetailsType]
codeDeliveryDetailsList} -> Maybe [CodeDeliveryDetailsType]
codeDeliveryDetailsList) (\s :: UpdateUserAttributesResponse
s@UpdateUserAttributesResponse' {} Maybe [CodeDeliveryDetailsType]
a -> UpdateUserAttributesResponse
s {$sel:codeDeliveryDetailsList:UpdateUserAttributesResponse' :: Maybe [CodeDeliveryDetailsType]
codeDeliveryDetailsList = Maybe [CodeDeliveryDetailsType]
a} :: UpdateUserAttributesResponse) ((Maybe [CodeDeliveryDetailsType]
  -> f (Maybe [CodeDeliveryDetailsType]))
 -> UpdateUserAttributesResponse -> f UpdateUserAttributesResponse)
-> ((Maybe [CodeDeliveryDetailsType]
     -> f (Maybe [CodeDeliveryDetailsType]))
    -> Maybe [CodeDeliveryDetailsType]
    -> f (Maybe [CodeDeliveryDetailsType]))
-> (Maybe [CodeDeliveryDetailsType]
    -> f (Maybe [CodeDeliveryDetailsType]))
-> UpdateUserAttributesResponse
-> f UpdateUserAttributesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CodeDeliveryDetailsType]
  [CodeDeliveryDetailsType]
  [CodeDeliveryDetailsType]
  [CodeDeliveryDetailsType]
-> Iso
     (Maybe [CodeDeliveryDetailsType])
     (Maybe [CodeDeliveryDetailsType])
     (Maybe [CodeDeliveryDetailsType])
     (Maybe [CodeDeliveryDetailsType])
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
  [CodeDeliveryDetailsType]
  [CodeDeliveryDetailsType]
  [CodeDeliveryDetailsType]
  [CodeDeliveryDetailsType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData UpdateUserAttributesResponse