package com.atlassian.bitbucket.mesh.git.hosting;

import com.atlassian.bitbucket.mesh.rpc.v1.RpcHostingOperationType;

import javax.annotation.Nonnull;

/**
 * Represents the different hosting operations that are supported.
 */
public enum HostingOperationType {

    ARCHIVE(RpcHostingOperationType.HOSTING_OP_ARCHIVE),
    CAPABILITIES(RpcHostingOperationType.HOSTING_OP_CAPABILITIES),
    CLONE(RpcHostingOperationType.HOSTING_OP_CLONE),
    FETCH(RpcHostingOperationType.HOSTING_OP_FETCH),
    PUSH(RpcHostingOperationType.HOSTING_OP_PUSH),
    REF_ADVERTISEMENT(RpcHostingOperationType.HOSTING_OP_REF_ADVERTISEMENT),
    SHALLOW_CLONE(RpcHostingOperationType.HOSTING_OP_SHALLOW_CLONE),
    SHALLOW_FETCH(RpcHostingOperationType.HOSTING_OP_SHALLOW_FETCH);

    private final RpcHostingOperationType rpc;

    HostingOperationType(@Nonnull RpcHostingOperationType rpc) {
        this.rpc = rpc;
    }

    @Nonnull
    public RpcHostingOperationType toRpc() {
        return rpc;
    }
}
