{-# 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 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 AddRoleToInstanceProfile = AddRoleToInstanceProfile'
{
AddRoleToInstanceProfile -> Text
instanceProfileName :: Prelude.Text,
AddRoleToInstanceProfile -> Text
roleName :: Prelude.Text
}
deriving (AddRoleToInstanceProfile -> AddRoleToInstanceProfile -> Bool
(AddRoleToInstanceProfile -> AddRoleToInstanceProfile -> Bool)
-> (AddRoleToInstanceProfile -> AddRoleToInstanceProfile -> Bool)
-> Eq AddRoleToInstanceProfile
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]
(Int -> ReadS AddRoleToInstanceProfile)
-> ReadS [AddRoleToInstanceProfile]
-> ReadPrec AddRoleToInstanceProfile
-> ReadPrec [AddRoleToInstanceProfile]
-> Read 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
(Int -> AddRoleToInstanceProfile -> ShowS)
-> (AddRoleToInstanceProfile -> String)
-> ([AddRoleToInstanceProfile] -> ShowS)
-> Show AddRoleToInstanceProfile
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.
AddRoleToInstanceProfile -> Rep AddRoleToInstanceProfile x)
-> (forall x.
Rep AddRoleToInstanceProfile x -> AddRoleToInstanceProfile)
-> Generic AddRoleToInstanceProfile
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' :: Text -> Text -> AddRoleToInstanceProfile
AddRoleToInstanceProfile'
{ $sel:instanceProfileName:AddRoleToInstanceProfile' :: Text
instanceProfileName =
Text
pInstanceProfileName_,
$sel:roleName:AddRoleToInstanceProfile' :: Text
roleName = Text
pRoleName_
}
addRoleToInstanceProfile_instanceProfileName :: Lens.Lens' AddRoleToInstanceProfile Prelude.Text
addRoleToInstanceProfile_instanceProfileName :: (Text -> f Text)
-> AddRoleToInstanceProfile -> f AddRoleToInstanceProfile
addRoleToInstanceProfile_instanceProfileName = (AddRoleToInstanceProfile -> Text)
-> (AddRoleToInstanceProfile -> Text -> AddRoleToInstanceProfile)
-> Lens AddRoleToInstanceProfile AddRoleToInstanceProfile Text Text
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 :: (Text -> f Text)
-> AddRoleToInstanceProfile -> f AddRoleToInstanceProfile
addRoleToInstanceProfile_roleName = (AddRoleToInstanceProfile -> Text)
-> (AddRoleToInstanceProfile -> Text -> AddRoleToInstanceProfile)
-> Lens AddRoleToInstanceProfile AddRoleToInstanceProfile Text Text
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 :: AddRoleToInstanceProfile -> Request AddRoleToInstanceProfile
request = Service
-> AddRoleToInstanceProfile -> Request AddRoleToInstanceProfile
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy AddRoleToInstanceProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AddRoleToInstanceProfile)))
response =
AWSResponse AddRoleToInstanceProfile
-> Logger
-> Service
-> Proxy AddRoleToInstanceProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AddRoleToInstanceProfile)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse AddRoleToInstanceProfile
AddRoleToInstanceProfileResponse
AddRoleToInstanceProfileResponse'
instance Prelude.Hashable AddRoleToInstanceProfile
instance Prelude.NFData AddRoleToInstanceProfile
instance Core.ToHeaders AddRoleToInstanceProfile where
toHeaders :: AddRoleToInstanceProfile -> [Header]
toHeaders = [Header] -> AddRoleToInstanceProfile -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath AddRoleToInstanceProfile where
toPath :: AddRoleToInstanceProfile -> ByteString
toPath = ByteString -> AddRoleToInstanceProfile -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AddRoleToInstanceProfile where
toQuery :: AddRoleToInstanceProfile -> QueryString
toQuery AddRoleToInstanceProfile' {Text
roleName :: Text
instanceProfileName :: Text
$sel:roleName:AddRoleToInstanceProfile' :: AddRoleToInstanceProfile -> Text
$sel:instanceProfileName:AddRoleToInstanceProfile' :: AddRoleToInstanceProfile -> 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
"AddRoleToInstanceProfile" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"InstanceProfileName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
instanceProfileName,
ByteString
"RoleName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
roleName
]
data AddRoleToInstanceProfileResponse = AddRoleToInstanceProfileResponse'
{
}
deriving (AddRoleToInstanceProfileResponse
-> AddRoleToInstanceProfileResponse -> Bool
(AddRoleToInstanceProfileResponse
-> AddRoleToInstanceProfileResponse -> Bool)
-> (AddRoleToInstanceProfileResponse
-> AddRoleToInstanceProfileResponse -> Bool)
-> Eq AddRoleToInstanceProfileResponse
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]
(Int -> ReadS AddRoleToInstanceProfileResponse)
-> ReadS [AddRoleToInstanceProfileResponse]
-> ReadPrec AddRoleToInstanceProfileResponse
-> ReadPrec [AddRoleToInstanceProfileResponse]
-> Read 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
(Int -> AddRoleToInstanceProfileResponse -> ShowS)
-> (AddRoleToInstanceProfileResponse -> String)
-> ([AddRoleToInstanceProfileResponse] -> ShowS)
-> Show AddRoleToInstanceProfileResponse
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.
AddRoleToInstanceProfileResponse
-> Rep AddRoleToInstanceProfileResponse x)
-> (forall x.
Rep AddRoleToInstanceProfileResponse x
-> AddRoleToInstanceProfileResponse)
-> Generic AddRoleToInstanceProfileResponse
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