module Network.AWS.CodeDeploy.GetDeploymentGroup
(
GetDeploymentGroup
, getDeploymentGroup
, gdgApplicationName
, gdgDeploymentGroupName
, GetDeploymentGroupResponse
, getDeploymentGroupResponse
, gdgrDeploymentGroupInfo
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CodeDeploy.Types
import qualified GHC.Exts
data GetDeploymentGroup = GetDeploymentGroup
{ _gdgApplicationName :: Text
, _gdgDeploymentGroupName :: Text
} deriving (Eq, Ord, Show)
getDeploymentGroup :: Text
-> Text
-> GetDeploymentGroup
getDeploymentGroup p1 p2 = GetDeploymentGroup
{ _gdgApplicationName = p1
, _gdgDeploymentGroupName = p2
}
gdgApplicationName :: Lens' GetDeploymentGroup Text
gdgApplicationName =
lens _gdgApplicationName (\s a -> s { _gdgApplicationName = a })
gdgDeploymentGroupName :: Lens' GetDeploymentGroup Text
gdgDeploymentGroupName =
lens _gdgDeploymentGroupName (\s a -> s { _gdgDeploymentGroupName = a })
newtype GetDeploymentGroupResponse = GetDeploymentGroupResponse
{ _gdgrDeploymentGroupInfo :: Maybe DeploymentGroupInfo
} deriving (Eq, Show)
getDeploymentGroupResponse :: GetDeploymentGroupResponse
getDeploymentGroupResponse = GetDeploymentGroupResponse
{ _gdgrDeploymentGroupInfo = Nothing
}
gdgrDeploymentGroupInfo :: Lens' GetDeploymentGroupResponse (Maybe DeploymentGroupInfo)
gdgrDeploymentGroupInfo =
lens _gdgrDeploymentGroupInfo (\s a -> s { _gdgrDeploymentGroupInfo = a })
instance ToPath GetDeploymentGroup where
toPath = const "/"
instance ToQuery GetDeploymentGroup where
toQuery = const mempty
instance ToHeaders GetDeploymentGroup
instance ToJSON GetDeploymentGroup where
toJSON GetDeploymentGroup{..} = object
[ "applicationName" .= _gdgApplicationName
, "deploymentGroupName" .= _gdgDeploymentGroupName
]
instance AWSRequest GetDeploymentGroup where
type Sv GetDeploymentGroup = CodeDeploy
type Rs GetDeploymentGroup = GetDeploymentGroupResponse
request = post "GetDeploymentGroup"
response = jsonResponse
instance FromJSON GetDeploymentGroupResponse where
parseJSON = withObject "GetDeploymentGroupResponse" $ \o -> GetDeploymentGroupResponse
<$> o .:? "deploymentGroupInfo"