{-# 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.Rekognition.DeleteFaces
(
deleteFaces
, DeleteFaces
, dfCollectionId
, dfFaceIds
, deleteFacesResponse
, DeleteFacesResponse
, dfsrsDeletedFaces
, dfsrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Rekognition.Types
import Network.AWS.Rekognition.Types.Product
import Network.AWS.Request
import Network.AWS.Response
data DeleteFaces = DeleteFaces'
{ _dfCollectionId :: !Text
, _dfFaceIds :: !(List1 Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteFaces
:: Text
-> NonEmpty Text
-> DeleteFaces
deleteFaces pCollectionId_ pFaceIds_ =
DeleteFaces'
{_dfCollectionId = pCollectionId_, _dfFaceIds = _List1 # pFaceIds_}
dfCollectionId :: Lens' DeleteFaces Text
dfCollectionId = lens _dfCollectionId (\ s a -> s{_dfCollectionId = a})
dfFaceIds :: Lens' DeleteFaces (NonEmpty Text)
dfFaceIds = lens _dfFaceIds (\ s a -> s{_dfFaceIds = a}) . _List1
instance AWSRequest DeleteFaces where
type Rs DeleteFaces = DeleteFacesResponse
request = postJSON rekognition
response
= receiveJSON
(\ s h x ->
DeleteFacesResponse' <$>
(x .?> "DeletedFaces") <*> (pure (fromEnum s)))
instance Hashable DeleteFaces where
instance NFData DeleteFaces where
instance ToHeaders DeleteFaces where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("RekognitionService.DeleteFaces" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteFaces where
toJSON DeleteFaces'{..}
= object
(catMaybes
[Just ("CollectionId" .= _dfCollectionId),
Just ("FaceIds" .= _dfFaceIds)])
instance ToPath DeleteFaces where
toPath = const "/"
instance ToQuery DeleteFaces where
toQuery = const mempty
data DeleteFacesResponse = DeleteFacesResponse'
{ _dfsrsDeletedFaces :: !(Maybe (List1 Text))
, _dfsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
deleteFacesResponse
:: Int
-> DeleteFacesResponse
deleteFacesResponse pResponseStatus_ =
DeleteFacesResponse'
{_dfsrsDeletedFaces = Nothing, _dfsrsResponseStatus = pResponseStatus_}
dfsrsDeletedFaces :: Lens' DeleteFacesResponse (Maybe (NonEmpty Text))
dfsrsDeletedFaces = lens _dfsrsDeletedFaces (\ s a -> s{_dfsrsDeletedFaces = a}) . mapping _List1
dfsrsResponseStatus :: Lens' DeleteFacesResponse Int
dfsrsResponseStatus = lens _dfsrsResponseStatus (\ s a -> s{_dfsrsResponseStatus = a})
instance NFData DeleteFacesResponse where