diff --git a/src/main/java/com/vonage/client/voice/TalkPayload.java b/src/main/java/com/vonage/client/voice/TalkPayload.java index 17f9eb0d2..c0beff9a8 100644 --- a/src/main/java/com/vonage/client/voice/TalkPayload.java +++ b/src/main/java/com/vonage/client/voice/TalkPayload.java @@ -32,14 +32,16 @@ * {@code style}: The Vocal Style to use (vocal Range, tessitura, timbre to use in the TTS */ -@JsonInclude(JsonInclude.Include.NON_NULL) public class TalkPayload { private String text; private int loop; private TextToSpeechLanguage language; - private int style; + + @JsonInclude(JsonInclude.Include.NON_NULL) + private Integer style = null; @Deprecated + @JsonInclude(JsonInclude.Include.NON_NULL) private VoiceName voiceName; @Deprecated @@ -70,14 +72,17 @@ public String getText() { return text; } - @JsonProperty(value = "voice_name",defaultValue = "") + @JsonProperty(value = "voice_name") + @JsonInclude(JsonInclude.Include.NON_NULL) public VoiceName getVoiceName() { return voiceName; } + @JsonInclude(JsonInclude.Include.NON_NULL) public TextToSpeechLanguage getLanguage() { return language; } - public int getStyle() { return style; } + @JsonInclude(JsonInclude.Include.NON_NULL) + public Integer getStyle() { return style; } public String toJson() { try { diff --git a/src/test/java/com/vonage/client/voice/TalkPayloadTest.java b/src/test/java/com/vonage/client/voice/TalkPayloadTest.java index b5731feac..7775ce044 100644 --- a/src/test/java/com/vonage/client/voice/TalkPayloadTest.java +++ b/src/test/java/com/vonage/client/voice/TalkPayloadTest.java @@ -31,7 +31,7 @@ public void getLanguage() throws Exception { @Test public void getStyle() throws Exception{ - assertEquals(2,payload.getStyle()); + assertEquals(new Integer(2),payload.getStyle()); } @Test