{-# 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.AddRoleToInstanceProfile
(
AddRoleToInstanceProfile (..),
newAddRoleToInstanceProfile,
addRoleToInstanceProfile_instanceProfileName,
addRoleToInstanceProfile_roleName,
AddRoleToInstanceProfileResponse (..),
newAddRoleToInstanceProfileResponse,
)
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 AddRoleToInstanceProfile = AddRoleToInstanceProfile'
{
AddRoleToInstanceProfile -> Text
instanceProfileName :: Prelude.Text,
AddRoleToInstanceProfile -> Text
roleName :: Prelude.Text
}
deriving (AddRoleToInstanceProfile -> AddRoleToInstanceProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddRoleToInstanceProfile -> AddRoleToInstanceProfile -> Bool
$c/= :: AddRoleToInstanceProfile -> AddRoleToInstanceProfile -> Bool
== :: AddRoleToInstanceProfile -> AddRoleToInstanceProfile -> Bool
$c== :: AddRoleToInstanceProfile -> AddRoleToInstanceProfile -> Bool
Prelude.Eq, ReadPrec [AddRoleToInstanceProfile]
ReadPrec AddRoleToInstanceProfile
Int -> ReadS AddRoleToInstanceProfile
ReadS [AddRoleToInstanceProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddRoleToInstanceProfile]
$creadListPrec :: ReadPrec [AddRoleToInstanceProfile]
readPrec :: ReadPrec AddRoleToInstanceProfile
$creadPrec :: ReadPrec AddRoleToInstanceProfile
readList :: ReadS [AddRoleToInstanceProfile]
$creadList :: ReadS [AddRoleToInstanceProfile]
readsPrec :: Int -> ReadS AddRoleToInstanceProfile
$creadsPrec :: Int -> ReadS AddRoleToInstanceProfile
Prelude.Read, Int -> AddRoleToInstanceProfile -> ShowS
[AddRoleToInstanceProfile] -> ShowS
AddRoleToInstanceProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddRoleToInstanceProfile] -> ShowS
$cshowList :: [AddRoleToInstanceProfile] -> ShowS
show :: AddRoleToInstanceProfile -> String
$cshow :: AddRoleToInstanceProfile -> String
showsPrec :: Int -> AddRoleToInstanceProfile -> ShowS
$cshowsPrec :: Int -> AddRoleToInstanceProfile -> ShowS
Prelude.Show, forall x.
Rep AddRoleToInstanceProfile x -> AddRoleToInstanceProfile
forall x.
AddRoleToInstanceProfile -> Rep AddRoleToInstanceProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddRoleToInstanceProfile x -> AddRoleToInstanceProfile
$cfrom :: forall x.
AddRoleToInstanceProfile -> Rep AddRoleToInstanceProfile x
Prelude.Generic)
newAddRoleToInstanceProfile ::
Prelude.Text ->
Prelude.Text ->
AddRoleToInstanceProfile
newAddRoleToInstanceProfile :: Text -> Text -> AddRoleToInstanceProfile
newAddRoleToInstanceProfile
Text
pInstanceProfileName_
Text
pRoleName_ =
AddRoleToInstanceProfile'
{ $sel:instanceProfileName:AddRoleToInstanceProfile' :: Text
instanceProfileName =
Text
pInstanceProfileName_,
$sel:roleName:AddRoleToInstanceProfile' :: Text
roleName = Text
pRoleName_
}
addRoleToInstanceProfile_instanceProfileName :: Lens.Lens' AddRoleToInstanceProfile Prelude.Text
addRoleToInstanceProfile_instanceProfileName :: Lens' AddRoleToInstanceProfile Text
addRoleToInstanceProfile_instanceProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddRoleToInstanceProfile' {Text
instanceProfileName :: Text
$sel:instanceProfileName:AddRoleToInstanceProfile' :: AddRoleToInstanceProfile -> Text
instanceProfileName} -> Text
instanceProfileName) (\s :: AddRoleToInstanceProfile
s@AddRoleToInstanceProfile' {} Text
a -> AddRoleToInstanceProfile
s {$sel:instanceProfileName:AddRoleToInstanceProfile' :: Text
instanceProfileName = Text
a} :: AddRoleToInstanceProfile)
addRoleToInstanceProfile_roleName :: Lens.Lens' AddRoleToInstanceProfile Prelude.Text
addRoleToInstanceProfile_roleName :: Lens' AddRoleToInstanceProfile Text
addRoleToInstanceProfile_roleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddRoleToInstanceProfile' {Text
roleName :: Text
$sel:roleName:AddRoleToInstanceProfile' :: AddRoleToInstanceProfile -> Text
roleName} -> Text
roleName) (\s :: AddRoleToInstanceProfile
s@AddRoleToInstanceProfile' {} Text
a -> AddRoleToInstanceProfile
s {$sel:roleName:AddRoleToInstanceProfile' :: Text
roleName = Text
a} :: AddRoleToInstanceProfile)
instance Core.AWSRequest AddRoleToInstanceProfile where
type
AWSResponse AddRoleToInstanceProfile =
AddRoleToInstanceProfileResponse
request :: (Service -> Service)
-> AddRoleToInstanceProfile -> Request AddRoleToInstanceProfile
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 AddRoleToInstanceProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AddRoleToInstanceProfile)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AddRoleToInstanceProfileResponse
AddRoleToInstanceProfileResponse'
instance Prelude.Hashable AddRoleToInstanceProfile where
hashWithSalt :: Int -> AddRoleToInstanceProfile -> Int
hashWithSalt Int
_salt AddRoleToInstanceProfile' {Text
roleName :: Text
instanceProfileName :: Text
$sel:roleName:AddRoleToInstanceProfile' :: AddRoleToInstanceProfile -> Text
$sel:instanceProfileName:AddRoleToInstanceProfile' :: AddRoleToInstanceProfile -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceProfileName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleName
instance Prelude.NFData AddRoleToInstanceProfile where
rnf :: AddRoleToInstanceProfile -> ()
rnf AddRoleToInstanceProfile' {Text
roleName :: Text
instanceProfileName :: Text
$sel:roleName:AddRoleToInstanceProfile' :: AddRoleToInstanceProfile -> Text
$sel:instanceProfileName:AddRoleToInstanceProfile' :: AddRoleToInstanceProfile -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
instanceProfileName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleName
instance Data.ToHeaders AddRoleToInstanceProfile where
toHeaders :: AddRoleToInstanceProfile -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath AddRoleToInstanceProfile where
toPath :: AddRoleToInstanceProfile -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery AddRoleToInstanceProfile where
toQuery :: AddRoleToInstanceProfile -> QueryString
toQuery AddRoleToInstanceProfile' {Text
roleName :: Text
instanceProfileName :: Text
$sel:roleName:AddRoleToInstanceProfile' :: AddRoleToInstanceProfile -> Text
$sel:instanceProfileName:AddRoleToInstanceProfile' :: AddRoleToInstanceProfile -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"AddRoleToInstanceProfile" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"InstanceProfileName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
instanceProfileName,
ByteString
"RoleName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
roleName
]
data AddRoleToInstanceProfileResponse = AddRoleToInstanceProfileResponse'
{
}
deriving (AddRoleToInstanceProfileResponse
-> AddRoleToInstanceProfileResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddRoleToInstanceProfileResponse
-> AddRoleToInstanceProfileResponse -> Bool
$c/= :: AddRoleToInstanceProfileResponse
-> AddRoleToInstanceProfileResponse -> Bool
== :: AddRoleToInstanceProfileResponse
-> AddRoleToInstanceProfileResponse -> Bool
$c== :: AddRoleToInstanceProfileResponse
-> AddRoleToInstanceProfileResponse -> Bool
Prelude.Eq, ReadPrec [AddRoleToInstanceProfileResponse]
ReadPrec AddRoleToInstanceProfileResponse
Int -> ReadS AddRoleToInstanceProfileResponse
ReadS [AddRoleToInstanceProfileResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddRoleToInstanceProfileResponse]
$creadListPrec :: ReadPrec [AddRoleToInstanceProfileResponse]
readPrec :: ReadPrec AddRoleToInstanceProfileResponse
$creadPrec :: ReadPrec AddRoleToInstanceProfileResponse
readList :: ReadS [AddRoleToInstanceProfileResponse]
$creadList :: ReadS [AddRoleToInstanceProfileResponse]
readsPrec :: Int -> ReadS AddRoleToInstanceProfileResponse
$creadsPrec :: Int -> ReadS AddRoleToInstanceProfileResponse
Prelude.Read, Int -> AddRoleToInstanceProfileResponse -> ShowS
[AddRoleToInstanceProfileResponse] -> ShowS
AddRoleToInstanceProfileResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddRoleToInstanceProfileResponse] -> ShowS
$cshowList :: [AddRoleToInstanceProfileResponse] -> ShowS
show :: AddRoleToInstanceProfileResponse -> String
$cshow :: AddRoleToInstanceProfileResponse -> String
showsPrec :: Int -> AddRoleToInstanceProfileResponse -> ShowS
$cshowsPrec :: Int -> AddRoleToInstanceProfileResponse -> ShowS
Prelude.Show, forall x.
Rep AddRoleToInstanceProfileResponse x
-> AddRoleToInstanceProfileResponse
forall x.
AddRoleToInstanceProfileResponse
-> Rep AddRoleToInstanceProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AddRoleToInstanceProfileResponse x
-> AddRoleToInstanceProfileResponse
$cfrom :: forall x.
AddRoleToInstanceProfileResponse
-> Rep AddRoleToInstanceProfileResponse x
Prelude.Generic)
newAddRoleToInstanceProfileResponse ::
AddRoleToInstanceProfileResponse
newAddRoleToInstanceProfileResponse :: AddRoleToInstanceProfileResponse
newAddRoleToInstanceProfileResponse =
AddRoleToInstanceProfileResponse
AddRoleToInstanceProfileResponse'
instance
Prelude.NFData
AddRoleToInstanceProfileResponse
where
rnf :: AddRoleToInstanceProfileResponse -> ()
rnf AddRoleToInstanceProfileResponse
_ = ()