{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types
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
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]
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
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. 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' {$sel:accountAlias:CreateAccountAlias' :: Text
accountAlias = Text
pAccountAlias_}
createAccountAlias_accountAlias :: Lens.Lens' CreateAccountAlias Prelude.Text
createAccountAlias_accountAlias :: Lens' CreateAccountAlias Text
createAccountAlias_accountAlias = 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 :: (Service -> Service)
-> CreateAccountAlias -> Request CreateAccountAlias
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateAccountAlias
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateAccountAlias)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull CreateAccountAliasResponse
CreateAccountAliasResponse'
instance Prelude.Hashable CreateAccountAlias where
hashWithSalt :: Int -> CreateAccountAlias -> Int
hashWithSalt Int
_salt CreateAccountAlias' {Text
accountAlias :: Text
$sel:accountAlias:CreateAccountAlias' :: CreateAccountAlias -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
accountAlias
instance Prelude.NFData CreateAccountAlias where
rnf :: CreateAccountAlias -> ()
rnf CreateAccountAlias' {Text
accountAlias :: Text
$sel:accountAlias:CreateAccountAlias' :: CreateAccountAlias -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
accountAlias
instance Data.ToHeaders CreateAccountAlias where
toHeaders :: CreateAccountAlias -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath CreateAccountAlias where
toPath :: CreateAccountAlias -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateAccountAlias where
toQuery :: CreateAccountAlias -> QueryString
toQuery CreateAccountAlias' {Text
accountAlias :: Text
$sel:accountAlias:CreateAccountAlias' :: CreateAccountAlias -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateAccountAlias" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"AccountAlias" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
accountAlias
]
data CreateAccountAliasResponse = CreateAccountAliasResponse'
{
}
deriving (CreateAccountAliasResponse -> CreateAccountAliasResponse -> Bool
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]
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
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.
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 where
rnf :: CreateAccountAliasResponse -> ()
rnf CreateAccountAliasResponse
_ = ()