module Network.AWS.IAM.GetInstanceProfile
(
GetInstanceProfile
, getInstanceProfile
, gipInstanceProfileName
, GetInstanceProfileResponse
, getInstanceProfileResponse
, giprInstanceProfile
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.IAM.Types
import qualified GHC.Exts
newtype GetInstanceProfile = GetInstanceProfile
{ _gipInstanceProfileName :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
getInstanceProfile :: Text
-> GetInstanceProfile
getInstanceProfile p1 = GetInstanceProfile
{ _gipInstanceProfileName = p1
}
gipInstanceProfileName :: Lens' GetInstanceProfile Text
gipInstanceProfileName =
lens _gipInstanceProfileName (\s a -> s { _gipInstanceProfileName = a })
newtype GetInstanceProfileResponse = GetInstanceProfileResponse
{ _giprInstanceProfile :: InstanceProfile
} deriving (Eq, Show)
getInstanceProfileResponse :: InstanceProfile
-> GetInstanceProfileResponse
getInstanceProfileResponse p1 = GetInstanceProfileResponse
{ _giprInstanceProfile = p1
}
giprInstanceProfile :: Lens' GetInstanceProfileResponse InstanceProfile
giprInstanceProfile =
lens _giprInstanceProfile (\s a -> s { _giprInstanceProfile = a })
instance ToPath GetInstanceProfile where
toPath = const "/"
instance ToQuery GetInstanceProfile where
toQuery GetInstanceProfile{..} = mconcat
[ "InstanceProfileName" =? _gipInstanceProfileName
]
instance ToHeaders GetInstanceProfile
instance AWSRequest GetInstanceProfile where
type Sv GetInstanceProfile = IAM
type Rs GetInstanceProfile = GetInstanceProfileResponse
request = post "GetInstanceProfile"
response = xmlResponse
instance FromXML GetInstanceProfileResponse where
parseXML = withElement "GetInstanceProfileResult" $ \x -> GetInstanceProfileResponse
<$> x .@ "InstanceProfile"