module Network.AWS.SSM.CreateAssociationBatch
(
CreateAssociationBatch
, createAssociationBatch
, cabEntries
, CreateAssociationBatchResponse
, createAssociationBatchResponse
, cabrFailed
, cabrSuccessful
) where
import Network.AWS.Data (Object)
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.SSM.Types
import qualified GHC.Exts
newtype CreateAssociationBatch = CreateAssociationBatch
{ _cabEntries :: List "entries" CreateAssociationBatchRequestEntry
} deriving (Eq, Read, Show, Monoid, Semigroup)
instance GHC.Exts.IsList CreateAssociationBatch where
type Item CreateAssociationBatch = CreateAssociationBatchRequestEntry
fromList = CreateAssociationBatch . GHC.Exts.fromList
toList = GHC.Exts.toList . _cabEntries
createAssociationBatch :: CreateAssociationBatch
createAssociationBatch = CreateAssociationBatch
{ _cabEntries = mempty
}
cabEntries :: Lens' CreateAssociationBatch [CreateAssociationBatchRequestEntry]
cabEntries = lens _cabEntries (\s a -> s { _cabEntries = a }) . _List
data CreateAssociationBatchResponse = CreateAssociationBatchResponse
{ _cabrFailed :: List "FailedCreateAssociationEntry" FailedCreateAssociation
, _cabrSuccessful :: List "AssociationDescription" AssociationDescription
} deriving (Eq, Read, Show)
createAssociationBatchResponse :: CreateAssociationBatchResponse
createAssociationBatchResponse = CreateAssociationBatchResponse
{ _cabrSuccessful = mempty
, _cabrFailed = mempty
}
cabrFailed :: Lens' CreateAssociationBatchResponse [FailedCreateAssociation]
cabrFailed = lens _cabrFailed (\s a -> s { _cabrFailed = a }) . _List
cabrSuccessful :: Lens' CreateAssociationBatchResponse [AssociationDescription]
cabrSuccessful = lens _cabrSuccessful (\s a -> s { _cabrSuccessful = a }) . _List
instance ToPath CreateAssociationBatch where
toPath = const "/"
instance ToQuery CreateAssociationBatch where
toQuery = const mempty
instance ToHeaders CreateAssociationBatch
instance ToJSON CreateAssociationBatch where
toJSON CreateAssociationBatch{..} = object
[ "Entries" .= _cabEntries
]
instance AWSRequest CreateAssociationBatch where
type Sv CreateAssociationBatch = SSM
type Rs CreateAssociationBatch = CreateAssociationBatchResponse
request = post "CreateAssociationBatch"
response = jsonResponse
instance FromJSON CreateAssociationBatchResponse where
parseJSON = withObject "CreateAssociationBatchResponse" $ \o -> CreateAssociationBatchResponse
<$> o .:? "Failed" .!= mempty
<*> o .:? "Successful" .!= mempty