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

import com.atlassian.bitbucket.internal.mirroring.mirror.rest.cloud.RestCloudMinimalExternalRepository;
import com.atlassian.bitbucket.internal.mirroring.mirror.webhook.RepositoryWebHookEvent;
import javax.validation.constraints.NotNull;
import java.util.Map;

import static com.atlassian.bitbucket.internal.mirroring.mirror.rest.webhook.cloud.RestCloudWebHookPropertyNames.REPOSITORY;

public abstract class BaseRestCloudRepositoryWebHookEvent extends BaseRestCloudWebHookEvent implements RepositoryWebHookEvent {
    public BaseRestCloudRepositoryWebHookEvent() {
    }

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

    @Override
    @NotNull
    public RestCloudMinimalExternalRepository getRepository() {
        return RestCloudMinimalExternalRepository.valueOf(get(REPOSITORY));
    }
}
