module Network.AWS.CodeDeploy.GetDeployment
(
GetDeployment
, getDeployment
, gdDeploymentId
, GetDeploymentResponse
, getDeploymentResponse
, gdrDeploymentInfo
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CodeDeploy.Types
import qualified GHC.Exts
newtype GetDeployment = GetDeployment
{ _gdDeploymentId :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
getDeployment :: Text
-> GetDeployment
getDeployment p1 = GetDeployment
{ _gdDeploymentId = p1
}
gdDeploymentId :: Lens' GetDeployment Text
gdDeploymentId = lens _gdDeploymentId (\s a -> s { _gdDeploymentId = a })
newtype GetDeploymentResponse = GetDeploymentResponse
{ _gdrDeploymentInfo :: Maybe DeploymentInfo
} deriving (Eq, Show)
getDeploymentResponse :: GetDeploymentResponse
getDeploymentResponse = GetDeploymentResponse
{ _gdrDeploymentInfo = Nothing
}
gdrDeploymentInfo :: Lens' GetDeploymentResponse (Maybe DeploymentInfo)
gdrDeploymentInfo =
lens _gdrDeploymentInfo (\s a -> s { _gdrDeploymentInfo = a })
instance ToPath GetDeployment where
toPath = const "/"
instance ToQuery GetDeployment where
toQuery = const mempty
instance ToHeaders GetDeployment
instance ToJSON GetDeployment where
toJSON GetDeployment{..} = object
[ "deploymentId" .= _gdDeploymentId
]
instance AWSRequest GetDeployment where
type Sv GetDeployment = CodeDeploy
type Rs GetDeployment = GetDeploymentResponse
request = post "GetDeployment"
response = jsonResponse
instance FromJSON GetDeploymentResponse where
parseJSON = withObject "GetDeploymentResponse" $ \o -> GetDeploymentResponse
<$> o .:? "deploymentInfo"