module Network.AWS.IAM.CreateInstanceProfile
(
CreateInstanceProfile
, createInstanceProfile
, cipInstanceProfileName
, cipPath
, CreateInstanceProfileResponse
, createInstanceProfileResponse
, ciprInstanceProfile
) where
import Network.AWS.Prelude
import Network.AWS.Request.Query
import Network.AWS.IAM.Types
import qualified GHC.Exts
data CreateInstanceProfile = CreateInstanceProfile
{ _cipInstanceProfileName :: Text
, _cipPath :: Maybe Text
} deriving (Eq, Ord, Show)
createInstanceProfile :: Text
-> CreateInstanceProfile
createInstanceProfile p1 = CreateInstanceProfile
{ _cipInstanceProfileName = p1
, _cipPath = Nothing
}
cipInstanceProfileName :: Lens' CreateInstanceProfile Text
cipInstanceProfileName =
lens _cipInstanceProfileName (\s a -> s { _cipInstanceProfileName = a })
cipPath :: Lens' CreateInstanceProfile (Maybe Text)
cipPath = lens _cipPath (\s a -> s { _cipPath = a })
newtype CreateInstanceProfileResponse = CreateInstanceProfileResponse
{ _ciprInstanceProfile :: InstanceProfile
} deriving (Eq, Show)
createInstanceProfileResponse :: InstanceProfile
-> CreateInstanceProfileResponse
createInstanceProfileResponse p1 = CreateInstanceProfileResponse
{ _ciprInstanceProfile = p1
}
ciprInstanceProfile :: Lens' CreateInstanceProfileResponse InstanceProfile
ciprInstanceProfile =
lens _ciprInstanceProfile (\s a -> s { _ciprInstanceProfile = a })
instance ToPath CreateInstanceProfile where
toPath = const "/"
instance ToQuery CreateInstanceProfile where
toQuery CreateInstanceProfile{..} = mconcat
[ "InstanceProfileName" =? _cipInstanceProfileName
, "Path" =? _cipPath
]
instance ToHeaders CreateInstanceProfile
instance AWSRequest CreateInstanceProfile where
type Sv CreateInstanceProfile = IAM
type Rs CreateInstanceProfile = CreateInstanceProfileResponse
request = post "CreateInstanceProfile"
response = xmlResponse
instance FromXML CreateInstanceProfileResponse where
parseXML = withElement "CreateInstanceProfileResult" $ \x -> CreateInstanceProfileResponse
<$> x .@ "InstanceProfile"