{-# 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.CreateAccountAlias
(
CreateAccountAlias (..),
newCreateAccountAlias,
createAccountAlias_accountAlias,
CreateAccountAliasResponse (..),
newCreateAccountAliasResponse,
)
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 CreateAccountAlias = CreateAccountAlias'
{
CreateAccountAlias -> Text
accountAlias :: Prelude.Text
}
deriving (CreateAccountAlias -> CreateAccountAlias -> Bool
(CreateAccountAlias -> CreateAccountAlias -> Bool)
-> (CreateAccountAlias -> CreateAccountAlias -> Bool)
-> Eq CreateAccountAlias
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAccountAlias -> CreateAccountAlias -> Bool
$c/= :: CreateAccountAlias -> CreateAccountAlias -> Bool
== :: CreateAccountAlias -> CreateAccountAlias -> Bool
$c== :: CreateAccountAlias -> CreateAccountAlias -> Bool
Prelude.Eq, ReadPrec [CreateAccountAlias]
ReadPrec CreateAccountAlias
Int -> ReadS CreateAccountAlias
ReadS [CreateAccountAlias]
(Int -> ReadS CreateAccountAlias)
-> ReadS [CreateAccountAlias]
-> ReadPrec CreateAccountAlias
-> ReadPrec [CreateAccountAlias]
-> Read CreateAccountAlias
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAccountAlias]
$creadListPrec :: ReadPrec [CreateAccountAlias]
readPrec :: ReadPrec CreateAccountAlias
$creadPrec :: ReadPrec CreateAccountAlias
readList :: ReadS [CreateAccountAlias]
$creadList :: ReadS [CreateAccountAlias]
readsPrec :: Int -> ReadS CreateAccountAlias
$creadsPrec :: Int -> ReadS CreateAccountAlias
Prelude.Read, Int -> CreateAccountAlias -> ShowS
[CreateAccountAlias] -> ShowS
CreateAccountAlias -> String
(Int -> CreateAccountAlias -> ShowS)
-> (CreateAccountAlias -> String)
-> ([CreateAccountAlias] -> ShowS)
-> Show CreateAccountAlias
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAccountAlias] -> ShowS
$cshowList :: [CreateAccountAlias] -> ShowS
show :: CreateAccountAlias -> String
$cshow :: CreateAccountAlias -> String
showsPrec :: Int -> CreateAccountAlias -> ShowS
$cshowsPrec :: Int -> CreateAccountAlias -> ShowS
Prelude.Show, (forall x. CreateAccountAlias -> Rep CreateAccountAlias x)
-> (forall x. Rep CreateAccountAlias x -> CreateAccountAlias)
-> Generic CreateAccountAlias
forall x. Rep CreateAccountAlias x -> CreateAccountAlias
forall x. CreateAccountAlias -> Rep CreateAccountAlias x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAccountAlias x -> CreateAccountAlias
$cfrom :: forall x. CreateAccountAlias -> Rep CreateAccountAlias x
Prelude.Generic)
newCreateAccountAlias ::
Prelude.Text ->
CreateAccountAlias
newCreateAccountAlias :: Text -> CreateAccountAlias
newCreateAccountAlias Text
pAccountAlias_ =
CreateAccountAlias' :: Text -> CreateAccountAlias
CreateAccountAlias' {$sel:accountAlias:CreateAccountAlias' :: Text
accountAlias = Text
pAccountAlias_}
createAccountAlias_accountAlias :: Lens.Lens' CreateAccountAlias Prelude.Text
createAccountAlias_accountAlias :: (Text -> f Text) -> CreateAccountAlias -> f CreateAccountAlias
createAccountAlias_accountAlias = (CreateAccountAlias -> Text)
-> (CreateAccountAlias -> Text -> CreateAccountAlias)
-> Lens CreateAccountAlias CreateAccountAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountAlias' {Text
accountAlias :: Text
$sel:accountAlias:CreateAccountAlias' :: CreateAccountAlias -> Text
accountAlias} -> Text
accountAlias) (\s :: CreateAccountAlias
s@CreateAccountAlias' {} Text
a -> CreateAccountAlias
s {$sel:accountAlias:CreateAccountAlias' :: Text
accountAlias = Text
a} :: CreateAccountAlias)
instance Core.AWSRequest CreateAccountAlias where
type
AWSResponse CreateAccountAlias =
CreateAccountAliasResponse
request :: CreateAccountAlias -> Request CreateAccountAlias
request = Service -> CreateAccountAlias -> Request CreateAccountAlias
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy CreateAccountAlias
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateAccountAlias)))
response =
AWSResponse CreateAccountAlias
-> Logger
-> Service
-> Proxy CreateAccountAlias
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateAccountAlias)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse CreateAccountAlias
CreateAccountAliasResponse
CreateAccountAliasResponse'
instance Prelude.Hashable CreateAccountAlias
instance Prelude.NFData CreateAccountAlias
instance Core.ToHeaders CreateAccountAlias where
toHeaders :: CreateAccountAlias -> [Header]
toHeaders = [Header] -> CreateAccountAlias -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath CreateAccountAlias where
toPath :: CreateAccountAlias -> ByteString
toPath = ByteString -> CreateAccountAlias -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateAccountAlias where
toQuery :: CreateAccountAlias -> QueryString
toQuery CreateAccountAlias' {Text
accountAlias :: Text
$sel:accountAlias:CreateAccountAlias' :: CreateAccountAlias -> 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
"CreateAccountAlias" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"AccountAlias" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
accountAlias
]
data CreateAccountAliasResponse = CreateAccountAliasResponse'
{
}
deriving (CreateAccountAliasResponse -> CreateAccountAliasResponse -> Bool
(CreateAccountAliasResponse -> CreateAccountAliasResponse -> Bool)
-> (CreateAccountAliasResponse
-> CreateAccountAliasResponse -> Bool)
-> Eq CreateAccountAliasResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAccountAliasResponse -> CreateAccountAliasResponse -> Bool
$c/= :: CreateAccountAliasResponse -> CreateAccountAliasResponse -> Bool
== :: CreateAccountAliasResponse -> CreateAccountAliasResponse -> Bool
$c== :: CreateAccountAliasResponse -> CreateAccountAliasResponse -> Bool
Prelude.Eq, ReadPrec [CreateAccountAliasResponse]
ReadPrec CreateAccountAliasResponse
Int -> ReadS CreateAccountAliasResponse
ReadS [CreateAccountAliasResponse]
(Int -> ReadS CreateAccountAliasResponse)
-> ReadS [CreateAccountAliasResponse]
-> ReadPrec CreateAccountAliasResponse
-> ReadPrec [CreateAccountAliasResponse]
-> Read CreateAccountAliasResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAccountAliasResponse]
$creadListPrec :: ReadPrec [CreateAccountAliasResponse]
readPrec :: ReadPrec CreateAccountAliasResponse
$creadPrec :: ReadPrec CreateAccountAliasResponse
readList :: ReadS [CreateAccountAliasResponse]
$creadList :: ReadS [CreateAccountAliasResponse]
readsPrec :: Int -> ReadS CreateAccountAliasResponse
$creadsPrec :: Int -> ReadS CreateAccountAliasResponse
Prelude.Read, Int -> CreateAccountAliasResponse -> ShowS
[CreateAccountAliasResponse] -> ShowS
CreateAccountAliasResponse -> String
(Int -> CreateAccountAliasResponse -> ShowS)
-> (CreateAccountAliasResponse -> String)
-> ([CreateAccountAliasResponse] -> ShowS)
-> Show CreateAccountAliasResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAccountAliasResponse] -> ShowS
$cshowList :: [CreateAccountAliasResponse] -> ShowS
show :: CreateAccountAliasResponse -> String
$cshow :: CreateAccountAliasResponse -> String
showsPrec :: Int -> CreateAccountAliasResponse -> ShowS
$cshowsPrec :: Int -> CreateAccountAliasResponse -> ShowS
Prelude.Show, (forall x.
CreateAccountAliasResponse -> Rep CreateAccountAliasResponse x)
-> (forall x.
Rep CreateAccountAliasResponse x -> CreateAccountAliasResponse)
-> Generic CreateAccountAliasResponse
forall x.
Rep CreateAccountAliasResponse x -> CreateAccountAliasResponse
forall x.
CreateAccountAliasResponse -> Rep CreateAccountAliasResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAccountAliasResponse x -> CreateAccountAliasResponse
$cfrom :: forall x.
CreateAccountAliasResponse -> Rep CreateAccountAliasResponse x
Prelude.Generic)
newCreateAccountAliasResponse ::
CreateAccountAliasResponse
newCreateAccountAliasResponse :: CreateAccountAliasResponse
newCreateAccountAliasResponse =
CreateAccountAliasResponse
CreateAccountAliasResponse'
instance Prelude.NFData CreateAccountAliasResponse