{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.CodeDeploy.BatchGetOnPremisesInstances
(
batchGetOnPremisesInstances
, BatchGetOnPremisesInstances
, bgopiInstanceNames
, batchGetOnPremisesInstancesResponse
, BatchGetOnPremisesInstancesResponse
, bgopirsInstanceInfos
, bgopirsResponseStatus
) 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 BatchGetOnPremisesInstances = BatchGetOnPremisesInstances'
{ _bgopiInstanceNames :: [Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
batchGetOnPremisesInstances
:: BatchGetOnPremisesInstances
batchGetOnPremisesInstances =
BatchGetOnPremisesInstances' {_bgopiInstanceNames = mempty}
bgopiInstanceNames :: Lens' BatchGetOnPremisesInstances [Text]
bgopiInstanceNames = lens _bgopiInstanceNames (\ s a -> s{_bgopiInstanceNames = a}) . _Coerce
instance AWSRequest BatchGetOnPremisesInstances where
type Rs BatchGetOnPremisesInstances =
BatchGetOnPremisesInstancesResponse
request = postJSON codeDeploy
response
= receiveJSON
(\ s h x ->
BatchGetOnPremisesInstancesResponse' <$>
(x .?> "instanceInfos" .!@ mempty) <*>
(pure (fromEnum s)))
instance Hashable BatchGetOnPremisesInstances where
instance NFData BatchGetOnPremisesInstances where
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
(catMaybes
[Just ("instanceNames" .= _bgopiInstanceNames)])
instance ToPath BatchGetOnPremisesInstances where
toPath = const "/"
instance ToQuery BatchGetOnPremisesInstances where
toQuery = const mempty
data BatchGetOnPremisesInstancesResponse = BatchGetOnPremisesInstancesResponse'
{ _bgopirsInstanceInfos :: !(Maybe [InstanceInfo])
, _bgopirsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
batchGetOnPremisesInstancesResponse
:: Int
-> BatchGetOnPremisesInstancesResponse
batchGetOnPremisesInstancesResponse pResponseStatus_ =
BatchGetOnPremisesInstancesResponse'
{_bgopirsInstanceInfos = Nothing, _bgopirsResponseStatus = pResponseStatus_}
bgopirsInstanceInfos :: Lens' BatchGetOnPremisesInstancesResponse [InstanceInfo]
bgopirsInstanceInfos = lens _bgopirsInstanceInfos (\ s a -> s{_bgopirsInstanceInfos = a}) . _Default . _Coerce
bgopirsResponseStatus :: Lens' BatchGetOnPremisesInstancesResponse Int
bgopirsResponseStatus = lens _bgopirsResponseStatus (\ s a -> s{_bgopirsResponseStatus = a})
instance NFData BatchGetOnPremisesInstancesResponse
where