{-# 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.AdminResetUserPassword
-- 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)
--
-- Resets the specified user\'s password in a user pool as an
-- administrator. Works on any user.
--
-- When a developer calls this API, the current password is invalidated, so
-- it must be changed. If a user tries to sign in after the API is called,
-- the app will get a PasswordResetRequiredException exception back and
-- should direct the user down the flow to reset the password, which is the
-- same as the forgot password flow. In addition, if the user pool has
-- phone verification selected and a verified phone number exists for the
-- user, or if email verification is selected and a verified email exists
-- for the user, calling this API will also result in sending a message to
-- the end user with the code to change their password.
--
-- 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/.
--
-- Calling this action requires developer credentials.
module Amazonka.CognitoIdentityProvider.AdminResetUserPassword
  ( -- * Creating a Request
    AdminResetUserPassword (..),
    newAdminResetUserPassword,

    -- * Request Lenses
    adminResetUserPassword_clientMetadata,
    adminResetUserPassword_userPoolId,
    adminResetUserPassword_username,

    -- * Destructuring the Response
    AdminResetUserPasswordResponse (..),
    newAdminResetUserPasswordResponse,

    -- * Response Lenses
    adminResetUserPasswordResponse_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 reset a user\'s password as an administrator.
--
-- /See:/ 'newAdminResetUserPassword' smart constructor.
data AdminResetUserPassword = AdminResetUserPassword'
  { -- | 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 AdminResetUserPassword 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 AdminResetUserPassword 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.
    AdminResetUserPassword -> Maybe (HashMap Text Text)
clientMetadata :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The user pool ID for the user pool where you want to reset the user\'s
    -- password.
    AdminResetUserPassword -> Text
userPoolId :: Prelude.Text,
    -- | The user name of the user whose password you wish to reset.
    AdminResetUserPassword -> Sensitive Text
username :: Core.Sensitive Prelude.Text
  }
  deriving (AdminResetUserPassword -> AdminResetUserPassword -> Bool
(AdminResetUserPassword -> AdminResetUserPassword -> Bool)
-> (AdminResetUserPassword -> AdminResetUserPassword -> Bool)
-> Eq AdminResetUserPassword
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminResetUserPassword -> AdminResetUserPassword -> Bool
$c/= :: AdminResetUserPassword -> AdminResetUserPassword -> Bool
== :: AdminResetUserPassword -> AdminResetUserPassword -> Bool
$c== :: AdminResetUserPassword -> AdminResetUserPassword -> Bool
Prelude.Eq, Int -> AdminResetUserPassword -> ShowS
[AdminResetUserPassword] -> ShowS
AdminResetUserPassword -> String
(Int -> AdminResetUserPassword -> ShowS)
-> (AdminResetUserPassword -> String)
-> ([AdminResetUserPassword] -> ShowS)
-> Show AdminResetUserPassword
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminResetUserPassword] -> ShowS
$cshowList :: [AdminResetUserPassword] -> ShowS
show :: AdminResetUserPassword -> String
$cshow :: AdminResetUserPassword -> String
showsPrec :: Int -> AdminResetUserPassword -> ShowS
$cshowsPrec :: Int -> AdminResetUserPassword -> ShowS
Prelude.Show, (forall x. AdminResetUserPassword -> Rep AdminResetUserPassword x)
-> (forall x.
    Rep AdminResetUserPassword x -> AdminResetUserPassword)
-> Generic AdminResetUserPassword
forall x. Rep AdminResetUserPassword x -> AdminResetUserPassword
forall x. AdminResetUserPassword -> Rep AdminResetUserPassword x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdminResetUserPassword x -> AdminResetUserPassword
$cfrom :: forall x. AdminResetUserPassword -> Rep AdminResetUserPassword x
Prelude.Generic)

-- |
-- Create a value of 'AdminResetUserPassword' 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', 'adminResetUserPassword_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 AdminResetUserPassword 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 AdminResetUserPassword 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.
--
-- 'userPoolId', 'adminResetUserPassword_userPoolId' - The user pool ID for the user pool where you want to reset the user\'s
-- password.
--
-- 'username', 'adminResetUserPassword_username' - The user name of the user whose password you wish to reset.
newAdminResetUserPassword ::
  -- | 'userPoolId'
  Prelude.Text ->
  -- | 'username'
  Prelude.Text ->
  AdminResetUserPassword
newAdminResetUserPassword :: Text -> Text -> AdminResetUserPassword
newAdminResetUserPassword Text
pUserPoolId_ Text
pUsername_ =
  AdminResetUserPassword' :: Maybe (HashMap Text Text)
-> Text -> Sensitive Text -> AdminResetUserPassword
AdminResetUserPassword'
    { $sel:clientMetadata:AdminResetUserPassword' :: Maybe (HashMap Text Text)
clientMetadata =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:AdminResetUserPassword' :: Text
userPoolId = Text
pUserPoolId_,
      $sel:username:AdminResetUserPassword' :: 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_
    }

-- | 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 AdminResetUserPassword 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 AdminResetUserPassword 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.
adminResetUserPassword_clientMetadata :: Lens.Lens' AdminResetUserPassword (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
adminResetUserPassword_clientMetadata :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AdminResetUserPassword -> f AdminResetUserPassword
adminResetUserPassword_clientMetadata = (AdminResetUserPassword -> Maybe (HashMap Text Text))
-> (AdminResetUserPassword
    -> Maybe (HashMap Text Text) -> AdminResetUserPassword)
-> Lens
     AdminResetUserPassword
     AdminResetUserPassword
     (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 (\AdminResetUserPassword' {Maybe (HashMap Text Text)
clientMetadata :: Maybe (HashMap Text Text)
$sel:clientMetadata:AdminResetUserPassword' :: AdminResetUserPassword -> Maybe (HashMap Text Text)
clientMetadata} -> Maybe (HashMap Text Text)
clientMetadata) (\s :: AdminResetUserPassword
s@AdminResetUserPassword' {} Maybe (HashMap Text Text)
a -> AdminResetUserPassword
s {$sel:clientMetadata:AdminResetUserPassword' :: Maybe (HashMap Text Text)
clientMetadata = Maybe (HashMap Text Text)
a} :: AdminResetUserPassword) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> AdminResetUserPassword -> f AdminResetUserPassword)
-> ((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)))
-> AdminResetUserPassword
-> f AdminResetUserPassword
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 user pool ID for the user pool where you want to reset the user\'s
-- password.
adminResetUserPassword_userPoolId :: Lens.Lens' AdminResetUserPassword Prelude.Text
adminResetUserPassword_userPoolId :: (Text -> f Text)
-> AdminResetUserPassword -> f AdminResetUserPassword
adminResetUserPassword_userPoolId = (AdminResetUserPassword -> Text)
-> (AdminResetUserPassword -> Text -> AdminResetUserPassword)
-> Lens AdminResetUserPassword AdminResetUserPassword Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminResetUserPassword' {Text
userPoolId :: Text
$sel:userPoolId:AdminResetUserPassword' :: AdminResetUserPassword -> Text
userPoolId} -> Text
userPoolId) (\s :: AdminResetUserPassword
s@AdminResetUserPassword' {} Text
a -> AdminResetUserPassword
s {$sel:userPoolId:AdminResetUserPassword' :: Text
userPoolId = Text
a} :: AdminResetUserPassword)

-- | The user name of the user whose password you wish to reset.
adminResetUserPassword_username :: Lens.Lens' AdminResetUserPassword Prelude.Text
adminResetUserPassword_username :: (Text -> f Text)
-> AdminResetUserPassword -> f AdminResetUserPassword
adminResetUserPassword_username = (AdminResetUserPassword -> Sensitive Text)
-> (AdminResetUserPassword
    -> Sensitive Text -> AdminResetUserPassword)
-> Lens
     AdminResetUserPassword
     AdminResetUserPassword
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminResetUserPassword' {Sensitive Text
username :: Sensitive Text
$sel:username:AdminResetUserPassword' :: AdminResetUserPassword -> Sensitive Text
username} -> Sensitive Text
username) (\s :: AdminResetUserPassword
s@AdminResetUserPassword' {} Sensitive Text
a -> AdminResetUserPassword
s {$sel:username:AdminResetUserPassword' :: Sensitive Text
username = Sensitive Text
a} :: AdminResetUserPassword) ((Sensitive Text -> f (Sensitive Text))
 -> AdminResetUserPassword -> f AdminResetUserPassword)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> AdminResetUserPassword
-> f AdminResetUserPassword
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 AdminResetUserPassword where
  type
    AWSResponse AdminResetUserPassword =
      AdminResetUserPasswordResponse
  request :: AdminResetUserPassword -> Request AdminResetUserPassword
request = Service -> AdminResetUserPassword -> Request AdminResetUserPassword
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AdminResetUserPassword
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AdminResetUserPassword)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse AdminResetUserPassword))
-> Logger
-> Service
-> Proxy AdminResetUserPassword
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AdminResetUserPassword)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> AdminResetUserPasswordResponse
AdminResetUserPasswordResponse'
            (Int -> AdminResetUserPasswordResponse)
-> Either String Int
-> Either String AdminResetUserPasswordResponse
forall (f :: * -> *) a b. Functor 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 AdminResetUserPassword

instance Prelude.NFData AdminResetUserPassword

instance Core.ToHeaders AdminResetUserPassword where
  toHeaders :: AdminResetUserPassword -> ResponseHeaders
toHeaders =
    ResponseHeaders -> AdminResetUserPassword -> 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.AdminResetUserPassword" ::
                          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 AdminResetUserPassword where
  toJSON :: AdminResetUserPassword -> Value
toJSON AdminResetUserPassword' {Maybe (HashMap Text Text)
Text
Sensitive Text
username :: Sensitive Text
userPoolId :: Text
clientMetadata :: Maybe (HashMap Text Text)
$sel:username:AdminResetUserPassword' :: AdminResetUserPassword -> Sensitive Text
$sel:userPoolId:AdminResetUserPassword' :: AdminResetUserPassword -> Text
$sel:clientMetadata:AdminResetUserPassword' :: AdminResetUserPassword -> 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
"UserPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userPoolId),
            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)
          ]
      )

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

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

-- | Represents the response from the server to reset a user password as an
-- administrator.
--
-- /See:/ 'newAdminResetUserPasswordResponse' smart constructor.
data AdminResetUserPasswordResponse = AdminResetUserPasswordResponse'
  { -- | The response's http status code.
    AdminResetUserPasswordResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AdminResetUserPasswordResponse
-> AdminResetUserPasswordResponse -> Bool
(AdminResetUserPasswordResponse
 -> AdminResetUserPasswordResponse -> Bool)
-> (AdminResetUserPasswordResponse
    -> AdminResetUserPasswordResponse -> Bool)
-> Eq AdminResetUserPasswordResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminResetUserPasswordResponse
-> AdminResetUserPasswordResponse -> Bool
$c/= :: AdminResetUserPasswordResponse
-> AdminResetUserPasswordResponse -> Bool
== :: AdminResetUserPasswordResponse
-> AdminResetUserPasswordResponse -> Bool
$c== :: AdminResetUserPasswordResponse
-> AdminResetUserPasswordResponse -> Bool
Prelude.Eq, ReadPrec [AdminResetUserPasswordResponse]
ReadPrec AdminResetUserPasswordResponse
Int -> ReadS AdminResetUserPasswordResponse
ReadS [AdminResetUserPasswordResponse]
(Int -> ReadS AdminResetUserPasswordResponse)
-> ReadS [AdminResetUserPasswordResponse]
-> ReadPrec AdminResetUserPasswordResponse
-> ReadPrec [AdminResetUserPasswordResponse]
-> Read AdminResetUserPasswordResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdminResetUserPasswordResponse]
$creadListPrec :: ReadPrec [AdminResetUserPasswordResponse]
readPrec :: ReadPrec AdminResetUserPasswordResponse
$creadPrec :: ReadPrec AdminResetUserPasswordResponse
readList :: ReadS [AdminResetUserPasswordResponse]
$creadList :: ReadS [AdminResetUserPasswordResponse]
readsPrec :: Int -> ReadS AdminResetUserPasswordResponse
$creadsPrec :: Int -> ReadS AdminResetUserPasswordResponse
Prelude.Read, Int -> AdminResetUserPasswordResponse -> ShowS
[AdminResetUserPasswordResponse] -> ShowS
AdminResetUserPasswordResponse -> String
(Int -> AdminResetUserPasswordResponse -> ShowS)
-> (AdminResetUserPasswordResponse -> String)
-> ([AdminResetUserPasswordResponse] -> ShowS)
-> Show AdminResetUserPasswordResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminResetUserPasswordResponse] -> ShowS
$cshowList :: [AdminResetUserPasswordResponse] -> ShowS
show :: AdminResetUserPasswordResponse -> String
$cshow :: AdminResetUserPasswordResponse -> String
showsPrec :: Int -> AdminResetUserPasswordResponse -> ShowS
$cshowsPrec :: Int -> AdminResetUserPasswordResponse -> ShowS
Prelude.Show, (forall x.
 AdminResetUserPasswordResponse
 -> Rep AdminResetUserPasswordResponse x)
-> (forall x.
    Rep AdminResetUserPasswordResponse x
    -> AdminResetUserPasswordResponse)
-> Generic AdminResetUserPasswordResponse
forall x.
Rep AdminResetUserPasswordResponse x
-> AdminResetUserPasswordResponse
forall x.
AdminResetUserPasswordResponse
-> Rep AdminResetUserPasswordResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AdminResetUserPasswordResponse x
-> AdminResetUserPasswordResponse
$cfrom :: forall x.
AdminResetUserPasswordResponse
-> Rep AdminResetUserPasswordResponse x
Prelude.Generic)

-- |
-- Create a value of 'AdminResetUserPasswordResponse' 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:
--
-- 'httpStatus', 'adminResetUserPasswordResponse_httpStatus' - The response's http status code.
newAdminResetUserPasswordResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AdminResetUserPasswordResponse
newAdminResetUserPasswordResponse :: Int -> AdminResetUserPasswordResponse
newAdminResetUserPasswordResponse Int
pHttpStatus_ =
  AdminResetUserPasswordResponse' :: Int -> AdminResetUserPasswordResponse
AdminResetUserPasswordResponse'
    { $sel:httpStatus:AdminResetUserPasswordResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    AdminResetUserPasswordResponse