{-# 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.SignUp
-- 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)
--
-- Registers the user in the specified user pool and creates a user name,
-- password, and user attributes.
--
-- 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.SignUp
  ( -- * Creating a Request
    SignUp (..),
    newSignUp,

    -- * Request Lenses
    signUp_clientMetadata,
    signUp_analyticsMetadata,
    signUp_userContextData,
    signUp_userAttributes,
    signUp_secretHash,
    signUp_validationData,
    signUp_clientId,
    signUp_username,
    signUp_password,

    -- * Destructuring the Response
    SignUpResponse (..),
    newSignUpResponse,

    -- * Response Lenses
    signUpResponse_codeDeliveryDetails,
    signUpResponse_httpStatus,
    signUpResponse_userConfirmed,
    signUpResponse_userSub,
  )
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 register a user.
--
-- /See:/ 'newSignUp' smart constructor.
data SignUp = SignUp'
  { -- | 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 SignUp API action, Amazon Cognito invokes any
    -- functions that are assigned to the following triggers: /pre sign-up/,
    -- /custom message/, and /post confirmation/. When Amazon Cognito invokes
    -- any of these functions, 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 SignUp 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.
    SignUp -> Maybe (HashMap Text Text)
clientMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The Amazon Pinpoint analytics metadata for collecting metrics for
    -- @SignUp@ calls.
    SignUp -> Maybe AnalyticsMetadataType
analyticsMetadata :: Prelude.Maybe AnalyticsMetadataType,
    -- | Contextual data such as the user\'s device fingerprint, IP address, or
    -- location used for evaluating the risk of an unexpected event by Amazon
    -- Cognito advanced security.
    SignUp -> Maybe UserContextDataType
userContextData :: Prelude.Maybe UserContextDataType,
    -- | An array of name-value pairs representing user attributes.
    --
    -- For custom attributes, you must prepend the @custom:@ prefix to the
    -- attribute name.
    SignUp -> Maybe [AttributeType]
userAttributes :: Prelude.Maybe [AttributeType],
    -- | A keyed-hash message authentication code (HMAC) calculated using the
    -- secret key of a user pool client and username plus the client ID in the
    -- message.
    SignUp -> Maybe (Sensitive Text)
secretHash :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The validation data in the request to register a user.
    SignUp -> Maybe [AttributeType]
validationData :: Prelude.Maybe [AttributeType],
    -- | The ID of the client associated with the user pool.
    SignUp -> Sensitive Text
clientId :: Core.Sensitive Prelude.Text,
    -- | The user name of the user you wish to register.
    SignUp -> Sensitive Text
username :: Core.Sensitive Prelude.Text,
    -- | The password of the user you wish to register.
    SignUp -> Sensitive Text
password :: Core.Sensitive Prelude.Text
  }
  deriving (SignUp -> SignUp -> Bool
(SignUp -> SignUp -> Bool)
-> (SignUp -> SignUp -> Bool) -> Eq SignUp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignUp -> SignUp -> Bool
$c/= :: SignUp -> SignUp -> Bool
== :: SignUp -> SignUp -> Bool
$c== :: SignUp -> SignUp -> Bool
Prelude.Eq, Int -> SignUp -> ShowS
[SignUp] -> ShowS
SignUp -> String
(Int -> SignUp -> ShowS)
-> (SignUp -> String) -> ([SignUp] -> ShowS) -> Show SignUp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignUp] -> ShowS
$cshowList :: [SignUp] -> ShowS
show :: SignUp -> String
$cshow :: SignUp -> String
showsPrec :: Int -> SignUp -> ShowS
$cshowsPrec :: Int -> SignUp -> ShowS
Prelude.Show, (forall x. SignUp -> Rep SignUp x)
-> (forall x. Rep SignUp x -> SignUp) -> Generic SignUp
forall x. Rep SignUp x -> SignUp
forall x. SignUp -> Rep SignUp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SignUp x -> SignUp
$cfrom :: forall x. SignUp -> Rep SignUp x
Prelude.Generic)

-- |
-- Create a value of 'SignUp' 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', 'signUp_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 SignUp API action, Amazon Cognito invokes any
-- functions that are assigned to the following triggers: /pre sign-up/,
-- /custom message/, and /post confirmation/. When Amazon Cognito invokes
-- any of these functions, 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 SignUp 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.
--
-- 'analyticsMetadata', 'signUp_analyticsMetadata' - The Amazon Pinpoint analytics metadata for collecting metrics for
-- @SignUp@ calls.
--
-- 'userContextData', 'signUp_userContextData' - Contextual data such as the user\'s device fingerprint, IP address, or
-- location used for evaluating the risk of an unexpected event by Amazon
-- Cognito advanced security.
--
-- 'userAttributes', 'signUp_userAttributes' - An array of name-value pairs representing user attributes.
--
-- For custom attributes, you must prepend the @custom:@ prefix to the
-- attribute name.
--
-- 'secretHash', 'signUp_secretHash' - A keyed-hash message authentication code (HMAC) calculated using the
-- secret key of a user pool client and username plus the client ID in the
-- message.
--
-- 'validationData', 'signUp_validationData' - The validation data in the request to register a user.
--
-- 'clientId', 'signUp_clientId' - The ID of the client associated with the user pool.
--
-- 'username', 'signUp_username' - The user name of the user you wish to register.
--
-- 'password', 'signUp_password' - The password of the user you wish to register.
newSignUp ::
  -- | 'clientId'
  Prelude.Text ->
  -- | 'username'
  Prelude.Text ->
  -- | 'password'
  Prelude.Text ->
  SignUp
newSignUp :: Text -> Text -> Text -> SignUp
newSignUp Text
pClientId_ Text
pUsername_ Text
pPassword_ =
  SignUp' :: Maybe (HashMap Text Text)
-> Maybe AnalyticsMetadataType
-> Maybe UserContextDataType
-> Maybe [AttributeType]
-> Maybe (Sensitive Text)
-> Maybe [AttributeType]
-> Sensitive Text
-> Sensitive Text
-> Sensitive Text
-> SignUp
SignUp'
    { $sel:clientMetadata:SignUp' :: Maybe (HashMap Text Text)
clientMetadata = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:analyticsMetadata:SignUp' :: Maybe AnalyticsMetadataType
analyticsMetadata = Maybe AnalyticsMetadataType
forall a. Maybe a
Prelude.Nothing,
      $sel:userContextData:SignUp' :: Maybe UserContextDataType
userContextData = Maybe UserContextDataType
forall a. Maybe a
Prelude.Nothing,
      $sel:userAttributes:SignUp' :: Maybe [AttributeType]
userAttributes = Maybe [AttributeType]
forall a. Maybe a
Prelude.Nothing,
      $sel:secretHash:SignUp' :: Maybe (Sensitive Text)
secretHash = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:validationData:SignUp' :: Maybe [AttributeType]
validationData = Maybe [AttributeType]
forall a. Maybe a
Prelude.Nothing,
      $sel:clientId:SignUp' :: Sensitive Text
clientId = 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
pClientId_,
      $sel:username:SignUp' :: Sensitive Text
username = 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
pUsername_,
      $sel:password:SignUp' :: Sensitive Text
password = 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
pPassword_
    }

-- | 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 SignUp API action, Amazon Cognito invokes any
-- functions that are assigned to the following triggers: /pre sign-up/,
-- /custom message/, and /post confirmation/. When Amazon Cognito invokes
-- any of these functions, 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 SignUp 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.
signUp_clientMetadata :: Lens.Lens' SignUp (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
signUp_clientMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SignUp -> f SignUp
signUp_clientMetadata = (SignUp -> Maybe (HashMap Text Text))
-> (SignUp -> Maybe (HashMap Text Text) -> SignUp)
-> Lens
     SignUp
     SignUp
     (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 (\SignUp' {Maybe (HashMap Text Text)
clientMetadata :: Maybe (HashMap Text Text)
$sel:clientMetadata:SignUp' :: SignUp -> Maybe (HashMap Text Text)
clientMetadata} -> Maybe (HashMap Text Text)
clientMetadata) (\s :: SignUp
s@SignUp' {} Maybe (HashMap Text Text)
a -> SignUp
s {$sel:clientMetadata:SignUp' :: Maybe (HashMap Text Text)
clientMetadata = Maybe (HashMap Text Text)
a} :: SignUp) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> SignUp -> f SignUp)
-> ((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)))
-> SignUp
-> f SignUp
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

-- | The Amazon Pinpoint analytics metadata for collecting metrics for
-- @SignUp@ calls.
signUp_analyticsMetadata :: Lens.Lens' SignUp (Prelude.Maybe AnalyticsMetadataType)
signUp_analyticsMetadata :: (Maybe AnalyticsMetadataType -> f (Maybe AnalyticsMetadataType))
-> SignUp -> f SignUp
signUp_analyticsMetadata = (SignUp -> Maybe AnalyticsMetadataType)
-> (SignUp -> Maybe AnalyticsMetadataType -> SignUp)
-> Lens
     SignUp
     SignUp
     (Maybe AnalyticsMetadataType)
     (Maybe AnalyticsMetadataType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Maybe AnalyticsMetadataType
analyticsMetadata :: Maybe AnalyticsMetadataType
$sel:analyticsMetadata:SignUp' :: SignUp -> Maybe AnalyticsMetadataType
analyticsMetadata} -> Maybe AnalyticsMetadataType
analyticsMetadata) (\s :: SignUp
s@SignUp' {} Maybe AnalyticsMetadataType
a -> SignUp
s {$sel:analyticsMetadata:SignUp' :: Maybe AnalyticsMetadataType
analyticsMetadata = Maybe AnalyticsMetadataType
a} :: SignUp)

-- | Contextual data such as the user\'s device fingerprint, IP address, or
-- location used for evaluating the risk of an unexpected event by Amazon
-- Cognito advanced security.
signUp_userContextData :: Lens.Lens' SignUp (Prelude.Maybe UserContextDataType)
signUp_userContextData :: (Maybe UserContextDataType -> f (Maybe UserContextDataType))
-> SignUp -> f SignUp
signUp_userContextData = (SignUp -> Maybe UserContextDataType)
-> (SignUp -> Maybe UserContextDataType -> SignUp)
-> Lens
     SignUp
     SignUp
     (Maybe UserContextDataType)
     (Maybe UserContextDataType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Maybe UserContextDataType
userContextData :: Maybe UserContextDataType
$sel:userContextData:SignUp' :: SignUp -> Maybe UserContextDataType
userContextData} -> Maybe UserContextDataType
userContextData) (\s :: SignUp
s@SignUp' {} Maybe UserContextDataType
a -> SignUp
s {$sel:userContextData:SignUp' :: Maybe UserContextDataType
userContextData = Maybe UserContextDataType
a} :: SignUp)

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

-- | A keyed-hash message authentication code (HMAC) calculated using the
-- secret key of a user pool client and username plus the client ID in the
-- message.
signUp_secretHash :: Lens.Lens' SignUp (Prelude.Maybe Prelude.Text)
signUp_secretHash :: (Maybe Text -> f (Maybe Text)) -> SignUp -> f SignUp
signUp_secretHash = (SignUp -> Maybe (Sensitive Text))
-> (SignUp -> Maybe (Sensitive Text) -> SignUp)
-> Lens
     SignUp SignUp (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Maybe (Sensitive Text)
secretHash :: Maybe (Sensitive Text)
$sel:secretHash:SignUp' :: SignUp -> Maybe (Sensitive Text)
secretHash} -> Maybe (Sensitive Text)
secretHash) (\s :: SignUp
s@SignUp' {} Maybe (Sensitive Text)
a -> SignUp
s {$sel:secretHash:SignUp' :: Maybe (Sensitive Text)
secretHash = Maybe (Sensitive Text)
a} :: SignUp) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> SignUp -> f SignUp)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> SignUp
-> f SignUp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The validation data in the request to register a user.
signUp_validationData :: Lens.Lens' SignUp (Prelude.Maybe [AttributeType])
signUp_validationData :: (Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> SignUp -> f SignUp
signUp_validationData = (SignUp -> Maybe [AttributeType])
-> (SignUp -> Maybe [AttributeType] -> SignUp)
-> Lens
     SignUp SignUp (Maybe [AttributeType]) (Maybe [AttributeType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Maybe [AttributeType]
validationData :: Maybe [AttributeType]
$sel:validationData:SignUp' :: SignUp -> Maybe [AttributeType]
validationData} -> Maybe [AttributeType]
validationData) (\s :: SignUp
s@SignUp' {} Maybe [AttributeType]
a -> SignUp
s {$sel:validationData:SignUp' :: Maybe [AttributeType]
validationData = Maybe [AttributeType]
a} :: SignUp) ((Maybe [AttributeType] -> f (Maybe [AttributeType]))
 -> SignUp -> f SignUp)
-> ((Maybe [AttributeType] -> f (Maybe [AttributeType]))
    -> Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> (Maybe [AttributeType] -> f (Maybe [AttributeType]))
-> SignUp
-> f SignUp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AttributeType] [AttributeType] [AttributeType] [AttributeType]
-> Iso
     (Maybe [AttributeType])
     (Maybe [AttributeType])
     (Maybe [AttributeType])
     (Maybe [AttributeType])
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
  [AttributeType] [AttributeType] [AttributeType] [AttributeType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the client associated with the user pool.
signUp_clientId :: Lens.Lens' SignUp Prelude.Text
signUp_clientId :: (Text -> f Text) -> SignUp -> f SignUp
signUp_clientId = (SignUp -> Sensitive Text)
-> (SignUp -> Sensitive Text -> SignUp)
-> Lens SignUp SignUp (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Sensitive Text
clientId :: Sensitive Text
$sel:clientId:SignUp' :: SignUp -> Sensitive Text
clientId} -> Sensitive Text
clientId) (\s :: SignUp
s@SignUp' {} Sensitive Text
a -> SignUp
s {$sel:clientId:SignUp' :: Sensitive Text
clientId = Sensitive Text
a} :: SignUp) ((Sensitive Text -> f (Sensitive Text)) -> SignUp -> f SignUp)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> SignUp
-> f SignUp
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

-- | The user name of the user you wish to register.
signUp_username :: Lens.Lens' SignUp Prelude.Text
signUp_username :: (Text -> f Text) -> SignUp -> f SignUp
signUp_username = (SignUp -> Sensitive Text)
-> (SignUp -> Sensitive Text -> SignUp)
-> Lens SignUp SignUp (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Sensitive Text
username :: Sensitive Text
$sel:username:SignUp' :: SignUp -> Sensitive Text
username} -> Sensitive Text
username) (\s :: SignUp
s@SignUp' {} Sensitive Text
a -> SignUp
s {$sel:username:SignUp' :: Sensitive Text
username = Sensitive Text
a} :: SignUp) ((Sensitive Text -> f (Sensitive Text)) -> SignUp -> f SignUp)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> SignUp
-> f SignUp
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

-- | The password of the user you wish to register.
signUp_password :: Lens.Lens' SignUp Prelude.Text
signUp_password :: (Text -> f Text) -> SignUp -> f SignUp
signUp_password = (SignUp -> Sensitive Text)
-> (SignUp -> Sensitive Text -> SignUp)
-> Lens SignUp SignUp (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUp' {Sensitive Text
password :: Sensitive Text
$sel:password:SignUp' :: SignUp -> Sensitive Text
password} -> Sensitive Text
password) (\s :: SignUp
s@SignUp' {} Sensitive Text
a -> SignUp
s {$sel:password:SignUp' :: Sensitive Text
password = Sensitive Text
a} :: SignUp) ((Sensitive Text -> f (Sensitive Text)) -> SignUp -> f SignUp)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> SignUp
-> f SignUp
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 SignUp where
  type AWSResponse SignUp = SignUpResponse
  request :: SignUp -> Request SignUp
request = Service -> SignUp -> Request SignUp
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy SignUp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SignUp)))
response =
    (Int
 -> ResponseHeaders -> Object -> Either String (AWSResponse SignUp))
-> Logger
-> Service
-> Proxy SignUp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SignUp)))
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 -> Bool -> Text -> SignUpResponse
SignUpResponse'
            (Maybe CodeDeliveryDetailsType
 -> Int -> Bool -> Text -> SignUpResponse)
-> Either String (Maybe CodeDeliveryDetailsType)
-> Either String (Int -> Bool -> Text -> SignUpResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe CodeDeliveryDetailsType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CodeDeliveryDetails")
            Either String (Int -> Bool -> Text -> SignUpResponse)
-> Either String Int
-> Either String (Bool -> Text -> SignUpResponse)
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))
            Either String (Bool -> Text -> SignUpResponse)
-> Either String Bool -> Either String (Text -> SignUpResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Bool
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"UserConfirmed")
            Either String (Text -> SignUpResponse)
-> Either String Text -> Either String SignUpResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"UserSub")
      )

instance Prelude.Hashable SignUp

instance Prelude.NFData SignUp

instance Core.ToHeaders SignUp where
  toHeaders :: SignUp -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SignUp -> 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.SignUp" ::
                          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 SignUp where
  toJSON :: SignUp -> Value
toJSON SignUp' {Maybe [AttributeType]
Maybe (HashMap Text Text)
Maybe (Sensitive Text)
Maybe AnalyticsMetadataType
Maybe UserContextDataType
Sensitive Text
password :: Sensitive Text
username :: Sensitive Text
clientId :: Sensitive Text
validationData :: Maybe [AttributeType]
secretHash :: Maybe (Sensitive Text)
userAttributes :: Maybe [AttributeType]
userContextData :: Maybe UserContextDataType
analyticsMetadata :: Maybe AnalyticsMetadataType
clientMetadata :: Maybe (HashMap Text Text)
$sel:password:SignUp' :: SignUp -> Sensitive Text
$sel:username:SignUp' :: SignUp -> Sensitive Text
$sel:clientId:SignUp' :: SignUp -> Sensitive Text
$sel:validationData:SignUp' :: SignUp -> Maybe [AttributeType]
$sel:secretHash:SignUp' :: SignUp -> Maybe (Sensitive Text)
$sel:userAttributes:SignUp' :: SignUp -> Maybe [AttributeType]
$sel:userContextData:SignUp' :: SignUp -> Maybe UserContextDataType
$sel:analyticsMetadata:SignUp' :: SignUp -> Maybe AnalyticsMetadataType
$sel:clientMetadata:SignUp' :: SignUp -> 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,
            (Text
"AnalyticsMetadata" Text -> AnalyticsMetadataType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AnalyticsMetadataType -> Pair)
-> Maybe AnalyticsMetadataType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AnalyticsMetadataType
analyticsMetadata,
            (Text
"UserContextData" Text -> UserContextDataType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (UserContextDataType -> Pair)
-> Maybe UserContextDataType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UserContextDataType
userContextData,
            (Text
"UserAttributes" Text -> [AttributeType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AttributeType] -> Pair) -> Maybe [AttributeType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AttributeType]
userAttributes,
            (Text
"SecretHash" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
secretHash,
            (Text
"ValidationData" Text -> [AttributeType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([AttributeType] -> Pair) -> Maybe [AttributeType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AttributeType]
validationData,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientId" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
clientId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Username" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
username),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Password" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
password)
          ]
      )

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

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

-- | The response from the server for a registration request.
--
-- /See:/ 'newSignUpResponse' smart constructor.
data SignUpResponse = SignUpResponse'
  { -- | The code delivery details returned by the server response to the user
    -- registration request.
    SignUpResponse -> Maybe CodeDeliveryDetailsType
codeDeliveryDetails :: Prelude.Maybe CodeDeliveryDetailsType,
    -- | The response's http status code.
    SignUpResponse -> Int
httpStatus :: Prelude.Int,
    -- | A response from the server indicating that a user registration has been
    -- confirmed.
    SignUpResponse -> Bool
userConfirmed :: Prelude.Bool,
    -- | The UUID of the authenticated user. This is not the same as @username@.
    SignUpResponse -> Text
userSub :: Prelude.Text
  }
  deriving (SignUpResponse -> SignUpResponse -> Bool
(SignUpResponse -> SignUpResponse -> Bool)
-> (SignUpResponse -> SignUpResponse -> Bool) -> Eq SignUpResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignUpResponse -> SignUpResponse -> Bool
$c/= :: SignUpResponse -> SignUpResponse -> Bool
== :: SignUpResponse -> SignUpResponse -> Bool
$c== :: SignUpResponse -> SignUpResponse -> Bool
Prelude.Eq, ReadPrec [SignUpResponse]
ReadPrec SignUpResponse
Int -> ReadS SignUpResponse
ReadS [SignUpResponse]
(Int -> ReadS SignUpResponse)
-> ReadS [SignUpResponse]
-> ReadPrec SignUpResponse
-> ReadPrec [SignUpResponse]
-> Read SignUpResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SignUpResponse]
$creadListPrec :: ReadPrec [SignUpResponse]
readPrec :: ReadPrec SignUpResponse
$creadPrec :: ReadPrec SignUpResponse
readList :: ReadS [SignUpResponse]
$creadList :: ReadS [SignUpResponse]
readsPrec :: Int -> ReadS SignUpResponse
$creadsPrec :: Int -> ReadS SignUpResponse
Prelude.Read, Int -> SignUpResponse -> ShowS
[SignUpResponse] -> ShowS
SignUpResponse -> String
(Int -> SignUpResponse -> ShowS)
-> (SignUpResponse -> String)
-> ([SignUpResponse] -> ShowS)
-> Show SignUpResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignUpResponse] -> ShowS
$cshowList :: [SignUpResponse] -> ShowS
show :: SignUpResponse -> String
$cshow :: SignUpResponse -> String
showsPrec :: Int -> SignUpResponse -> ShowS
$cshowsPrec :: Int -> SignUpResponse -> ShowS
Prelude.Show, (forall x. SignUpResponse -> Rep SignUpResponse x)
-> (forall x. Rep SignUpResponse x -> SignUpResponse)
-> Generic SignUpResponse
forall x. Rep SignUpResponse x -> SignUpResponse
forall x. SignUpResponse -> Rep SignUpResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SignUpResponse x -> SignUpResponse
$cfrom :: forall x. SignUpResponse -> Rep SignUpResponse x
Prelude.Generic)

-- |
-- Create a value of 'SignUpResponse' 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:
--
-- 'codeDeliveryDetails', 'signUpResponse_codeDeliveryDetails' - The code delivery details returned by the server response to the user
-- registration request.
--
-- 'httpStatus', 'signUpResponse_httpStatus' - The response's http status code.
--
-- 'userConfirmed', 'signUpResponse_userConfirmed' - A response from the server indicating that a user registration has been
-- confirmed.
--
-- 'userSub', 'signUpResponse_userSub' - The UUID of the authenticated user. This is not the same as @username@.
newSignUpResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'userConfirmed'
  Prelude.Bool ->
  -- | 'userSub'
  Prelude.Text ->
  SignUpResponse
newSignUpResponse :: Int -> Bool -> Text -> SignUpResponse
newSignUpResponse
  Int
pHttpStatus_
  Bool
pUserConfirmed_
  Text
pUserSub_ =
    SignUpResponse' :: Maybe CodeDeliveryDetailsType
-> Int -> Bool -> Text -> SignUpResponse
SignUpResponse'
      { $sel:codeDeliveryDetails:SignUpResponse' :: Maybe CodeDeliveryDetailsType
codeDeliveryDetails =
          Maybe CodeDeliveryDetailsType
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:SignUpResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:userConfirmed:SignUpResponse' :: Bool
userConfirmed = Bool
pUserConfirmed_,
        $sel:userSub:SignUpResponse' :: Text
userSub = Text
pUserSub_
      }

-- | The code delivery details returned by the server response to the user
-- registration request.
signUpResponse_codeDeliveryDetails :: Lens.Lens' SignUpResponse (Prelude.Maybe CodeDeliveryDetailsType)
signUpResponse_codeDeliveryDetails :: (Maybe CodeDeliveryDetailsType
 -> f (Maybe CodeDeliveryDetailsType))
-> SignUpResponse -> f SignUpResponse
signUpResponse_codeDeliveryDetails = (SignUpResponse -> Maybe CodeDeliveryDetailsType)
-> (SignUpResponse
    -> Maybe CodeDeliveryDetailsType -> SignUpResponse)
-> Lens
     SignUpResponse
     SignUpResponse
     (Maybe CodeDeliveryDetailsType)
     (Maybe CodeDeliveryDetailsType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUpResponse' {Maybe CodeDeliveryDetailsType
codeDeliveryDetails :: Maybe CodeDeliveryDetailsType
$sel:codeDeliveryDetails:SignUpResponse' :: SignUpResponse -> Maybe CodeDeliveryDetailsType
codeDeliveryDetails} -> Maybe CodeDeliveryDetailsType
codeDeliveryDetails) (\s :: SignUpResponse
s@SignUpResponse' {} Maybe CodeDeliveryDetailsType
a -> SignUpResponse
s {$sel:codeDeliveryDetails:SignUpResponse' :: Maybe CodeDeliveryDetailsType
codeDeliveryDetails = Maybe CodeDeliveryDetailsType
a} :: SignUpResponse)

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

-- | A response from the server indicating that a user registration has been
-- confirmed.
signUpResponse_userConfirmed :: Lens.Lens' SignUpResponse Prelude.Bool
signUpResponse_userConfirmed :: (Bool -> f Bool) -> SignUpResponse -> f SignUpResponse
signUpResponse_userConfirmed = (SignUpResponse -> Bool)
-> (SignUpResponse -> Bool -> SignUpResponse)
-> Lens SignUpResponse SignUpResponse Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUpResponse' {Bool
userConfirmed :: Bool
$sel:userConfirmed:SignUpResponse' :: SignUpResponse -> Bool
userConfirmed} -> Bool
userConfirmed) (\s :: SignUpResponse
s@SignUpResponse' {} Bool
a -> SignUpResponse
s {$sel:userConfirmed:SignUpResponse' :: Bool
userConfirmed = Bool
a} :: SignUpResponse)

-- | The UUID of the authenticated user. This is not the same as @username@.
signUpResponse_userSub :: Lens.Lens' SignUpResponse Prelude.Text
signUpResponse_userSub :: (Text -> f Text) -> SignUpResponse -> f SignUpResponse
signUpResponse_userSub = (SignUpResponse -> Text)
-> (SignUpResponse -> Text -> SignUpResponse)
-> Lens SignUpResponse SignUpResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignUpResponse' {Text
userSub :: Text
$sel:userSub:SignUpResponse' :: SignUpResponse -> Text
userSub} -> Text
userSub) (\s :: SignUpResponse
s@SignUpResponse' {} Text
a -> SignUpResponse
s {$sel:userSub:SignUpResponse' :: Text
userSub = Text
a} :: SignUpResponse)

instance Prelude.NFData SignUpResponse