// (C) Copyright 2020 Hewlett-Packard Enterprise Company, L.P.
define([ 'hp/services/REST','jquery'],
function(REST) {"use strict";

    var BackupStatusService = (function() {
        
        var API_VERSION = 100,
            OPTS = {apiVersion: API_VERSION};
        
        /**
         * @constructor Service for retrieval of backup status
         * @type {BackupService}
         */
            
        function BackupStatusService() {

            /**
             * Gets a simple paginated collection which contains a backup resource
             * with the status of the last backup(if any).
             *
             * @param {{success:function(SimplePaginatedCollection):void, error:function(ErrorMessage):void}
             *     handlers Handler functions for success and error conditions.
             */
            this.getLastBackupStatus = function(handlers) {
                REST.getURI('/rest/backups', handlers, OPTS);
            };
            
        }

        return new BackupStatusService();
    }());

    return BackupStatusService;
});