module Network.AWS.CodePipeline.PollForThirdPartyJobs
(
pollForThirdPartyJobs
, PollForThirdPartyJobs
, pftpjMaxBatchSize
, pftpjActionTypeId
, pollForThirdPartyJobsResponse
, PollForThirdPartyJobsResponse
, pftpjrsJobs
, pftpjrsStatus
) where
import Network.AWS.CodePipeline.Types
import Network.AWS.CodePipeline.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data PollForThirdPartyJobs = PollForThirdPartyJobs'
{ _pftpjMaxBatchSize :: !(Maybe Nat)
, _pftpjActionTypeId :: !ActionTypeId
} deriving (Eq,Read,Show,Data,Typeable,Generic)
pollForThirdPartyJobs
:: ActionTypeId
-> PollForThirdPartyJobs
pollForThirdPartyJobs pActionTypeId_ =
PollForThirdPartyJobs'
{ _pftpjMaxBatchSize = Nothing
, _pftpjActionTypeId = pActionTypeId_
}
pftpjMaxBatchSize :: Lens' PollForThirdPartyJobs (Maybe Natural)
pftpjMaxBatchSize = lens _pftpjMaxBatchSize (\ s a -> s{_pftpjMaxBatchSize = a}) . mapping _Nat;
pftpjActionTypeId :: Lens' PollForThirdPartyJobs ActionTypeId
pftpjActionTypeId = lens _pftpjActionTypeId (\ s a -> s{_pftpjActionTypeId = a});
instance AWSRequest PollForThirdPartyJobs where
type Sv PollForThirdPartyJobs = CodePipeline
type Rs PollForThirdPartyJobs =
PollForThirdPartyJobsResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
PollForThirdPartyJobsResponse' <$>
(x .?> "jobs" .!@ mempty) <*> (pure (fromEnum s)))
instance ToHeaders PollForThirdPartyJobs where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CodePipeline_20150709.PollForThirdPartyJobs" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON PollForThirdPartyJobs where
toJSON PollForThirdPartyJobs'{..}
= object
["maxBatchSize" .= _pftpjMaxBatchSize,
"actionTypeId" .= _pftpjActionTypeId]
instance ToPath PollForThirdPartyJobs where
toPath = const "/"
instance ToQuery PollForThirdPartyJobs where
toQuery = const mempty
data PollForThirdPartyJobsResponse = PollForThirdPartyJobsResponse'
{ _pftpjrsJobs :: !(Maybe [ThirdPartyJob])
, _pftpjrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
pollForThirdPartyJobsResponse
:: Int
-> PollForThirdPartyJobsResponse
pollForThirdPartyJobsResponse pStatus_ =
PollForThirdPartyJobsResponse'
{ _pftpjrsJobs = Nothing
, _pftpjrsStatus = pStatus_
}
pftpjrsJobs :: Lens' PollForThirdPartyJobsResponse [ThirdPartyJob]
pftpjrsJobs = lens _pftpjrsJobs (\ s a -> s{_pftpjrsJobs = a}) . _Default . _Coerce;
pftpjrsStatus :: Lens' PollForThirdPartyJobsResponse Int
pftpjrsStatus = lens _pftpjrsStatus (\ s a -> s{_pftpjrsStatus = a});