package com.atlassian.bitbucket.mesh.repository;

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

import javax.annotation.Nonnull;

public enum DataStoreType {

    MANAGED,
    BITBUCKET,
    PATH;

    @Nonnull
    public RpcDataStore.Type toRpc() {
        switch (this) {
            case BITBUCKET:
                return RpcDataStore.Type.BITBUCKET;
            case MANAGED:
                return RpcDataStore.Type.MANAGED;
            case PATH:
                return RpcDataStore.Type.PATH;
            default:
                throw new RuntimeException("Cannot translate type " + this + " to RPC type");
        }
    }
}
