Last active
February 1, 2019 01:12
-
-
Save apkelly/9f093bcf50713ea690d49c41eb2bb676 to your computer and use it in GitHub Desktop.
CloudAutoMLViewModel.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun getRESTService(): CloudAutoMLService { | |
val gsonFactory = GsonConverterFactory | |
.create(GsonBuilder().create()) | |
val networkClient = OkHttpClient.Builder() | |
.addInterceptor(HttpLoggingInterceptor().apply { | |
level = HttpLoggingInterceptor.Level.BODY | |
}) | |
.build() | |
return Retrofit.Builder() | |
.baseUrl("https://automl.googleapis.com/") | |
.addCallAdapterFactory(CoroutineCallAdapterFactory()) | |
.addConverterFactory(gsonFactory) | |
.client(networkClient) | |
.build() | |
.create(CloudAutoMLService::class.java) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment