{-# 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.IAM.ResetServiceSpecificCredential
(
ResetServiceSpecificCredential (..),
newResetServiceSpecificCredential,
resetServiceSpecificCredential_userName,
resetServiceSpecificCredential_serviceSpecificCredentialId,
ResetServiceSpecificCredentialResponse (..),
newResetServiceSpecificCredentialResponse,
resetServiceSpecificCredentialResponse_serviceSpecificCredential,
resetServiceSpecificCredentialResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types
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 ResetServiceSpecificCredential = ResetServiceSpecificCredential'
{
ResetServiceSpecificCredential -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
ResetServiceSpecificCredential -> Text
serviceSpecificCredentialId :: Prelude.Text
}
deriving (ResetServiceSpecificCredential
-> ResetServiceSpecificCredential -> Bool
(ResetServiceSpecificCredential
-> ResetServiceSpecificCredential -> Bool)
-> (ResetServiceSpecificCredential
-> ResetServiceSpecificCredential -> Bool)
-> Eq ResetServiceSpecificCredential
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResetServiceSpecificCredential
-> ResetServiceSpecificCredential -> Bool
$c/= :: ResetServiceSpecificCredential
-> ResetServiceSpecificCredential -> Bool
== :: ResetServiceSpecificCredential
-> ResetServiceSpecificCredential -> Bool
$c== :: ResetServiceSpecificCredential
-> ResetServiceSpecificCredential -> Bool
Prelude.Eq, ReadPrec [ResetServiceSpecificCredential]
ReadPrec ResetServiceSpecificCredential
Int -> ReadS ResetServiceSpecificCredential
ReadS [ResetServiceSpecificCredential]
(Int -> ReadS ResetServiceSpecificCredential)
-> ReadS [ResetServiceSpecificCredential]
-> ReadPrec ResetServiceSpecificCredential
-> ReadPrec [ResetServiceSpecificCredential]
-> Read ResetServiceSpecificCredential
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResetServiceSpecificCredential]
$creadListPrec :: ReadPrec [ResetServiceSpecificCredential]
readPrec :: ReadPrec ResetServiceSpecificCredential
$creadPrec :: ReadPrec ResetServiceSpecificCredential
readList :: ReadS [ResetServiceSpecificCredential]
$creadList :: ReadS [ResetServiceSpecificCredential]
readsPrec :: Int -> ReadS ResetServiceSpecificCredential
$creadsPrec :: Int -> ReadS ResetServiceSpecificCredential
Prelude.Read, Int -> ResetServiceSpecificCredential -> ShowS
[ResetServiceSpecificCredential] -> ShowS
ResetServiceSpecificCredential -> String
(Int -> ResetServiceSpecificCredential -> ShowS)
-> (ResetServiceSpecificCredential -> String)
-> ([ResetServiceSpecificCredential] -> ShowS)
-> Show ResetServiceSpecificCredential
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResetServiceSpecificCredential] -> ShowS
$cshowList :: [ResetServiceSpecificCredential] -> ShowS
show :: ResetServiceSpecificCredential -> String
$cshow :: ResetServiceSpecificCredential -> String
showsPrec :: Int -> ResetServiceSpecificCredential -> ShowS
$cshowsPrec :: Int -> ResetServiceSpecificCredential -> ShowS
Prelude.Show, (forall x.
ResetServiceSpecificCredential
-> Rep ResetServiceSpecificCredential x)
-> (forall x.
Rep ResetServiceSpecificCredential x
-> ResetServiceSpecificCredential)
-> Generic ResetServiceSpecificCredential
forall x.
Rep ResetServiceSpecificCredential x
-> ResetServiceSpecificCredential
forall x.
ResetServiceSpecificCredential
-> Rep ResetServiceSpecificCredential x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResetServiceSpecificCredential x
-> ResetServiceSpecificCredential
$cfrom :: forall x.
ResetServiceSpecificCredential
-> Rep ResetServiceSpecificCredential x
Prelude.Generic)
newResetServiceSpecificCredential ::
Prelude.Text ->
ResetServiceSpecificCredential
newResetServiceSpecificCredential :: Text -> ResetServiceSpecificCredential
newResetServiceSpecificCredential
Text
pServiceSpecificCredentialId_ =
ResetServiceSpecificCredential' :: Maybe Text -> Text -> ResetServiceSpecificCredential
ResetServiceSpecificCredential'
{ $sel:userName:ResetServiceSpecificCredential' :: Maybe Text
userName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:serviceSpecificCredentialId:ResetServiceSpecificCredential' :: Text
serviceSpecificCredentialId =
Text
pServiceSpecificCredentialId_
}
resetServiceSpecificCredential_userName :: Lens.Lens' ResetServiceSpecificCredential (Prelude.Maybe Prelude.Text)
resetServiceSpecificCredential_userName :: (Maybe Text -> f (Maybe Text))
-> ResetServiceSpecificCredential
-> f ResetServiceSpecificCredential
resetServiceSpecificCredential_userName = (ResetServiceSpecificCredential -> Maybe Text)
-> (ResetServiceSpecificCredential
-> Maybe Text -> ResetServiceSpecificCredential)
-> Lens
ResetServiceSpecificCredential
ResetServiceSpecificCredential
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetServiceSpecificCredential' {Maybe Text
userName :: Maybe Text
$sel:userName:ResetServiceSpecificCredential' :: ResetServiceSpecificCredential -> Maybe Text
userName} -> Maybe Text
userName) (\s :: ResetServiceSpecificCredential
s@ResetServiceSpecificCredential' {} Maybe Text
a -> ResetServiceSpecificCredential
s {$sel:userName:ResetServiceSpecificCredential' :: Maybe Text
userName = Maybe Text
a} :: ResetServiceSpecificCredential)
resetServiceSpecificCredential_serviceSpecificCredentialId :: Lens.Lens' ResetServiceSpecificCredential Prelude.Text
resetServiceSpecificCredential_serviceSpecificCredentialId :: (Text -> f Text)
-> ResetServiceSpecificCredential
-> f ResetServiceSpecificCredential
resetServiceSpecificCredential_serviceSpecificCredentialId = (ResetServiceSpecificCredential -> Text)
-> (ResetServiceSpecificCredential
-> Text -> ResetServiceSpecificCredential)
-> Lens
ResetServiceSpecificCredential
ResetServiceSpecificCredential
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetServiceSpecificCredential' {Text
serviceSpecificCredentialId :: Text
$sel:serviceSpecificCredentialId:ResetServiceSpecificCredential' :: ResetServiceSpecificCredential -> Text
serviceSpecificCredentialId} -> Text
serviceSpecificCredentialId) (\s :: ResetServiceSpecificCredential
s@ResetServiceSpecificCredential' {} Text
a -> ResetServiceSpecificCredential
s {$sel:serviceSpecificCredentialId:ResetServiceSpecificCredential' :: Text
serviceSpecificCredentialId = Text
a} :: ResetServiceSpecificCredential)
instance
Core.AWSRequest
ResetServiceSpecificCredential
where
type
AWSResponse ResetServiceSpecificCredential =
ResetServiceSpecificCredentialResponse
request :: ResetServiceSpecificCredential
-> Request ResetServiceSpecificCredential
request = Service
-> ResetServiceSpecificCredential
-> Request ResetServiceSpecificCredential
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ResetServiceSpecificCredential
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse ResetServiceSpecificCredential)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ResetServiceSpecificCredential))
-> Logger
-> Service
-> Proxy ResetServiceSpecificCredential
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse ResetServiceSpecificCredential)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ResetServiceSpecificCredentialResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe ServiceSpecificCredential
-> Int -> ResetServiceSpecificCredentialResponse
ResetServiceSpecificCredentialResponse'
(Maybe ServiceSpecificCredential
-> Int -> ResetServiceSpecificCredentialResponse)
-> Either String (Maybe ServiceSpecificCredential)
-> Either String (Int -> ResetServiceSpecificCredentialResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ServiceSpecificCredential)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ServiceSpecificCredential")
Either String (Int -> ResetServiceSpecificCredentialResponse)
-> Either String Int
-> Either String ResetServiceSpecificCredentialResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
ResetServiceSpecificCredential
instance
Prelude.NFData
ResetServiceSpecificCredential
instance
Core.ToHeaders
ResetServiceSpecificCredential
where
toHeaders :: ResetServiceSpecificCredential -> ResponseHeaders
toHeaders = ResponseHeaders
-> ResetServiceSpecificCredential -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ResetServiceSpecificCredential where
toPath :: ResetServiceSpecificCredential -> ByteString
toPath = ByteString -> ResetServiceSpecificCredential -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ResetServiceSpecificCredential where
toQuery :: ResetServiceSpecificCredential -> QueryString
toQuery ResetServiceSpecificCredential' {Maybe Text
Text
serviceSpecificCredentialId :: Text
userName :: Maybe Text
$sel:serviceSpecificCredentialId:ResetServiceSpecificCredential' :: ResetServiceSpecificCredential -> Text
$sel:userName:ResetServiceSpecificCredential' :: ResetServiceSpecificCredential -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"ResetServiceSpecificCredential" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"UserName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
userName,
ByteString
"ServiceSpecificCredentialId"
ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
serviceSpecificCredentialId
]
data ResetServiceSpecificCredentialResponse = ResetServiceSpecificCredentialResponse'
{
ResetServiceSpecificCredentialResponse
-> Maybe ServiceSpecificCredential
serviceSpecificCredential :: Prelude.Maybe ServiceSpecificCredential,
ResetServiceSpecificCredentialResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ResetServiceSpecificCredentialResponse
-> ResetServiceSpecificCredentialResponse -> Bool
(ResetServiceSpecificCredentialResponse
-> ResetServiceSpecificCredentialResponse -> Bool)
-> (ResetServiceSpecificCredentialResponse
-> ResetServiceSpecificCredentialResponse -> Bool)
-> Eq ResetServiceSpecificCredentialResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResetServiceSpecificCredentialResponse
-> ResetServiceSpecificCredentialResponse -> Bool
$c/= :: ResetServiceSpecificCredentialResponse
-> ResetServiceSpecificCredentialResponse -> Bool
== :: ResetServiceSpecificCredentialResponse
-> ResetServiceSpecificCredentialResponse -> Bool
$c== :: ResetServiceSpecificCredentialResponse
-> ResetServiceSpecificCredentialResponse -> Bool
Prelude.Eq, Int -> ResetServiceSpecificCredentialResponse -> ShowS
[ResetServiceSpecificCredentialResponse] -> ShowS
ResetServiceSpecificCredentialResponse -> String
(Int -> ResetServiceSpecificCredentialResponse -> ShowS)
-> (ResetServiceSpecificCredentialResponse -> String)
-> ([ResetServiceSpecificCredentialResponse] -> ShowS)
-> Show ResetServiceSpecificCredentialResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResetServiceSpecificCredentialResponse] -> ShowS
$cshowList :: [ResetServiceSpecificCredentialResponse] -> ShowS
show :: ResetServiceSpecificCredentialResponse -> String
$cshow :: ResetServiceSpecificCredentialResponse -> String
showsPrec :: Int -> ResetServiceSpecificCredentialResponse -> ShowS
$cshowsPrec :: Int -> ResetServiceSpecificCredentialResponse -> ShowS
Prelude.Show, (forall x.
ResetServiceSpecificCredentialResponse
-> Rep ResetServiceSpecificCredentialResponse x)
-> (forall x.
Rep ResetServiceSpecificCredentialResponse x
-> ResetServiceSpecificCredentialResponse)
-> Generic ResetServiceSpecificCredentialResponse
forall x.
Rep ResetServiceSpecificCredentialResponse x
-> ResetServiceSpecificCredentialResponse
forall x.
ResetServiceSpecificCredentialResponse
-> Rep ResetServiceSpecificCredentialResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResetServiceSpecificCredentialResponse x
-> ResetServiceSpecificCredentialResponse
$cfrom :: forall x.
ResetServiceSpecificCredentialResponse
-> Rep ResetServiceSpecificCredentialResponse x
Prelude.Generic)
newResetServiceSpecificCredentialResponse ::
Prelude.Int ->
ResetServiceSpecificCredentialResponse
newResetServiceSpecificCredentialResponse :: Int -> ResetServiceSpecificCredentialResponse
newResetServiceSpecificCredentialResponse
Int
pHttpStatus_ =
ResetServiceSpecificCredentialResponse' :: Maybe ServiceSpecificCredential
-> Int -> ResetServiceSpecificCredentialResponse
ResetServiceSpecificCredentialResponse'
{ $sel:serviceSpecificCredential:ResetServiceSpecificCredentialResponse' :: Maybe ServiceSpecificCredential
serviceSpecificCredential =
Maybe ServiceSpecificCredential
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ResetServiceSpecificCredentialResponse' :: Int
httpStatus = Int
pHttpStatus_
}
resetServiceSpecificCredentialResponse_serviceSpecificCredential :: Lens.Lens' ResetServiceSpecificCredentialResponse (Prelude.Maybe ServiceSpecificCredential)
resetServiceSpecificCredentialResponse_serviceSpecificCredential :: (Maybe ServiceSpecificCredential
-> f (Maybe ServiceSpecificCredential))
-> ResetServiceSpecificCredentialResponse
-> f ResetServiceSpecificCredentialResponse
resetServiceSpecificCredentialResponse_serviceSpecificCredential = (ResetServiceSpecificCredentialResponse
-> Maybe ServiceSpecificCredential)
-> (ResetServiceSpecificCredentialResponse
-> Maybe ServiceSpecificCredential
-> ResetServiceSpecificCredentialResponse)
-> Lens
ResetServiceSpecificCredentialResponse
ResetServiceSpecificCredentialResponse
(Maybe ServiceSpecificCredential)
(Maybe ServiceSpecificCredential)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetServiceSpecificCredentialResponse' {Maybe ServiceSpecificCredential
serviceSpecificCredential :: Maybe ServiceSpecificCredential
$sel:serviceSpecificCredential:ResetServiceSpecificCredentialResponse' :: ResetServiceSpecificCredentialResponse
-> Maybe ServiceSpecificCredential
serviceSpecificCredential} -> Maybe ServiceSpecificCredential
serviceSpecificCredential) (\s :: ResetServiceSpecificCredentialResponse
s@ResetServiceSpecificCredentialResponse' {} Maybe ServiceSpecificCredential
a -> ResetServiceSpecificCredentialResponse
s {$sel:serviceSpecificCredential:ResetServiceSpecificCredentialResponse' :: Maybe ServiceSpecificCredential
serviceSpecificCredential = Maybe ServiceSpecificCredential
a} :: ResetServiceSpecificCredentialResponse)
resetServiceSpecificCredentialResponse_httpStatus :: Lens.Lens' ResetServiceSpecificCredentialResponse Prelude.Int
resetServiceSpecificCredentialResponse_httpStatus :: (Int -> f Int)
-> ResetServiceSpecificCredentialResponse
-> f ResetServiceSpecificCredentialResponse
resetServiceSpecificCredentialResponse_httpStatus = (ResetServiceSpecificCredentialResponse -> Int)
-> (ResetServiceSpecificCredentialResponse
-> Int -> ResetServiceSpecificCredentialResponse)
-> Lens
ResetServiceSpecificCredentialResponse
ResetServiceSpecificCredentialResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetServiceSpecificCredentialResponse' {Int
httpStatus :: Int
$sel:httpStatus:ResetServiceSpecificCredentialResponse' :: ResetServiceSpecificCredentialResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ResetServiceSpecificCredentialResponse
s@ResetServiceSpecificCredentialResponse' {} Int
a -> ResetServiceSpecificCredentialResponse
s {$sel:httpStatus:ResetServiceSpecificCredentialResponse' :: Int
httpStatus = Int
a} :: ResetServiceSpecificCredentialResponse)
instance
Prelude.NFData
ResetServiceSpecificCredentialResponse