{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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,
-- US telecom carriers require you to register an origination phone number
-- before you can send SMS messages to US 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>. Amazon
-- Cognito uses the registered number automatically. Otherwise, Amazon
-- Cognito users who must receive SMS messages might not be able 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 Simple Notification Service might place
-- your account in the SMS sandbox. In
-- /<https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html sandbox mode>/
-- , you can send messages only to verified phone numbers. After you test
-- your app while in the sandbox environment, you can move out of the
-- 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 Amazon 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 initiates.
    --
    -- 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/.
    --
    -- When you use the ClientMetadata parameter, remember that Amazon Cognito
    -- won\'t do the following:
    --
    -- -   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 doesn\'t include
    --     triggers, the ClientMetadata parameter serves no purpose.
    --
    -- -   Validate the ClientMetadata value.
    --
    -- -   Encrypt the ClientMetadata value. Don\'t use Amazon Cognito 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.
    --
    -- If you have set an attribute to require verification before Amazon
    -- Cognito updates its value, this request doesn’t immediately update the
    -- value of that attribute. After your user receives and responds to a
    -- verification message to verify the new value, Amazon Cognito updates the
    -- attribute value. Your user can sign in and receive messages with the
    -- original attribute value until they verify the new value.
    UpdateUserAttributes -> [AttributeType]
userAttributes :: [AttributeType],
    -- | A valid access token that Amazon Cognito issued to the user whose user
    -- attributes you want to update.
    UpdateUserAttributes -> Sensitive Text
accessToken :: Data.Sensitive Prelude.Text
  }
  deriving (UpdateUserAttributes -> UpdateUserAttributes -> Bool
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
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. 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 initiates.
--
-- 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/.
--
-- When you use the ClientMetadata parameter, remember that Amazon Cognito
-- won\'t do the following:
--
-- -   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 doesn\'t include
--     triggers, the ClientMetadata parameter serves no purpose.
--
-- -   Validate the ClientMetadata value.
--
-- -   Encrypt the ClientMetadata value. Don\'t use Amazon Cognito 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.
--
-- If you have set an attribute to require verification before Amazon
-- Cognito updates its value, this request doesn’t immediately update the
-- value of that attribute. After your user receives and responds to a
-- verification message to verify the new value, Amazon Cognito updates the
-- attribute value. Your user can sign in and receive messages with the
-- original attribute value until they verify the new value.
--
-- 'accessToken', 'updateUserAttributes_accessToken' - A valid access token that Amazon Cognito issued to the user whose user
-- attributes you want to update.
newUpdateUserAttributes ::
  -- | 'accessToken'
  Prelude.Text ->
  UpdateUserAttributes
newUpdateUserAttributes :: Text -> UpdateUserAttributes
newUpdateUserAttributes Text
pAccessToken_ =
  UpdateUserAttributes'
    { $sel:clientMetadata:UpdateUserAttributes' :: Maybe (HashMap Text Text)
clientMetadata =
        forall a. Maybe a
Prelude.Nothing,
      $sel:userAttributes:UpdateUserAttributes' :: [AttributeType]
userAttributes = forall a. Monoid a => a
Prelude.mempty,
      $sel:accessToken:UpdateUserAttributes' :: Sensitive Text
accessToken = forall a. Iso' (Sensitive a) a
Data._Sensitive 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 initiates.
--
-- 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/.
--
-- When you use the ClientMetadata parameter, remember that Amazon Cognito
-- won\'t do the following:
--
-- -   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 doesn\'t include
--     triggers, the ClientMetadata parameter serves no purpose.
--
-- -   Validate the ClientMetadata value.
--
-- -   Encrypt the ClientMetadata value. Don\'t use Amazon Cognito to
--     provide sensitive information.
updateUserAttributes_clientMetadata :: Lens.Lens' UpdateUserAttributes (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateUserAttributes_clientMetadata :: Lens' UpdateUserAttributes (Maybe (HashMap Text Text))
updateUserAttributes_clientMetadata = 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) 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

-- | An array of name-value pairs representing user attributes.
--
-- For custom attributes, you must prepend the @custom:@ prefix to the
-- attribute name.
--
-- If you have set an attribute to require verification before Amazon
-- Cognito updates its value, this request doesn’t immediately update the
-- value of that attribute. After your user receives and responds to a
-- verification message to verify the new value, Amazon Cognito updates the
-- attribute value. Your user can sign in and receive messages with the
-- original attribute value until they verify the new value.
updateUserAttributes_userAttributes :: Lens.Lens' UpdateUserAttributes [AttributeType]
updateUserAttributes_userAttributes :: Lens' UpdateUserAttributes [AttributeType]
updateUserAttributes_userAttributes = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A valid access token that Amazon Cognito issued to the user whose user
-- attributes you want to update.
updateUserAttributes_accessToken :: Lens.Lens' UpdateUserAttributes Prelude.Text
updateUserAttributes_accessToken :: Lens' UpdateUserAttributes Text
updateUserAttributes_accessToken = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

instance Core.AWSRequest UpdateUserAttributes where
  type
    AWSResponse UpdateUserAttributes =
      UpdateUserAttributesResponse
  request :: (Service -> Service)
-> UpdateUserAttributes -> Request UpdateUserAttributes
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateUserAttributes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateUserAttributes)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [CodeDeliveryDetailsType]
-> Int -> UpdateUserAttributesResponse
UpdateUserAttributesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CodeDeliveryDetailsList"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateUserAttributes where
  hashWithSalt :: Int -> UpdateUserAttributes -> Int
hashWithSalt Int
_salt 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)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
clientMetadata
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [AttributeType]
userAttributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
accessToken

instance Prelude.NFData UpdateUserAttributes where
  rnf :: UpdateUserAttributes -> ()
rnf 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)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
clientMetadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [AttributeType]
userAttributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
accessToken

instance Data.ToHeaders UpdateUserAttributes where
  toHeaders :: UpdateUserAttributes -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSCognitoIdentityProviderService.UpdateUserAttributes" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ClientMetadata" 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 (HashMap Text Text)
clientMetadata,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"UserAttributes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [AttributeType]
userAttributes),
            forall a. a -> Maybe a
Prelude.Just (Key
"AccessToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
accessToken)
          ]
      )

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

instance Data.ToQuery UpdateUserAttributes where
  toQuery :: UpdateUserAttributes -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
    { $sel:codeDeliveryDetailsList:UpdateUserAttributesResponse' :: Maybe [CodeDeliveryDetailsType]
codeDeliveryDetailsList =
        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 :: Lens'
  UpdateUserAttributesResponse (Maybe [CodeDeliveryDetailsType])
updateUserAttributesResponse_codeDeliveryDetailsList = 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) 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

-- | The response's http status code.
updateUserAttributesResponse_httpStatus :: Lens.Lens' UpdateUserAttributesResponse Prelude.Int
updateUserAttributesResponse_httpStatus :: Lens' UpdateUserAttributesResponse Int
updateUserAttributesResponse_httpStatus = 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 where
  rnf :: UpdateUserAttributesResponse -> ()
rnf UpdateUserAttributesResponse' {Int
Maybe [CodeDeliveryDetailsType]
httpStatus :: Int
codeDeliveryDetailsList :: Maybe [CodeDeliveryDetailsType]
$sel:httpStatus:UpdateUserAttributesResponse' :: UpdateUserAttributesResponse -> Int
$sel:codeDeliveryDetailsList:UpdateUserAttributesResponse' :: UpdateUserAttributesResponse -> Maybe [CodeDeliveryDetailsType]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [CodeDeliveryDetailsType]
codeDeliveryDetailsList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus