module Network.AWS.CodeDeploy.BatchGetOnPremisesInstances
(
BatchGetOnPremisesInstances
, batchGetOnPremisesInstances
, bgopiInstanceNames
, BatchGetOnPremisesInstancesResponse
, batchGetOnPremisesInstancesResponse
, bgopirInstanceInfos
) where
import Network.AWS.Data (Object)
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.CodeDeploy.Types
import qualified GHC.Exts
newtype BatchGetOnPremisesInstances = BatchGetOnPremisesInstances
{ _bgopiInstanceNames :: List "instanceNames" Text
} deriving (Eq, Ord, Read, Show, Monoid, Semigroup)
instance GHC.Exts.IsList BatchGetOnPremisesInstances where
type Item BatchGetOnPremisesInstances = Text
fromList = BatchGetOnPremisesInstances . GHC.Exts.fromList
toList = GHC.Exts.toList . _bgopiInstanceNames
batchGetOnPremisesInstances :: BatchGetOnPremisesInstances
batchGetOnPremisesInstances = BatchGetOnPremisesInstances
{ _bgopiInstanceNames = mempty
}
bgopiInstanceNames :: Lens' BatchGetOnPremisesInstances [Text]
bgopiInstanceNames =
lens _bgopiInstanceNames (\s a -> s { _bgopiInstanceNames = a })
. _List
newtype BatchGetOnPremisesInstancesResponse = BatchGetOnPremisesInstancesResponse
{ _bgopirInstanceInfos :: List "instanceInfos" InstanceInfo
} deriving (Eq, Read, Show, Monoid, Semigroup)
instance GHC.Exts.IsList BatchGetOnPremisesInstancesResponse where
type Item BatchGetOnPremisesInstancesResponse = InstanceInfo
fromList = BatchGetOnPremisesInstancesResponse . GHC.Exts.fromList
toList = GHC.Exts.toList . _bgopirInstanceInfos
batchGetOnPremisesInstancesResponse :: BatchGetOnPremisesInstancesResponse
batchGetOnPremisesInstancesResponse = BatchGetOnPremisesInstancesResponse
{ _bgopirInstanceInfos = mempty
}
bgopirInstanceInfos :: Lens' BatchGetOnPremisesInstancesResponse [InstanceInfo]
bgopirInstanceInfos =
lens _bgopirInstanceInfos (\s a -> s { _bgopirInstanceInfos = a })
. _List
instance ToPath BatchGetOnPremisesInstances where
toPath = const "/"
instance ToQuery BatchGetOnPremisesInstances where
toQuery = const mempty
instance ToHeaders BatchGetOnPremisesInstances
instance ToJSON BatchGetOnPremisesInstances where
toJSON BatchGetOnPremisesInstances{..} = object
[ "instanceNames" .= _bgopiInstanceNames
]
instance AWSRequest BatchGetOnPremisesInstances where
type Sv BatchGetOnPremisesInstances = CodeDeploy
type Rs BatchGetOnPremisesInstances = BatchGetOnPremisesInstancesResponse
request = post "BatchGetOnPremisesInstances"
response = jsonResponse
instance FromJSON BatchGetOnPremisesInstancesResponse where
parseJSON = withObject "BatchGetOnPremisesInstancesResponse" $ \o -> BatchGetOnPremisesInstancesResponse
<$> o .:? "instanceInfos" .!= mempty