module Network.AWS.CodeDeploy.BatchGetOnPremisesInstances
(
batchGetOnPremisesInstances
, BatchGetOnPremisesInstances
, bgopiInstanceNames
, batchGetOnPremisesInstancesResponse
, BatchGetOnPremisesInstancesResponse
, bgopirsInstanceInfos
, bgopirsStatus
) where
import Network.AWS.CodeDeploy.Types
import Network.AWS.CodeDeploy.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
newtype BatchGetOnPremisesInstances = BatchGetOnPremisesInstances'
{ _bgopiInstanceNames :: Maybe [Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
batchGetOnPremisesInstances
:: BatchGetOnPremisesInstances
batchGetOnPremisesInstances =
BatchGetOnPremisesInstances'
{ _bgopiInstanceNames = Nothing
}
bgopiInstanceNames :: Lens' BatchGetOnPremisesInstances [Text]
bgopiInstanceNames = lens _bgopiInstanceNames (\ s a -> s{_bgopiInstanceNames = a}) . _Default . _Coerce;
instance AWSRequest BatchGetOnPremisesInstances where
type Sv BatchGetOnPremisesInstances = CodeDeploy
type Rs BatchGetOnPremisesInstances =
BatchGetOnPremisesInstancesResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
BatchGetOnPremisesInstancesResponse' <$>
(x .?> "instanceInfos" .!@ mempty) <*>
(pure (fromEnum s)))
instance ToHeaders BatchGetOnPremisesInstances where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeDeploy_20141006.BatchGetOnPremisesInstances" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON BatchGetOnPremisesInstances where
toJSON BatchGetOnPremisesInstances'{..}
= object ["instanceNames" .= _bgopiInstanceNames]
instance ToPath BatchGetOnPremisesInstances where
toPath = const "/"
instance ToQuery BatchGetOnPremisesInstances where
toQuery = const mempty
data BatchGetOnPremisesInstancesResponse = BatchGetOnPremisesInstancesResponse'
{ _bgopirsInstanceInfos :: !(Maybe [InstanceInfo])
, _bgopirsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
batchGetOnPremisesInstancesResponse
:: Int
-> BatchGetOnPremisesInstancesResponse
batchGetOnPremisesInstancesResponse pStatus_ =
BatchGetOnPremisesInstancesResponse'
{ _bgopirsInstanceInfos = Nothing
, _bgopirsStatus = pStatus_
}
bgopirsInstanceInfos :: Lens' BatchGetOnPremisesInstancesResponse [InstanceInfo]
bgopirsInstanceInfos = lens _bgopirsInstanceInfos (\ s a -> s{_bgopirsInstanceInfos = a}) . _Default . _Coerce;
bgopirsStatus :: Lens' BatchGetOnPremisesInstancesResponse Int
bgopirsStatus = lens _bgopirsStatus (\ s a -> s{_bgopirsStatus = a});