// Path: postcard/src/main/java/org/scribe/oauth/OAuth20PostServiceImpl.java
// public class OAuth20PostServiceImpl extends OAuth20ServiceImpl{
// 
//     private static final String VERSION = "2.0";
//     private final DefaultApi20 api;
//     private final OAuthConfig config;
// 
//     public OAuth20PostServiceImpl(DefaultApi20 api, OAuthConfig config) {
//         super(api, config);
//         this.api = api;
//         this.config = config;
//     }
// 
//     @Override
//     public Token getAccessToken(Token requestToken, Verifier verifier)
//     {
//         OAuthRequest request = new OAuthRequest(api.getAccessTokenVerb(), api.getAccessTokenEndpoint());
//         request.addBodyParameter(OAuthConstants.CLIENT_ID, config.getApiKey());
//         request.addBodyParameter(OAuthConstants.CLIENT_SECRET, config.getApiSecret());
//         request.addBodyParameter(OAuthConstants.CODE, verifier.getValue());
//         request.addBodyParameter(OAuthConstants.REDIRECT_URI, config.getCallback());
//         request.addBodyParameter("grant_type", "authorization_code");
//         if(config.hasScope()) request.addBodyParameter(OAuthConstants.SCOPE, config.getScope());
// 
//         Log.d("Oauth20PostImple", request.getBodyContents());
// 
//         Response response = request.send();
//         return api.getAccessTokenExtractor().extract(response.getBody());
//     }
// 
// }


import org.scribe.extractors.*;
import org.scribe.model.*;
import org.scribe.oauth.OAuth20PostServiceImpl;
import org.scribe.oauth.OAuthService;
import org.scribe.utils.*;
package org.scribe.builder.api;



public class BufferApi extends DefaultApi20
{
    private static final String AUTHORIZE_URL = "https://bufferapp.com/oauth2/authorize?response_type=code&client_id=%s&redirect_uri=%s";
    private static final String SCOPED_AUTHORIZE_URL = AUTHORIZE_URL + "&scope=%s";

    @Override
    public OAuthService createService(OAuthConfig config)
    {
// Path: postcard/src/main/java/org/scribe/oauth/OAuth20PostServiceImpl.java
// public class OAuth20PostServiceImpl extends OAuth20ServiceImpl{
// 
//     private static final String VERSION = "2.0";
//     private final DefaultApi20 api;
//     private final OAuthConfig config;
// 
//     public OAuth20PostServiceImpl(DefaultApi20 api, OAuthConfig config) {
//         super(api, config);
//         this.api = api;
//         this.config = config;
//     }
// 
//     @Override
//     public Token getAccessToken(Token requestToken, Verifier verifier)
//     {
//         OAuthRequest request = new OAuthRequest(api.getAccessTokenVerb(), api.getAccessTokenEndpoint());
//         request.addBodyParameter(OAuthConstants.CLIENT_ID, config.getApiKey());
//         request.addBodyParameter(OAuthConstants.CLIENT_SECRET, config.getApiSecret());
//         request.addBodyParameter(OAuthConstants.CODE, verifier.getValue());
//         request.addBodyParameter(OAuthConstants.REDIRECT_URI, config.getCallback());
//         request.addBodyParameter("grant_type", "authorization_code");
//         if(config.hasScope()) request.addBodyParameter(OAuthConstants.SCOPE, config.getScope());
// 
//         Log.d("Oauth20PostImple", request.getBodyContents());
// 
//         Response response = request.send();
//         return api.getAccessTokenExtractor().extract(response.getBody());
//     }
// 
// }


// Path: postcard/src/main/java/org/scribe/builder/api/BufferApi.java
import org.scribe.extractors.*;
import org.scribe.model.*;
import org.scribe.oauth.OAuth20PostServiceImpl;
import org.scribe.oauth.OAuthService;
import org.scribe.utils.*;

package org.scribe.builder.api;



public class BufferApi extends DefaultApi20
{
    private static final String AUTHORIZE_URL = "https://bufferapp.com/oauth2/authorize?response_type=code&client_id=%s&redirect_uri=%s";
    private static final String SCOPED_AUTHORIZE_URL = AUTHORIZE_URL + "&scope=%s";

    @Override
    public OAuthService createService(OAuthConfig config)
    {
        return new OAuth20PostServiceImpl(this, config);