Skip to content

Commit

Permalink
add DocumentParameter、ImageParameter、VideoParameter
Browse files Browse the repository at this point in the history
  • Loading branch information
harmonyzhang committed May 10, 2023
1 parent fe47dea commit fa4ad30
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.whatsapp.api.domain.messages;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.whatsapp.api.domain.messages.type.ParameterType;

/**
* The type Document parameter.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DocumentParameter extends Parameter {

@JsonProperty("link")
private String link;
@JsonProperty("caption")
private String caption;
@JsonProperty("filename")
private String filename;


/**
* Instantiates a new Document parameter.
*
* @param link the link
* @param caption the caption
* @param filename the filename
*/
public DocumentParameter(String link, String caption, String filename) {
super(ParameterType.IMAGE);
this.link = link;
this.caption = caption;
this.filename = filename;
}

public String getLink() {
return link;
}

public String getCaption() {
return caption;
}

public String getFilename() {
return filename;
}
}
39 changes: 39 additions & 0 deletions src/main/java/com/whatsapp/api/domain/messages/ImageParameter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.whatsapp.api.domain.messages;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.whatsapp.api.domain.messages.type.ParameterType;

/**
* The type Image parameter.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ImageParameter extends Parameter {

@JsonProperty("link")
private String link;
@JsonProperty("caption")
private String caption;


/**
* Instantiates a new Image parameter.
*
* @param link the link
* @param caption the caption
*/
public ImageParameter(String link, String caption) {
super(ParameterType.IMAGE);
this.link = link;
this.caption = caption;
}

public String getLink() {
return link;
}

public String getCaption() {
return caption;
}

}
39 changes: 39 additions & 0 deletions src/main/java/com/whatsapp/api/domain/messages/VideoParameter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.whatsapp.api.domain.messages;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.whatsapp.api.domain.messages.type.ParameterType;

/**
* The type Video parameter.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class VideoParameter extends Parameter {

@JsonProperty("link")
private String link;
@JsonProperty("caption")
private String caption;


/**
* Instantiates a new Video parameter.
*
* @param link the link
* @param caption the caption
*/
public VideoParameter(String link, String caption) {
super(ParameterType.IMAGE);
this.link = link;
this.caption = caption;
}

public String getLink() {
return link;
}

public String getCaption() {
return caption;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ public enum ParameterType {
* Text parameter type.
*/
TEXT("text"),
/**
* Image parameter type.
*/
IMAGE("image"),
/**
* Video parameter type.
*/
VIDEO("video"),
/**
* Document parameter type.
*/
DOCUMENT("document"),
/**
* Currency parameter type.
*/
Expand Down

0 comments on commit fa4ad30

Please sign in to comment.