package com.atlassian.stash.internal.web.maintenance;

import com.atlassian.stash.internal.maintenance.MaintenanceStatus;

import java.util.LinkedHashMap;

public class RestMaintenanceStatus extends LinkedHashMap<String, Object> {
    public RestMaintenanceStatus(MaintenanceStatus maintenanceStatus) {
        put("task", maintenanceStatus.getLatestTask() == null ? null : new RestMaintenanceTaskStatus(maintenanceStatus.getLatestTask()));
        put("db-state", maintenanceStatus.getDatabaseState());
        put("scm-state", maintenanceStatus.getScmState());
    }
}
