module Network.AWS.CodeDeploy.StopDeployment
(
StopDeployment
, stopDeployment
, sdDeploymentId
, StopDeploymentResponse
, stopDeploymentResponse
, sdrStatus
, sdrStatusMessage
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CodeDeploy.Types
import qualified GHC.Exts
newtype StopDeployment = StopDeployment
{ _sdDeploymentId :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
stopDeployment :: Text
-> StopDeployment
stopDeployment p1 = StopDeployment
{ _sdDeploymentId = p1
}
sdDeploymentId :: Lens' StopDeployment Text
sdDeploymentId = lens _sdDeploymentId (\s a -> s { _sdDeploymentId = a })
data StopDeploymentResponse = StopDeploymentResponse
{ _sdrStatus :: Maybe StopStatus
, _sdrStatusMessage :: Maybe Text
} deriving (Eq, Show)
stopDeploymentResponse :: StopDeploymentResponse
stopDeploymentResponse = StopDeploymentResponse
{ _sdrStatus = Nothing
, _sdrStatusMessage = Nothing
}
sdrStatus :: Lens' StopDeploymentResponse (Maybe StopStatus)
sdrStatus = lens _sdrStatus (\s a -> s { _sdrStatus = a })
sdrStatusMessage :: Lens' StopDeploymentResponse (Maybe Text)
sdrStatusMessage = lens _sdrStatusMessage (\s a -> s { _sdrStatusMessage = a })
instance ToPath StopDeployment where
toPath = const "/"
instance ToQuery StopDeployment where
toQuery = const mempty
instance ToHeaders StopDeployment
instance ToJSON StopDeployment where
toJSON StopDeployment{..} = object
[ "deploymentId" .= _sdDeploymentId
]
instance AWSRequest StopDeployment where
type Sv StopDeployment = CodeDeploy
type Rs StopDeployment = StopDeploymentResponse
request = post "StopDeployment"
response = jsonResponse
instance FromJSON StopDeploymentResponse where
parseJSON = withObject "StopDeploymentResponse" $ \o -> StopDeploymentResponse
<$> o .:? "status"
<*> o .:? "statusMessage"