{-# 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 #-}
module Amazonka.CognitoIdentityProvider.AdminEnableUser
(
AdminEnableUser (..),
newAdminEnableUser,
adminEnableUser_userPoolId,
adminEnableUser_username,
AdminEnableUserResponse (..),
newAdminEnableUserResponse,
adminEnableUserResponse_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
data AdminEnableUser = AdminEnableUser'
{
AdminEnableUser -> Text
userPoolId :: Prelude.Text,
AdminEnableUser -> Sensitive Text
username :: Core.Sensitive Prelude.Text
}
deriving (AdminEnableUser -> AdminEnableUser -> Bool
(AdminEnableUser -> AdminEnableUser -> Bool)
-> (AdminEnableUser -> AdminEnableUser -> Bool)
-> Eq AdminEnableUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminEnableUser -> AdminEnableUser -> Bool
$c/= :: AdminEnableUser -> AdminEnableUser -> Bool
== :: AdminEnableUser -> AdminEnableUser -> Bool
$c== :: AdminEnableUser -> AdminEnableUser -> Bool
Prelude.Eq, Int -> AdminEnableUser -> ShowS
[AdminEnableUser] -> ShowS
AdminEnableUser -> String
(Int -> AdminEnableUser -> ShowS)
-> (AdminEnableUser -> String)
-> ([AdminEnableUser] -> ShowS)
-> Show AdminEnableUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminEnableUser] -> ShowS
$cshowList :: [AdminEnableUser] -> ShowS
show :: AdminEnableUser -> String
$cshow :: AdminEnableUser -> String
showsPrec :: Int -> AdminEnableUser -> ShowS
$cshowsPrec :: Int -> AdminEnableUser -> ShowS
Prelude.Show, (forall x. AdminEnableUser -> Rep AdminEnableUser x)
-> (forall x. Rep AdminEnableUser x -> AdminEnableUser)
-> Generic AdminEnableUser
forall x. Rep AdminEnableUser x -> AdminEnableUser
forall x. AdminEnableUser -> Rep AdminEnableUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdminEnableUser x -> AdminEnableUser
$cfrom :: forall x. AdminEnableUser -> Rep AdminEnableUser x
Prelude.Generic)
newAdminEnableUser ::
Prelude.Text ->
Prelude.Text ->
AdminEnableUser
newAdminEnableUser :: Text -> Text -> AdminEnableUser
newAdminEnableUser Text
pUserPoolId_ Text
pUsername_ =
AdminEnableUser' :: Text -> Sensitive Text -> AdminEnableUser
AdminEnableUser'
{ $sel:userPoolId:AdminEnableUser' :: Text
userPoolId = Text
pUserPoolId_,
$sel:username:AdminEnableUser' :: 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_
}
adminEnableUser_userPoolId :: Lens.Lens' AdminEnableUser Prelude.Text
adminEnableUser_userPoolId :: (Text -> f Text) -> AdminEnableUser -> f AdminEnableUser
adminEnableUser_userPoolId = (AdminEnableUser -> Text)
-> (AdminEnableUser -> Text -> AdminEnableUser)
-> Lens AdminEnableUser AdminEnableUser Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminEnableUser' {Text
userPoolId :: Text
$sel:userPoolId:AdminEnableUser' :: AdminEnableUser -> Text
userPoolId} -> Text
userPoolId) (\s :: AdminEnableUser
s@AdminEnableUser' {} Text
a -> AdminEnableUser
s {$sel:userPoolId:AdminEnableUser' :: Text
userPoolId = Text
a} :: AdminEnableUser)
adminEnableUser_username :: Lens.Lens' AdminEnableUser Prelude.Text
adminEnableUser_username :: (Text -> f Text) -> AdminEnableUser -> f AdminEnableUser
adminEnableUser_username = (AdminEnableUser -> Sensitive Text)
-> (AdminEnableUser -> Sensitive Text -> AdminEnableUser)
-> Lens
AdminEnableUser AdminEnableUser (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminEnableUser' {Sensitive Text
username :: Sensitive Text
$sel:username:AdminEnableUser' :: AdminEnableUser -> Sensitive Text
username} -> Sensitive Text
username) (\s :: AdminEnableUser
s@AdminEnableUser' {} Sensitive Text
a -> AdminEnableUser
s {$sel:username:AdminEnableUser' :: Sensitive Text
username = Sensitive Text
a} :: AdminEnableUser) ((Sensitive Text -> f (Sensitive Text))
-> AdminEnableUser -> f AdminEnableUser)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> AdminEnableUser
-> f AdminEnableUser
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 AdminEnableUser where
type
AWSResponse AdminEnableUser =
AdminEnableUserResponse
request :: AdminEnableUser -> Request AdminEnableUser
request = Service -> AdminEnableUser -> Request AdminEnableUser
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AdminEnableUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AdminEnableUser)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse AdminEnableUser))
-> Logger
-> Service
-> Proxy AdminEnableUser
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AdminEnableUser)))
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 -> AdminEnableUserResponse
AdminEnableUserResponse'
(Int -> AdminEnableUserResponse)
-> Either String Int -> Either String AdminEnableUserResponse
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 AdminEnableUser
instance Prelude.NFData AdminEnableUser
instance Core.ToHeaders AdminEnableUser where
toHeaders :: AdminEnableUser -> ResponseHeaders
toHeaders =
ResponseHeaders -> AdminEnableUser -> 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.AdminEnableUser" ::
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 AdminEnableUser where
toJSON :: AdminEnableUser -> Value
toJSON AdminEnableUser' {Text
Sensitive Text
username :: Sensitive Text
userPoolId :: Text
$sel:username:AdminEnableUser' :: AdminEnableUser -> Sensitive Text
$sel:userPoolId:AdminEnableUser' :: AdminEnableUser -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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 AdminEnableUser where
toPath :: AdminEnableUser -> ByteString
toPath = ByteString -> AdminEnableUser -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AdminEnableUser where
toQuery :: AdminEnableUser -> QueryString
toQuery = QueryString -> AdminEnableUser -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AdminEnableUserResponse = AdminEnableUserResponse'
{
AdminEnableUserResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AdminEnableUserResponse -> AdminEnableUserResponse -> Bool
(AdminEnableUserResponse -> AdminEnableUserResponse -> Bool)
-> (AdminEnableUserResponse -> AdminEnableUserResponse -> Bool)
-> Eq AdminEnableUserResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminEnableUserResponse -> AdminEnableUserResponse -> Bool
$c/= :: AdminEnableUserResponse -> AdminEnableUserResponse -> Bool
== :: AdminEnableUserResponse -> AdminEnableUserResponse -> Bool
$c== :: AdminEnableUserResponse -> AdminEnableUserResponse -> Bool
Prelude.Eq, ReadPrec [AdminEnableUserResponse]
ReadPrec AdminEnableUserResponse
Int -> ReadS AdminEnableUserResponse
ReadS [AdminEnableUserResponse]
(Int -> ReadS AdminEnableUserResponse)
-> ReadS [AdminEnableUserResponse]
-> ReadPrec AdminEnableUserResponse
-> ReadPrec [AdminEnableUserResponse]
-> Read AdminEnableUserResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdminEnableUserResponse]
$creadListPrec :: ReadPrec [AdminEnableUserResponse]
readPrec :: ReadPrec AdminEnableUserResponse
$creadPrec :: ReadPrec AdminEnableUserResponse
readList :: ReadS [AdminEnableUserResponse]
$creadList :: ReadS [AdminEnableUserResponse]
readsPrec :: Int -> ReadS AdminEnableUserResponse
$creadsPrec :: Int -> ReadS AdminEnableUserResponse
Prelude.Read, Int -> AdminEnableUserResponse -> ShowS
[AdminEnableUserResponse] -> ShowS
AdminEnableUserResponse -> String
(Int -> AdminEnableUserResponse -> ShowS)
-> (AdminEnableUserResponse -> String)
-> ([AdminEnableUserResponse] -> ShowS)
-> Show AdminEnableUserResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminEnableUserResponse] -> ShowS
$cshowList :: [AdminEnableUserResponse] -> ShowS
show :: AdminEnableUserResponse -> String
$cshow :: AdminEnableUserResponse -> String
showsPrec :: Int -> AdminEnableUserResponse -> ShowS
$cshowsPrec :: Int -> AdminEnableUserResponse -> ShowS
Prelude.Show, (forall x.
AdminEnableUserResponse -> Rep AdminEnableUserResponse x)
-> (forall x.
Rep AdminEnableUserResponse x -> AdminEnableUserResponse)
-> Generic AdminEnableUserResponse
forall x. Rep AdminEnableUserResponse x -> AdminEnableUserResponse
forall x. AdminEnableUserResponse -> Rep AdminEnableUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdminEnableUserResponse x -> AdminEnableUserResponse
$cfrom :: forall x. AdminEnableUserResponse -> Rep AdminEnableUserResponse x
Prelude.Generic)
newAdminEnableUserResponse ::
Prelude.Int ->
AdminEnableUserResponse
newAdminEnableUserResponse :: Int -> AdminEnableUserResponse
newAdminEnableUserResponse Int
pHttpStatus_ =
AdminEnableUserResponse' :: Int -> AdminEnableUserResponse
AdminEnableUserResponse' {$sel:httpStatus:AdminEnableUserResponse' :: Int
httpStatus = Int
pHttpStatus_}
adminEnableUserResponse_httpStatus :: Lens.Lens' AdminEnableUserResponse Prelude.Int
adminEnableUserResponse_httpStatus :: (Int -> f Int)
-> AdminEnableUserResponse -> f AdminEnableUserResponse
adminEnableUserResponse_httpStatus = (AdminEnableUserResponse -> Int)
-> (AdminEnableUserResponse -> Int -> AdminEnableUserResponse)
-> Lens AdminEnableUserResponse AdminEnableUserResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminEnableUserResponse' {Int
httpStatus :: Int
$sel:httpStatus:AdminEnableUserResponse' :: AdminEnableUserResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AdminEnableUserResponse
s@AdminEnableUserResponse' {} Int
a -> AdminEnableUserResponse
s {$sel:httpStatus:AdminEnableUserResponse' :: Int
httpStatus = Int
a} :: AdminEnableUserResponse)
instance Prelude.NFData AdminEnableUserResponse