package com.atlassian.bitbucket.internal.mirroring.mirror.nav;

import javax.annotation.Nonnull;

/**
 * Provides URLs for making calls to a
 * {@link com.atlassian.bitbucket.mirroring.mirror.UpstreamServerType#BITBUCKET_CLOUD Bitbucket Cloud} upstream server
 */
public interface CloudUpstreamNavBuilder extends UpstreamNavBuilder {

    /**
     * @param addonKey the key of the addon
     * @return the URL for checking the status of an addon
     */
    @Nonnull
    MirroringUrl addonStatus(@Nonnull String addonKey);

    @Nonnull
    OAuth2 oauth2();

    /**
     * @param limit the size of the page
     * @return URL for retrieving the first page of repositories on the upstream. Urls for subsequent pages are returned
     * as part of the response from the upstream
     */
    @Nonnull
    MirroringUrl repositories(int limit);

    /**
     * @param slug the repository slug
     * @return the URL for retrieving repository details on the upstream
     */
    @Nonnull
    MirroringUrl repositoryBySlug(@Nonnull String slug);

    /**
     * @param slug the repository slug
     * @return the URL for checking read permission on a slug
     */
    @Nonnull
    MirroringUrl repositoryPermissionBySlug(@Nonnull String slug);

    /**
     * @return the URL for retrieving the cloud account associated with the mirror
     */
    @Nonnull
    MirroringUrl account();

    interface OAuth2 {
        /**
         * @return the URL for obtaining an OAUTH2 access token
         */
        @Nonnull
        MirroringUrl accessToken();
    }
}
