module Network.AWS.CodeDeploy.BatchGetDeployments
(
batchGetDeployments
, BatchGetDeployments
, bgdDeploymentIds
, batchGetDeploymentsResponse
, BatchGetDeploymentsResponse
, bgdrsDeploymentsInfo
, bgdrsResponseStatus
) where
import Network.AWS.CodeDeploy.Types
import Network.AWS.CodeDeploy.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype BatchGetDeployments = BatchGetDeployments'
{ _bgdDeploymentIds :: Maybe [Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
batchGetDeployments
:: BatchGetDeployments
batchGetDeployments = BatchGetDeployments' {_bgdDeploymentIds = Nothing}
bgdDeploymentIds :: Lens' BatchGetDeployments [Text]
bgdDeploymentIds = lens _bgdDeploymentIds (\ s a -> s{_bgdDeploymentIds = a}) . _Default . _Coerce;
instance AWSRequest BatchGetDeployments where
type Rs BatchGetDeployments =
BatchGetDeploymentsResponse
request = postJSON codeDeploy
response
= receiveJSON
(\ s h x ->
BatchGetDeploymentsResponse' <$>
(x .?> "deploymentsInfo" .!@ mempty) <*>
(pure (fromEnum s)))
instance Hashable BatchGetDeployments where
instance NFData BatchGetDeployments where
instance ToHeaders BatchGetDeployments where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeDeploy_20141006.BatchGetDeployments" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON BatchGetDeployments where
toJSON BatchGetDeployments'{..}
= object
(catMaybes
[("deploymentIds" .=) <$> _bgdDeploymentIds])
instance ToPath BatchGetDeployments where
toPath = const "/"
instance ToQuery BatchGetDeployments where
toQuery = const mempty
data BatchGetDeploymentsResponse = BatchGetDeploymentsResponse'
{ _bgdrsDeploymentsInfo :: !(Maybe [DeploymentInfo])
, _bgdrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
batchGetDeploymentsResponse
:: Int
-> BatchGetDeploymentsResponse
batchGetDeploymentsResponse pResponseStatus_ =
BatchGetDeploymentsResponse'
{_bgdrsDeploymentsInfo = Nothing, _bgdrsResponseStatus = pResponseStatus_}
bgdrsDeploymentsInfo :: Lens' BatchGetDeploymentsResponse [DeploymentInfo]
bgdrsDeploymentsInfo = lens _bgdrsDeploymentsInfo (\ s a -> s{_bgdrsDeploymentsInfo = a}) . _Default . _Coerce;
bgdrsResponseStatus :: Lens' BatchGetDeploymentsResponse Int
bgdrsResponseStatus = lens _bgdrsResponseStatus (\ s a -> s{_bgdrsResponseStatus = a});
instance NFData BatchGetDeploymentsResponse where