module Network.AWS.CodeDeploy.GetDeploymentConfig
(
GetDeploymentConfig
, getDeploymentConfig
, gdcDeploymentConfigName
, GetDeploymentConfigResponse
, getDeploymentConfigResponse
, gdcrDeploymentConfigInfo
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CodeDeploy.Types
import qualified GHC.Exts
newtype GetDeploymentConfig = GetDeploymentConfig
{ _gdcDeploymentConfigName :: Text
} deriving (Eq, Ord, Read, Show, Monoid, IsString)
getDeploymentConfig :: Text
-> GetDeploymentConfig
getDeploymentConfig p1 = GetDeploymentConfig
{ _gdcDeploymentConfigName = p1
}
gdcDeploymentConfigName :: Lens' GetDeploymentConfig Text
gdcDeploymentConfigName =
lens _gdcDeploymentConfigName (\s a -> s { _gdcDeploymentConfigName = a })
newtype GetDeploymentConfigResponse = GetDeploymentConfigResponse
{ _gdcrDeploymentConfigInfo :: Maybe DeploymentConfigInfo
} deriving (Eq, Read, Show)
getDeploymentConfigResponse :: GetDeploymentConfigResponse
getDeploymentConfigResponse = GetDeploymentConfigResponse
{ _gdcrDeploymentConfigInfo = Nothing
}
gdcrDeploymentConfigInfo :: Lens' GetDeploymentConfigResponse (Maybe DeploymentConfigInfo)
gdcrDeploymentConfigInfo =
lens _gdcrDeploymentConfigInfo
(\s a -> s { _gdcrDeploymentConfigInfo = a })
instance ToPath GetDeploymentConfig where
toPath = const "/"
instance ToQuery GetDeploymentConfig where
toQuery = const mempty
instance ToHeaders GetDeploymentConfig
instance ToJSON GetDeploymentConfig where
toJSON GetDeploymentConfig{..} = object
[ "deploymentConfigName" .= _gdcDeploymentConfigName
]
instance AWSRequest GetDeploymentConfig where
type Sv GetDeploymentConfig = CodeDeploy
type Rs GetDeploymentConfig = GetDeploymentConfigResponse
request = post "GetDeploymentConfig"
response = jsonResponse
instance FromJSON GetDeploymentConfigResponse where
parseJSON = withObject "GetDeploymentConfigResponse" $ \o -> GetDeploymentConfigResponse
<$> o .:? "deploymentConfigInfo"