public Uri toUri()

in auth-lib/src/main/java/com/spotify/sdk/android/auth/AuthorizationRequest.java [199:227]


    public Uri toUri() {
        Uri.Builder uriBuilder = new Uri.Builder();
        uriBuilder.scheme(ACCOUNTS_SCHEME)
                .authority(ACCOUNTS_AUTHORITY)
                .appendPath(ACCOUNTS_PATH)
                .appendQueryParameter(AccountsQueryParameters.CLIENT_ID, mClientId)
                .appendQueryParameter(AccountsQueryParameters.RESPONSE_TYPE, mResponseType)
                .appendQueryParameter(AccountsQueryParameters.REDIRECT_URI, mRedirectUri)
                .appendQueryParameter(AccountsQueryParameters.SHOW_DIALOG, String.valueOf(mShowDialog))
                .appendQueryParameter(AccountsQueryParameters.UTM_SOURCE, getSource())
                .appendQueryParameter(AccountsQueryParameters.UTM_MEDIUM, getMedium())
                .appendQueryParameter(AccountsQueryParameters.UTM_CAMPAIGN, getCampaign());

        if (mScopes != null && mScopes.length > 0) {
            uriBuilder.appendQueryParameter(AccountsQueryParameters.SCOPE, scopesToString());
        }

        if (mState != null) {
            uriBuilder.appendQueryParameter(AccountsQueryParameters.STATE, mState);
        }

        if (mCustomParams.size() > 0) {
            for (Map.Entry<String, String> entry : mCustomParams.entrySet()) {
                uriBuilder.appendQueryParameter(entry.getKey(), entry.getValue());
            }
        }

        return uriBuilder.build();
    }