package com.atlassian.bitbucket.internal.branch.rest;

import com.atlassian.bitbucket.rest.RestMapEntity;
import org.codehaus.jackson.map.annotate.JsonSerialize;

@JsonSerialize
public class RestBranchDeleteRequest extends RestMapEntity {
    public static final String END_POINT = "endPoint";
    public static final String NAME = "name";
    public static final String DRY_RUN = "dryRun";

    @SuppressWarnings("unused") //Required for Jersey
    public RestBranchDeleteRequest() {
    }

    // Required for REST documentation
    private RestBranchDeleteRequest(String name, String endPoint, boolean dryRun) {
        putIfNotNull(NAME, name);
        putIfNotNull(END_POINT, endPoint);
        put(DRY_RUN, dryRun);
    }

    public String getEndPoint() {
        return getStringProperty(END_POINT);
    }

    public String getName() {
        return getStringProperty(NAME);
    }

    public boolean isDryRun() {
        return getBoolProperty(DRY_RUN, false);
    }

    // REST Documentation Examples

    public static final RestBranchDeleteRequest EXAMPLE = new RestBranchDeleteRequest("refs/heads/my-branch",
            null, false);
}
