package com.atlassian.stash.internal.rest;

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

import java.util.LinkedHashMap;

/**
 * @since 3.2
 */
public class RestMaintenanceLock extends LinkedHashMap<String, Object> {

    public RestMaintenanceLock(MaintenanceLock lock, boolean includeToken) {
        if (includeToken) {
            put("unlockToken", lock.getUnlockToken());
        }
        put("owner", new RestOwner(lock.getOwner()));
    }
}
