|
15 | 15 | import com.translated.lara.net.json.AudioStatusTypeAdapter; |
16 | 16 | import com.translated.lara.net.json.DocumentStatusTypeAdapter; |
17 | 17 | import com.translated.lara.net.json.TextResultValueTypeAdapter; |
| 18 | +import com.translated.lara.net.json.VoiceGenderTypeAdapter; |
18 | 19 | import com.translated.lara.translator.Audio; |
19 | 20 | import com.translated.lara.translator.Document; |
20 | 21 | import com.translated.lara.translator.TextResult; |
| 22 | +import com.translated.lara.translator.VoiceGender; |
21 | 23 |
|
22 | 24 | import javax.crypto.Mac; |
23 | 25 | import javax.crypto.spec.SecretKeySpec; |
@@ -46,6 +48,7 @@ public class LaraClient { |
46 | 48 | .registerTypeAdapter(TextResult.Value.class, new TextResultValueTypeAdapter()) |
47 | 49 | .registerTypeAdapter(Document.Status.class, new DocumentStatusTypeAdapter()) |
48 | 50 | .registerTypeAdapter(Audio.Status.class, new AudioStatusTypeAdapter()) |
| 51 | + .registerTypeAdapter(VoiceGender.class, new VoiceGenderTypeAdapter()) |
49 | 52 | .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) |
50 | 53 | .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") |
51 | 54 | .create(); |
@@ -384,7 +387,7 @@ private AuthToken authenticate(AccessKey accessKey) throws LaraException { |
384 | 387 | AuthenticationResponse authResponse = response.as(AuthenticationResponse.class); |
385 | 388 |
|
386 | 389 | if (authResponse == null || authResponse.getToken() == null || authResponse.getToken().isEmpty()) { |
387 | | - throw new LaraApiConnectionException("Missing access token in authentication response: " + response.toString()); |
| 390 | + throw new LaraApiConnectionException("Missing access token in authentication response: " + response); |
388 | 391 | } |
389 | 392 |
|
390 | 393 | String refreshToken = connection.getHeaderField("x-lara-refresh-token"); |
|
0 commit comments