Search in sources :

Example 1 with DenvelopingConverter

use of io.plaidapp.data.api.DenvelopingConverter in project plaid by nickbutcher.

the class DesignerNewsPrefs method createApi.

private void createApi() {
    final OkHttpClient client = new OkHttpClient.Builder().addInterceptor(new ClientAuthInterceptor(accessToken, BuildConfig.DESIGNER_NEWS_CLIENT_ID)).build();
    final Gson gson = new Gson();
    api = new Retrofit.Builder().baseUrl(DesignerNewsService.ENDPOINT).client(client).addConverterFactory(new DenvelopingConverter(gson)).addConverterFactory(GsonConverterFactory.create(gson)).build().create(DesignerNewsService.class);
}
Also used : Retrofit(retrofit2.Retrofit) OkHttpClient(okhttp3.OkHttpClient) ClientAuthInterceptor(io.plaidapp.data.api.ClientAuthInterceptor) DesignerNewsService(io.plaidapp.data.api.designernews.DesignerNewsService) Gson(com.google.gson.Gson) DenvelopingConverter(io.plaidapp.data.api.DenvelopingConverter)

Example 2 with DenvelopingConverter

use of io.plaidapp.data.api.DenvelopingConverter in project plaid by nickbutcher.

the class BaseDataManager method createProductHuntApi.

private void createProductHuntApi() {
    final OkHttpClient client = new OkHttpClient.Builder().addInterceptor(new AuthInterceptor(BuildConfig.PROCUCT_HUNT_DEVELOPER_TOKEN)).build();
    final Gson gson = new Gson();
    productHuntApi = new Retrofit.Builder().baseUrl(ProductHuntService.ENDPOINT).client(client).addConverterFactory(new DenvelopingConverter(gson)).addConverterFactory(GsonConverterFactory.create(gson)).build().create(ProductHuntService.class);
}
Also used : Retrofit(retrofit2.Retrofit) OkHttpClient(okhttp3.OkHttpClient) ProductHuntService(io.plaidapp.data.api.producthunt.ProductHuntService) AuthInterceptor(io.plaidapp.data.api.AuthInterceptor) Gson(com.google.gson.Gson) DenvelopingConverter(io.plaidapp.data.api.DenvelopingConverter)

Example 3 with DenvelopingConverter

use of io.plaidapp.data.api.DenvelopingConverter in project plaid by nickbutcher.

the class DribbblePrefs method createApi.

private void createApi() {
    final OkHttpClient client = new OkHttpClient.Builder().addInterceptor(new AuthInterceptor(getAccessToken())).build();
    final Gson gson = new GsonBuilder().setDateFormat(DribbbleService.DATE_FORMAT).create();
    api = new Retrofit.Builder().baseUrl(DribbbleService.ENDPOINT).client(client).addConverterFactory(new DenvelopingConverter(gson)).addConverterFactory(GsonConverterFactory.create(gson)).build().create((DribbbleService.class));
}
Also used : Retrofit(retrofit2.Retrofit) OkHttpClient(okhttp3.OkHttpClient) GsonBuilder(com.google.gson.GsonBuilder) GsonBuilder(com.google.gson.GsonBuilder) AuthInterceptor(io.plaidapp.data.api.AuthInterceptor) Gson(com.google.gson.Gson) DenvelopingConverter(io.plaidapp.data.api.DenvelopingConverter)

Aggregations

Gson (com.google.gson.Gson)3 DenvelopingConverter (io.plaidapp.data.api.DenvelopingConverter)3 OkHttpClient (okhttp3.OkHttpClient)3 Retrofit (retrofit2.Retrofit)3 AuthInterceptor (io.plaidapp.data.api.AuthInterceptor)2 GsonBuilder (com.google.gson.GsonBuilder)1 ClientAuthInterceptor (io.plaidapp.data.api.ClientAuthInterceptor)1 DesignerNewsService (io.plaidapp.data.api.designernews.DesignerNewsService)1 ProductHuntService (io.plaidapp.data.api.producthunt.ProductHuntService)1