Skip to content

Commit

Permalink
Merge pull request #173 from BernardoGiordano/voice-call-button
Browse files Browse the repository at this point in the history
Add missing voice call button type
  • Loading branch information
Bindambc authored May 8, 2024
2 parents 5fe2e29 + 27bcacc commit 3e79f3b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/whatsapp/api/domain/templates/Button.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = As.EXISTING_PROPERTY, property = "type")
@JsonSubTypes({@JsonSubTypes.Type(value = PhoneNumberButton.class, name = "PHONE_NUMBER"),//
@JsonSubTypes.Type(value = UrlButton.class, name = "URL"), //
@JsonSubTypes.Type(value = QuickReplyButton.class, name = "QUICK_REPLY")})
@JsonSubTypes.Type(value = QuickReplyButton.class, name = "QUICK_REPLY"), //
@JsonSubTypes.Type(value = VoiceCallButton.class, name = "VOICE_CALL")})
public class Button {

private ButtonType type;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.whatsapp.api.domain.templates;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.whatsapp.api.domain.templates.type.ButtonType;

/**
* The type Voice call button.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class VoiceCallButton extends Button {

/**
* Instantiates a new Voice call button.
*/
protected VoiceCallButton() {
super(ButtonType.VOICE_CALL);
}

/**
* Instantiates a new Quick reply button.
*
* @param text the text
*/
public VoiceCallButton(String text) {
super(ButtonType.VOICE_CALL, text);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ public enum ButtonType {
/**
* Quick reply button type.
*/
QUICK_REPLY
QUICK_REPLY,
/**
* Voice call button type.
*/
VOICE_CALL;
}

0 comments on commit 3e79f3b

Please sign in to comment.