module Network.AWS.DirectoryService.DeleteSnapshot
    (
    
      deleteSnapshot
    , DeleteSnapshot
    
    , dsSnapshotId
    
    , deleteSnapshotResponse
    , DeleteSnapshotResponse
    
    , dsrsSnapshotId
    , dsrsResponseStatus
    ) where
import           Network.AWS.DirectoryService.Types
import           Network.AWS.DirectoryService.Types.Product
import           Network.AWS.Prelude
import           Network.AWS.Request
import           Network.AWS.Response
newtype DeleteSnapshot = DeleteSnapshot'
    { _dsSnapshotId :: Text
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteSnapshot
    :: Text 
    -> DeleteSnapshot
deleteSnapshot pSnapshotId_ =
    DeleteSnapshot'
    { _dsSnapshotId = pSnapshotId_
    }
dsSnapshotId :: Lens' DeleteSnapshot Text
dsSnapshotId = lens _dsSnapshotId (\ s a -> s{_dsSnapshotId = a});
instance AWSRequest DeleteSnapshot where
        type Rs DeleteSnapshot = DeleteSnapshotResponse
        request = postJSON directoryService
        response
          = receiveJSON
              (\ s h x ->
                 DeleteSnapshotResponse' <$>
                   (x .?> "SnapshotId") <*> (pure (fromEnum s)))
instance ToHeaders DeleteSnapshot where
        toHeaders
          = const
              (mconcat
                 ["X-Amz-Target" =#
                    ("DirectoryService_20150416.DeleteSnapshot" ::
                       ByteString),
                  "Content-Type" =#
                    ("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON DeleteSnapshot where
        toJSON DeleteSnapshot'{..}
          = object
              (catMaybes [Just ("SnapshotId" .= _dsSnapshotId)])
instance ToPath DeleteSnapshot where
        toPath = const "/"
instance ToQuery DeleteSnapshot where
        toQuery = const mempty
data DeleteSnapshotResponse = DeleteSnapshotResponse'
    { _dsrsSnapshotId     :: !(Maybe Text)
    , _dsrsResponseStatus :: !Int
    } deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteSnapshotResponse
    :: Int 
    -> DeleteSnapshotResponse
deleteSnapshotResponse pResponseStatus_ =
    DeleteSnapshotResponse'
    { _dsrsSnapshotId = Nothing
    , _dsrsResponseStatus = pResponseStatus_
    }
dsrsSnapshotId :: Lens' DeleteSnapshotResponse (Maybe Text)
dsrsSnapshotId = lens _dsrsSnapshotId (\ s a -> s{_dsrsSnapshotId = a});
dsrsResponseStatus :: Lens' DeleteSnapshotResponse Int
dsrsResponseStatus = lens _dsrsResponseStatus (\ s a -> s{_dsrsResponseStatus = a});