{-# 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.CreateServiceSpecificCredential
(
CreateServiceSpecificCredential (..),
newCreateServiceSpecificCredential,
createServiceSpecificCredential_userName,
createServiceSpecificCredential_serviceName,
CreateServiceSpecificCredentialResponse (..),
newCreateServiceSpecificCredentialResponse,
createServiceSpecificCredentialResponse_serviceSpecificCredential,
createServiceSpecificCredentialResponse_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 CreateServiceSpecificCredential = CreateServiceSpecificCredential'
{
CreateServiceSpecificCredential -> Text
userName :: Prelude.Text,
CreateServiceSpecificCredential -> Text
serviceName :: Prelude.Text
}
deriving (CreateServiceSpecificCredential
-> CreateServiceSpecificCredential -> Bool
(CreateServiceSpecificCredential
-> CreateServiceSpecificCredential -> Bool)
-> (CreateServiceSpecificCredential
-> CreateServiceSpecificCredential -> Bool)
-> Eq CreateServiceSpecificCredential
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateServiceSpecificCredential
-> CreateServiceSpecificCredential -> Bool
$c/= :: CreateServiceSpecificCredential
-> CreateServiceSpecificCredential -> Bool
== :: CreateServiceSpecificCredential
-> CreateServiceSpecificCredential -> Bool
$c== :: CreateServiceSpecificCredential
-> CreateServiceSpecificCredential -> Bool
Prelude.Eq, ReadPrec [CreateServiceSpecificCredential]
ReadPrec CreateServiceSpecificCredential
Int -> ReadS CreateServiceSpecificCredential
ReadS [CreateServiceSpecificCredential]
(Int -> ReadS CreateServiceSpecificCredential)
-> ReadS [CreateServiceSpecificCredential]
-> ReadPrec CreateServiceSpecificCredential
-> ReadPrec [CreateServiceSpecificCredential]
-> Read CreateServiceSpecificCredential
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateServiceSpecificCredential]
$creadListPrec :: ReadPrec [CreateServiceSpecificCredential]
readPrec :: ReadPrec CreateServiceSpecificCredential
$creadPrec :: ReadPrec CreateServiceSpecificCredential
readList :: ReadS [CreateServiceSpecificCredential]
$creadList :: ReadS [CreateServiceSpecificCredential]
readsPrec :: Int -> ReadS CreateServiceSpecificCredential
$creadsPrec :: Int -> ReadS CreateServiceSpecificCredential
Prelude.Read, Int -> CreateServiceSpecificCredential -> ShowS
[CreateServiceSpecificCredential] -> ShowS
CreateServiceSpecificCredential -> String
(Int -> CreateServiceSpecificCredential -> ShowS)
-> (CreateServiceSpecificCredential -> String)
-> ([CreateServiceSpecificCredential] -> ShowS)
-> Show CreateServiceSpecificCredential
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateServiceSpecificCredential] -> ShowS
$cshowList :: [CreateServiceSpecificCredential] -> ShowS
show :: CreateServiceSpecificCredential -> String
$cshow :: CreateServiceSpecificCredential -> String
showsPrec :: Int -> CreateServiceSpecificCredential -> ShowS
$cshowsPrec :: Int -> CreateServiceSpecificCredential -> ShowS
Prelude.Show, (forall x.
CreateServiceSpecificCredential
-> Rep CreateServiceSpecificCredential x)
-> (forall x.
Rep CreateServiceSpecificCredential x
-> CreateServiceSpecificCredential)
-> Generic CreateServiceSpecificCredential
forall x.
Rep CreateServiceSpecificCredential x
-> CreateServiceSpecificCredential
forall x.
CreateServiceSpecificCredential
-> Rep CreateServiceSpecificCredential x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateServiceSpecificCredential x
-> CreateServiceSpecificCredential
$cfrom :: forall x.
CreateServiceSpecificCredential
-> Rep CreateServiceSpecificCredential x
Prelude.Generic)
newCreateServiceSpecificCredential ::
Prelude.Text ->
Prelude.Text ->
CreateServiceSpecificCredential
newCreateServiceSpecificCredential :: Text -> Text -> CreateServiceSpecificCredential
newCreateServiceSpecificCredential
Text
pUserName_
Text
pServiceName_ =
CreateServiceSpecificCredential' :: Text -> Text -> CreateServiceSpecificCredential
CreateServiceSpecificCredential'
{ $sel:userName:CreateServiceSpecificCredential' :: Text
userName =
Text
pUserName_,
$sel:serviceName:CreateServiceSpecificCredential' :: Text
serviceName = Text
pServiceName_
}
createServiceSpecificCredential_userName :: Lens.Lens' CreateServiceSpecificCredential Prelude.Text
createServiceSpecificCredential_userName :: (Text -> f Text)
-> CreateServiceSpecificCredential
-> f CreateServiceSpecificCredential
createServiceSpecificCredential_userName = (CreateServiceSpecificCredential -> Text)
-> (CreateServiceSpecificCredential
-> Text -> CreateServiceSpecificCredential)
-> Lens
CreateServiceSpecificCredential
CreateServiceSpecificCredential
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServiceSpecificCredential' {Text
userName :: Text
$sel:userName:CreateServiceSpecificCredential' :: CreateServiceSpecificCredential -> Text
userName} -> Text
userName) (\s :: CreateServiceSpecificCredential
s@CreateServiceSpecificCredential' {} Text
a -> CreateServiceSpecificCredential
s {$sel:userName:CreateServiceSpecificCredential' :: Text
userName = Text
a} :: CreateServiceSpecificCredential)
createServiceSpecificCredential_serviceName :: Lens.Lens' CreateServiceSpecificCredential Prelude.Text
createServiceSpecificCredential_serviceName :: (Text -> f Text)
-> CreateServiceSpecificCredential
-> f CreateServiceSpecificCredential
createServiceSpecificCredential_serviceName = (CreateServiceSpecificCredential -> Text)
-> (CreateServiceSpecificCredential
-> Text -> CreateServiceSpecificCredential)
-> Lens
CreateServiceSpecificCredential
CreateServiceSpecificCredential
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServiceSpecificCredential' {Text
serviceName :: Text
$sel:serviceName:CreateServiceSpecificCredential' :: CreateServiceSpecificCredential -> Text
serviceName} -> Text
serviceName) (\s :: CreateServiceSpecificCredential
s@CreateServiceSpecificCredential' {} Text
a -> CreateServiceSpecificCredential
s {$sel:serviceName:CreateServiceSpecificCredential' :: Text
serviceName = Text
a} :: CreateServiceSpecificCredential)
instance
Core.AWSRequest
CreateServiceSpecificCredential
where
type
AWSResponse CreateServiceSpecificCredential =
CreateServiceSpecificCredentialResponse
request :: CreateServiceSpecificCredential
-> Request CreateServiceSpecificCredential
request = Service
-> CreateServiceSpecificCredential
-> Request CreateServiceSpecificCredential
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CreateServiceSpecificCredential
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CreateServiceSpecificCredential)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse CreateServiceSpecificCredential))
-> Logger
-> Service
-> Proxy CreateServiceSpecificCredential
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse CreateServiceSpecificCredential)))
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
"CreateServiceSpecificCredentialResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe ServiceSpecificCredential
-> Int -> CreateServiceSpecificCredentialResponse
CreateServiceSpecificCredentialResponse'
(Maybe ServiceSpecificCredential
-> Int -> CreateServiceSpecificCredentialResponse)
-> Either String (Maybe ServiceSpecificCredential)
-> Either String (Int -> CreateServiceSpecificCredentialResponse)
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 -> CreateServiceSpecificCredentialResponse)
-> Either String Int
-> Either String CreateServiceSpecificCredentialResponse
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
CreateServiceSpecificCredential
instance
Prelude.NFData
CreateServiceSpecificCredential
instance
Core.ToHeaders
CreateServiceSpecificCredential
where
toHeaders :: CreateServiceSpecificCredential -> ResponseHeaders
toHeaders = ResponseHeaders
-> CreateServiceSpecificCredential -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CreateServiceSpecificCredential where
toPath :: CreateServiceSpecificCredential -> ByteString
toPath = ByteString -> CreateServiceSpecificCredential -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateServiceSpecificCredential where
toQuery :: CreateServiceSpecificCredential -> QueryString
toQuery CreateServiceSpecificCredential' {Text
serviceName :: Text
userName :: Text
$sel:serviceName:CreateServiceSpecificCredential' :: CreateServiceSpecificCredential -> Text
$sel:userName:CreateServiceSpecificCredential' :: CreateServiceSpecificCredential -> 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
"CreateServiceSpecificCredential" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"UserName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
userName,
ByteString
"ServiceName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
serviceName
]
data CreateServiceSpecificCredentialResponse = CreateServiceSpecificCredentialResponse'
{
CreateServiceSpecificCredentialResponse
-> Maybe ServiceSpecificCredential
serviceSpecificCredential :: Prelude.Maybe ServiceSpecificCredential,
CreateServiceSpecificCredentialResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateServiceSpecificCredentialResponse
-> CreateServiceSpecificCredentialResponse -> Bool
(CreateServiceSpecificCredentialResponse
-> CreateServiceSpecificCredentialResponse -> Bool)
-> (CreateServiceSpecificCredentialResponse
-> CreateServiceSpecificCredentialResponse -> Bool)
-> Eq CreateServiceSpecificCredentialResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateServiceSpecificCredentialResponse
-> CreateServiceSpecificCredentialResponse -> Bool
$c/= :: CreateServiceSpecificCredentialResponse
-> CreateServiceSpecificCredentialResponse -> Bool
== :: CreateServiceSpecificCredentialResponse
-> CreateServiceSpecificCredentialResponse -> Bool
$c== :: CreateServiceSpecificCredentialResponse
-> CreateServiceSpecificCredentialResponse -> Bool
Prelude.Eq, Int -> CreateServiceSpecificCredentialResponse -> ShowS
[CreateServiceSpecificCredentialResponse] -> ShowS
CreateServiceSpecificCredentialResponse -> String
(Int -> CreateServiceSpecificCredentialResponse -> ShowS)
-> (CreateServiceSpecificCredentialResponse -> String)
-> ([CreateServiceSpecificCredentialResponse] -> ShowS)
-> Show CreateServiceSpecificCredentialResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateServiceSpecificCredentialResponse] -> ShowS
$cshowList :: [CreateServiceSpecificCredentialResponse] -> ShowS
show :: CreateServiceSpecificCredentialResponse -> String
$cshow :: CreateServiceSpecificCredentialResponse -> String
showsPrec :: Int -> CreateServiceSpecificCredentialResponse -> ShowS
$cshowsPrec :: Int -> CreateServiceSpecificCredentialResponse -> ShowS
Prelude.Show, (forall x.
CreateServiceSpecificCredentialResponse
-> Rep CreateServiceSpecificCredentialResponse x)
-> (forall x.
Rep CreateServiceSpecificCredentialResponse x
-> CreateServiceSpecificCredentialResponse)
-> Generic CreateServiceSpecificCredentialResponse
forall x.
Rep CreateServiceSpecificCredentialResponse x
-> CreateServiceSpecificCredentialResponse
forall x.
CreateServiceSpecificCredentialResponse
-> Rep CreateServiceSpecificCredentialResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateServiceSpecificCredentialResponse x
-> CreateServiceSpecificCredentialResponse
$cfrom :: forall x.
CreateServiceSpecificCredentialResponse
-> Rep CreateServiceSpecificCredentialResponse x
Prelude.Generic)
newCreateServiceSpecificCredentialResponse ::
Prelude.Int ->
CreateServiceSpecificCredentialResponse
newCreateServiceSpecificCredentialResponse :: Int -> CreateServiceSpecificCredentialResponse
newCreateServiceSpecificCredentialResponse
Int
pHttpStatus_ =
CreateServiceSpecificCredentialResponse' :: Maybe ServiceSpecificCredential
-> Int -> CreateServiceSpecificCredentialResponse
CreateServiceSpecificCredentialResponse'
{ $sel:serviceSpecificCredential:CreateServiceSpecificCredentialResponse' :: Maybe ServiceSpecificCredential
serviceSpecificCredential =
Maybe ServiceSpecificCredential
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateServiceSpecificCredentialResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createServiceSpecificCredentialResponse_serviceSpecificCredential :: Lens.Lens' CreateServiceSpecificCredentialResponse (Prelude.Maybe ServiceSpecificCredential)
createServiceSpecificCredentialResponse_serviceSpecificCredential :: (Maybe ServiceSpecificCredential
-> f (Maybe ServiceSpecificCredential))
-> CreateServiceSpecificCredentialResponse
-> f CreateServiceSpecificCredentialResponse
createServiceSpecificCredentialResponse_serviceSpecificCredential = (CreateServiceSpecificCredentialResponse
-> Maybe ServiceSpecificCredential)
-> (CreateServiceSpecificCredentialResponse
-> Maybe ServiceSpecificCredential
-> CreateServiceSpecificCredentialResponse)
-> Lens
CreateServiceSpecificCredentialResponse
CreateServiceSpecificCredentialResponse
(Maybe ServiceSpecificCredential)
(Maybe ServiceSpecificCredential)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServiceSpecificCredentialResponse' {Maybe ServiceSpecificCredential
serviceSpecificCredential :: Maybe ServiceSpecificCredential
$sel:serviceSpecificCredential:CreateServiceSpecificCredentialResponse' :: CreateServiceSpecificCredentialResponse
-> Maybe ServiceSpecificCredential
serviceSpecificCredential} -> Maybe ServiceSpecificCredential
serviceSpecificCredential) (\s :: CreateServiceSpecificCredentialResponse
s@CreateServiceSpecificCredentialResponse' {} Maybe ServiceSpecificCredential
a -> CreateServiceSpecificCredentialResponse
s {$sel:serviceSpecificCredential:CreateServiceSpecificCredentialResponse' :: Maybe ServiceSpecificCredential
serviceSpecificCredential = Maybe ServiceSpecificCredential
a} :: CreateServiceSpecificCredentialResponse)
createServiceSpecificCredentialResponse_httpStatus :: Lens.Lens' CreateServiceSpecificCredentialResponse Prelude.Int
createServiceSpecificCredentialResponse_httpStatus :: (Int -> f Int)
-> CreateServiceSpecificCredentialResponse
-> f CreateServiceSpecificCredentialResponse
createServiceSpecificCredentialResponse_httpStatus = (CreateServiceSpecificCredentialResponse -> Int)
-> (CreateServiceSpecificCredentialResponse
-> Int -> CreateServiceSpecificCredentialResponse)
-> Lens
CreateServiceSpecificCredentialResponse
CreateServiceSpecificCredentialResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServiceSpecificCredentialResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateServiceSpecificCredentialResponse' :: CreateServiceSpecificCredentialResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateServiceSpecificCredentialResponse
s@CreateServiceSpecificCredentialResponse' {} Int
a -> CreateServiceSpecificCredentialResponse
s {$sel:httpStatus:CreateServiceSpecificCredentialResponse' :: Int
httpStatus = Int
a} :: CreateServiceSpecificCredentialResponse)
instance
Prelude.NFData
CreateServiceSpecificCredentialResponse