From e08ae1feca4dd1330633c7ceb8bb76b89f6ceead Mon Sep 17 00:00:00 2001 From: Jeremy Massel <1123407+jkmassel@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:51:39 -0700 Subject: [PATCH] Fix Detekt issues --- .../fluxc/network/rest/wpapi/WPcomLoginClient.kt | 2 +- .../WPcomAuthorizationCodeResponse.kt | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpapi/WPcomLoginClient.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpapi/WPcomLoginClient.kt index 7104eee54a75..8ae0f0f8814b 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpapi/WPcomLoginClient.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpapi/WPcomLoginClient.kt @@ -63,7 +63,7 @@ class WPcomLoginClient @Inject constructor( } else { val json = response.body?.string() ?: return@withContext Result.failure(WPcomLoginError.InvalidResponse) val gson = Gson().fromJson(json, WPcomAuthorizationCodeResponse::class.java) - Result.success(gson.access_token) + Result.success(gson.accessToken) } } } diff --git a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpapi/applicationpasswords/WPcomAuthorizationCodeResponse.kt b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpapi/applicationpasswords/WPcomAuthorizationCodeResponse.kt index 6b604e78beb5..0a4f368b9420 100644 --- a/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpapi/applicationpasswords/WPcomAuthorizationCodeResponse.kt +++ b/libs/fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpapi/applicationpasswords/WPcomAuthorizationCodeResponse.kt @@ -1,9 +1,11 @@ package org.wordpress.android.fluxc.network.rest.wpapi.applicationpasswords +import com.google.gson.annotations.SerializedName + data class WPcomAuthorizationCodeResponse( - val access_token: String, - val token_type: String, - val blog_id: String, - val blog_url: String, + @SerializedName("access_token") val accessToken: String, + @SerializedName("token_type") val tokenType: String, + @SerializedName("blog_id") val blogId: String, + @SerializedName("blog_url") val blogUrl: String, val scope: String )