001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.data.oauth;
003
004import java.util.Optional;
005import java.util.function.Consumer;
006
007/**
008 * Interface for OAuth authorization classes
009 * @author Taylor Smock
010 * @since 18650
011 */
012@FunctionalInterface
013public interface IOAuthAuthorization {
014    /**
015     * Perform the authorization dance
016     * @param parameters The OAuth parameters
017     * @param consumer The callback for the generated token
018     * @param scopes The scopes to ask for
019     */
020    void authorize(IOAuthParameters parameters, Consumer<Optional<IOAuthToken>> consumer, Enum<?>... scopes);
021}