package com.atlassian.bitbucket.internal.mirroring.mirror.rest.webhook.server;

import com.atlassian.bitbucket.internal.mirroring.mirror.rest.server.RestServerExternalProject;
import com.atlassian.bitbucket.internal.mirroring.mirror.webhook.ProjectModifiedWebHookEvent;
import com.atlassian.bitbucket.internal.mirroring.mirror.webhook.WebHookEventVisitor;

import javax.annotation.Nonnull;
import java.util.Map;

import static com.atlassian.bitbucket.internal.mirroring.mirror.rest.webhook.server.RestServerWebHookPropertyNames.NEW;

public class RestServerProjectModifiedWebHookEvent extends BaseRestServerProjectWebHookEvent implements ProjectModifiedWebHookEvent {
    public RestServerProjectModifiedWebHookEvent() {
    }

    public RestServerProjectModifiedWebHookEvent(Map<String, ?> values) {
        super(values);
    }

    @Override
    public <T> T visit(@Nonnull WebHookEventVisitor<T> visitor) {
        return visitor.accept(this);
    }

    @Override
    public RestServerExternalProject getProject() {
        return RestServerExternalProject.valueOf(get(NEW));
    }
}
