{-# 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.BatchGetApplications
(
batchGetApplications
, BatchGetApplications
, bgaApplicationNames
, batchGetApplicationsResponse
, BatchGetApplicationsResponse
, bgarsApplicationsInfo
, bgarsResponseStatus
) 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 BatchGetApplications = BatchGetApplications'
{ _bgaApplicationNames :: [Text]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
batchGetApplications
:: BatchGetApplications
batchGetApplications = BatchGetApplications' {_bgaApplicationNames = mempty}
bgaApplicationNames :: Lens' BatchGetApplications [Text]
bgaApplicationNames = lens _bgaApplicationNames (\ s a -> s{_bgaApplicationNames = a}) . _Coerce
instance AWSRequest BatchGetApplications where
type Rs BatchGetApplications =
BatchGetApplicationsResponse
request = postJSON codeDeploy
response
= receiveJSON
(\ s h x ->
BatchGetApplicationsResponse' <$>
(x .?> "applicationsInfo" .!@ mempty) <*>
(pure (fromEnum s)))
instance Hashable BatchGetApplications where
instance NFData BatchGetApplications where
instance ToHeaders BatchGetApplications where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodeDeploy_20141006.BatchGetApplications" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON BatchGetApplications where
toJSON BatchGetApplications'{..}
= object
(catMaybes
[Just ("applicationNames" .= _bgaApplicationNames)])
instance ToPath BatchGetApplications where
toPath = const "/"
instance ToQuery BatchGetApplications where
toQuery = const mempty
data BatchGetApplicationsResponse = BatchGetApplicationsResponse'
{ _bgarsApplicationsInfo :: !(Maybe [ApplicationInfo])
, _bgarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
batchGetApplicationsResponse
:: Int
-> BatchGetApplicationsResponse
batchGetApplicationsResponse pResponseStatus_ =
BatchGetApplicationsResponse'
{_bgarsApplicationsInfo = Nothing, _bgarsResponseStatus = pResponseStatus_}
bgarsApplicationsInfo :: Lens' BatchGetApplicationsResponse [ApplicationInfo]
bgarsApplicationsInfo = lens _bgarsApplicationsInfo (\ s a -> s{_bgarsApplicationsInfo = a}) . _Default . _Coerce
bgarsResponseStatus :: Lens' BatchGetApplicationsResponse Int
bgarsResponseStatus = lens _bgarsResponseStatus (\ s a -> s{_bgarsResponseStatus = a})
instance NFData BatchGetApplicationsResponse where