Skip to content

Commit

Permalink
Add missing voice call button type
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardoGiordano authored and Bindambc committed May 7, 2024
1 parent 9a50d4b commit e481eb7
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);
}

Check warning on line 17 in src/main/java/com/whatsapp/api/domain/templates/VoiceCallButton.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/whatsapp/api/domain/templates/VoiceCallButton.java#L16-L17

Added lines #L16 - L17 were not covered by tests

/**
* Instantiates a new Quick reply button.
*
* @param text the text
*/
public VoiceCallButton(String text) {
super(ButtonType.VOICE_CALL, text);
}

Check warning on line 26 in src/main/java/com/whatsapp/api/domain/templates/VoiceCallButton.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/com/whatsapp/api/domain/templates/VoiceCallButton.java#L25-L26

Added lines #L25 - L26 were not covered by tests
}
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 e481eb7

Please sign in to comment.