Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing voice call button type #173

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}