Skip to content

Commit 3e79f3b

Browse files
authored
Merge pull request #173 from BernardoGiordano/voice-call-button
Add missing voice call button type
2 parents 5fe2e29 + 27bcacc commit 3e79f3b

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

src/main/java/com/whatsapp/api/domain/templates/Button.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = As.EXISTING_PROPERTY, property = "type")
1414
@JsonSubTypes({@JsonSubTypes.Type(value = PhoneNumberButton.class, name = "PHONE_NUMBER"),//
1515
@JsonSubTypes.Type(value = UrlButton.class, name = "URL"), //
16-
@JsonSubTypes.Type(value = QuickReplyButton.class, name = "QUICK_REPLY")})
16+
@JsonSubTypes.Type(value = QuickReplyButton.class, name = "QUICK_REPLY"), //
17+
@JsonSubTypes.Type(value = VoiceCallButton.class, name = "VOICE_CALL")})
1718
public class Button {
1819

1920
private ButtonType type;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.whatsapp.api.domain.templates;
2+
3+
import com.fasterxml.jackson.annotation.JsonInclude;
4+
import com.whatsapp.api.domain.templates.type.ButtonType;
5+
6+
/**
7+
* The type Voice call button.
8+
*/
9+
@JsonInclude(JsonInclude.Include.NON_NULL)
10+
public class VoiceCallButton extends Button {
11+
12+
/**
13+
* Instantiates a new Voice call button.
14+
*/
15+
protected VoiceCallButton() {
16+
super(ButtonType.VOICE_CALL);
17+
}
18+
19+
/**
20+
* Instantiates a new Quick reply button.
21+
*
22+
* @param text the text
23+
*/
24+
public VoiceCallButton(String text) {
25+
super(ButtonType.VOICE_CALL, text);
26+
}
27+
}

src/main/java/com/whatsapp/api/domain/templates/type/ButtonType.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,9 @@ public enum ButtonType {
1515
/**
1616
* Quick reply button type.
1717
*/
18-
QUICK_REPLY
18+
QUICK_REPLY,
19+
/**
20+
* Voice call button type.
21+
*/
22+
VOICE_CALL;
1923
}

0 commit comments

Comments
 (0)