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

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

import javax.annotation.Nonnull;

@JsonSerialize
public class RestAnalyticsSettings extends RestMapEntity {
    public static final String CAN_COLLECT_ANALYTICS = "canCollectAnalytics";
    public static final String SERVICE_ENTITLEMENT_NUMBER = "serviceEntitlementNumber";

    // for Jackson
    @SuppressWarnings("UnusedDeclaration")
    public RestAnalyticsSettings() {
    }

    public RestAnalyticsSettings(boolean canCollectAnalytics, String supportEntitlementNumber) {
        put(CAN_COLLECT_ANALYTICS, canCollectAnalytics);
        put(SERVICE_ENTITLEMENT_NUMBER, supportEntitlementNumber);
    }

    @Nonnull
    public Boolean canCollectAnalytics() {
        return getBoolProperty(CAN_COLLECT_ANALYTICS);
    }

    @Nonnull
    public String getSupportEntitlementNumber() {
        return getStringProperty(SERVICE_ENTITLEMENT_NUMBER);
    }

    public static final RestAnalyticsSettings RESPONSE_EXAMPLE = new RestAnalyticsSettings(true, "SEN-500");
}
