module Network.AWS.CodeDeploy.BatchGetDeployments
(
BatchGetDeployments
, batchGetDeployments
, bgdDeploymentIds
, BatchGetDeploymentsResponse
, batchGetDeploymentsResponse
, bgdrDeploymentsInfo
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CodeDeploy.Types
import qualified GHC.Exts
newtype BatchGetDeployments = BatchGetDeployments
{ _bgdDeploymentIds :: List "deployments" Text
} deriving (Eq, Ord, Show, Monoid, Semigroup)
instance GHC.Exts.IsList BatchGetDeployments where
type Item BatchGetDeployments = Text
fromList = BatchGetDeployments . GHC.Exts.fromList
toList = GHC.Exts.toList . _bgdDeploymentIds
batchGetDeployments :: BatchGetDeployments
batchGetDeployments = BatchGetDeployments
{ _bgdDeploymentIds = mempty
}
bgdDeploymentIds :: Lens' BatchGetDeployments [Text]
bgdDeploymentIds = lens _bgdDeploymentIds (\s a -> s { _bgdDeploymentIds = a }) . _List
newtype BatchGetDeploymentsResponse = BatchGetDeploymentsResponse
{ _bgdrDeploymentsInfo :: List "deploymentsInfo" DeploymentInfo
} deriving (Eq, Show, Monoid, Semigroup)
instance GHC.Exts.IsList BatchGetDeploymentsResponse where
type Item BatchGetDeploymentsResponse = DeploymentInfo
fromList = BatchGetDeploymentsResponse . GHC.Exts.fromList
toList = GHC.Exts.toList . _bgdrDeploymentsInfo
batchGetDeploymentsResponse :: BatchGetDeploymentsResponse
batchGetDeploymentsResponse = BatchGetDeploymentsResponse
{ _bgdrDeploymentsInfo = mempty
}
bgdrDeploymentsInfo :: Lens' BatchGetDeploymentsResponse [DeploymentInfo]
bgdrDeploymentsInfo =
lens _bgdrDeploymentsInfo (\s a -> s { _bgdrDeploymentsInfo = a })
. _List
instance ToPath BatchGetDeployments where
toPath = const "/"
instance ToQuery BatchGetDeployments where
toQuery = const mempty
instance ToHeaders BatchGetDeployments
instance ToJSON BatchGetDeployments where
toJSON BatchGetDeployments{..} = object
[ "deploymentIds" .= _bgdDeploymentIds
]
instance AWSRequest BatchGetDeployments where
type Sv BatchGetDeployments = CodeDeploy
type Rs BatchGetDeployments = BatchGetDeploymentsResponse
request = post "BatchGetDeployments"
response = jsonResponse
instance FromJSON BatchGetDeploymentsResponse where
parseJSON = withObject "BatchGetDeploymentsResponse" $ \o -> BatchGetDeploymentsResponse
<$> o .:? "deploymentsInfo" .!= mempty