module Network.AWS.SSM.CreateAssociationBatch
(
createAssociationBatch
, CreateAssociationBatch
, cabEntries
, createAssociationBatchResponse
, CreateAssociationBatchResponse
, cabrsSuccessful
, cabrsFailed
, cabrsResponseStatus
) where
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SSM.Types
import Network.AWS.SSM.Types.Product
newtype CreateAssociationBatch = CreateAssociationBatch'
{ _cabEntries :: [CreateAssociationBatchRequestEntry]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createAssociationBatch
:: CreateAssociationBatch
createAssociationBatch =
CreateAssociationBatch'
{ _cabEntries = mempty
}
cabEntries :: Lens' CreateAssociationBatch [CreateAssociationBatchRequestEntry]
cabEntries = lens _cabEntries (\ s a -> s{_cabEntries = a}) . _Coerce;
instance AWSRequest CreateAssociationBatch where
type Rs CreateAssociationBatch =
CreateAssociationBatchResponse
request = postJSON sSM
response
= receiveJSON
(\ s h x ->
CreateAssociationBatchResponse' <$>
(x .?> "Successful" .!@ mempty) <*>
(x .?> "Failed" .!@ mempty)
<*> (pure (fromEnum s)))
instance ToHeaders CreateAssociationBatch where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.CreateAssociationBatch" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateAssociationBatch where
toJSON CreateAssociationBatch'{..}
= object
(catMaybes [Just ("Entries" .= _cabEntries)])
instance ToPath CreateAssociationBatch where
toPath = const "/"
instance ToQuery CreateAssociationBatch where
toQuery = const mempty
data CreateAssociationBatchResponse = CreateAssociationBatchResponse'
{ _cabrsSuccessful :: !(Maybe [AssociationDescription])
, _cabrsFailed :: !(Maybe [FailedCreateAssociation])
, _cabrsResponseStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createAssociationBatchResponse
:: Int
-> CreateAssociationBatchResponse
createAssociationBatchResponse pResponseStatus_ =
CreateAssociationBatchResponse'
{ _cabrsSuccessful = Nothing
, _cabrsFailed = Nothing
, _cabrsResponseStatus = pResponseStatus_
}
cabrsSuccessful :: Lens' CreateAssociationBatchResponse [AssociationDescription]
cabrsSuccessful = lens _cabrsSuccessful (\ s a -> s{_cabrsSuccessful = a}) . _Default . _Coerce;
cabrsFailed :: Lens' CreateAssociationBatchResponse [FailedCreateAssociation]
cabrsFailed = lens _cabrsFailed (\ s a -> s{_cabrsFailed = a}) . _Default . _Coerce;
cabrsResponseStatus :: Lens' CreateAssociationBatchResponse Int
cabrsResponseStatus = lens _cabrsResponseStatus (\ s a -> s{_cabrsResponseStatus = a});