package com.atlassian.bitbucket.mesh.git.builder.remote;

import javax.annotation.Nonnull;
import java.nio.file.Path;

public interface GitRemote {

    /**
     * @param name the name to assign the new remote
     * @param url  a repository path, which will be used as the new remote's URL
     * @return a builder to add a new remote
     */
    @Nonnull
    GitRemoteAddBuilder add(@Nonnull String name, @Nonnull Path url);

    /**
     * @param name the name to assign the new remote
     * @param url  a repository URL, which will be used as the new remote's URL
     * @return a builder to add a new remote
     */
    @Nonnull
    GitRemoteAddBuilder add(@Nonnull String name, @Nonnull String url);

    /**
     * @param name   the name of an existing remote
     * @return a builder to remove an existing remote
     */
    @Nonnull
    GitRemoteRmBuilder rm(@Nonnull String name);

    /**
     * @param name   the name of an existing remote
     * @param newUrl the new URL to set for the existing remote
     * @return a builder to set the URL for an existing remote
     */
    @Nonnull
    GitRemoteSetUrlBuilder setUrl(@Nonnull String name, @Nonnull Path newUrl);

    /**
     * @param name   the name of an existing remote
     * @param newUrl the new URL to set for the existing remote
     * @return a builder to set the URL for an existing remote
     */
    @Nonnull
    GitRemoteSetUrlBuilder setUrl(@Nonnull String name, @Nonnull String newUrl);
}
