com.dingtalk.api.request.OapiMessageSendToConversationRequest Maven / Gradle / Ivy
The newest version!
package com.dingtalk.api.request;
import java.util.List;
import com.taobao.api.internal.mapping.ApiField;
import com.taobao.api.internal.mapping.ApiListField;
import com.taobao.api.internal.util.json.JSONValidatingReader;
import com.taobao.api.TaobaoObject;
import java.util.Map;
import java.util.List;
import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.dingtalk.api.DingTalkConstants;
import com.taobao.api.Constants;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.internal.util.TaobaoUtils;
import com.taobao.api.internal.util.json.JSONWriter;
import com.dingtalk.api.response.OapiMessageSendToConversationResponse;
/**
* TOP DingTalk-API: dingtalk.oapi.message.send_to_conversation request
*
* @author top auto create
* @since 1.0, 2019.12.16
*/
public class OapiMessageSendToConversationRequest extends BaseTaobaoRequest {
/**
* ActionCard消息
*/
private String actionCard;
/**
* 群消息或者个人聊天会话Id,(通过JSAPI之pickConversation接口唤起联系人界面选择之后即可拿到会话ID,之后您可以使用获取到的cid调用此接口)
*/
private String cid;
/**
* file消息
*/
private String file;
/**
* image消息
*/
private String image;
/**
* link消息
*/
private String link;
/**
* markdown消息
*/
private String markdown;
/**
* 消息内容
*/
private String msg;
/**
* 消息类型
*/
private String msgtype;
/**
* OA消息
*/
private String oa;
/**
* 消息发送者员工ID
*/
private String sender;
/**
* text消息
*/
private String text;
/**
* voice消息
*/
private String voice;
public void setActionCard(String actionCard) {
this.actionCard = actionCard;
}
public void setActionCard(ActionCard actionCard) {
this.actionCard = new JSONWriter(false,false,true).write(actionCard);
}
public String getActionCard() {
return this.actionCard;
}
public void setCid(String cid) {
this.cid = cid;
}
public String getCid() {
return this.cid;
}
public void setFile(String file) {
this.file = file;
}
public void setFile(File file) {
this.file = new JSONWriter(false,false,true).write(file);
}
public String getFile() {
return this.file;
}
public void setImage(String image) {
this.image = image;
}
public void setImage(Image image) {
this.image = new JSONWriter(false,false,true).write(image);
}
public String getImage() {
return this.image;
}
public void setLink(String link) {
this.link = link;
}
public void setLink(Link link) {
this.link = new JSONWriter(false,false,true).write(link);
}
public String getLink() {
return this.link;
}
public void setMarkdown(String markdown) {
this.markdown = markdown;
}
public void setMarkdown(Markdown markdown) {
this.markdown = new JSONWriter(false,false,true).write(markdown);
}
public String getMarkdown() {
return this.markdown;
}
public void setMsg(String msg) {
this.msg = msg;
}
public void setMsg(Msg msg) {
this.msg = new JSONWriter(false,false,true).write(msg);
}
public String getMsg() {
return this.msg;
}
public void setMsgtype(String msgtype) {
this.msgtype = msgtype;
}
public String getMsgtype() {
return this.msgtype;
}
public void setOa(String oa) {
this.oa = oa;
}
public void setOa(Oa oa) {
this.oa = new JSONWriter(false,false,true).write(oa);
}
public String getOa() {
return this.oa;
}
public void setSender(String sender) {
this.sender = sender;
}
public String getSender() {
return this.sender;
}
public void setText(String text) {
this.text = text;
}
public void setText(Text text) {
this.text = new JSONWriter(false,false,true).write(text);
}
public String getText() {
return this.text;
}
public void setVoice(String voice) {
this.voice = voice;
}
public void setVoice(Voice voice) {
this.voice = new JSONWriter(false,false,true).write(voice);
}
public String getVoice() {
return this.voice;
}
public String getApiMethodName() {
return "dingtalk.oapi.message.send_to_conversation";
}
private String topResponseType = Constants.RESPONSE_TYPE_DINGTALK_OAPI;
public String getTopResponseType() {
return this.topResponseType;
}
public void setTopResponseType(String topResponseType) {
this.topResponseType = topResponseType;
}
public String getTopApiCallType() {
return DingTalkConstants.CALL_TYPE_OAPI;
}
private String topHttpMethod = DingTalkConstants.HTTP_METHOD_POST;
public String getTopHttpMethod() {
return this.topHttpMethod;
}
public void setTopHttpMethod(String topHttpMethod) {
this.topHttpMethod = topHttpMethod;
}
public void setHttpMethod(String httpMethod) {
this.setTopHttpMethod(httpMethod);
}
public Map getTextParams() {
TaobaoHashMap txtParams = new TaobaoHashMap();
txtParams.put("action_card", this.actionCard);
txtParams.put("cid", this.cid);
txtParams.put("file", this.file);
txtParams.put("image", this.image);
txtParams.put("link", this.link);
txtParams.put("markdown", this.markdown);
txtParams.put("msg", this.msg);
txtParams.put("msgtype", this.msgtype);
txtParams.put("oa", this.oa);
txtParams.put("sender", this.sender);
txtParams.put("text", this.text);
txtParams.put("voice", this.voice);
if(this.udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public Class getResponseClass() {
return OapiMessageSendToConversationResponse.class;
}
public void check() throws ApiRuleException {
}
/**
* markdown消息
*
* @author top auto create
* @since 1.0, null
*/
public static class Markdown extends TaobaoObject {
private static final long serialVersionUID = 2472719537989961989L;
/**
* markdown格式的消息
*/
@ApiField("text")
private String text;
/**
* 首屏会话透出的展示内容
*/
@ApiField("title")
private String title;
public String getText() {
return this.text;
}
public void setText(String text) {
this.text = text;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
}
/**
* 消息体的表单,最多显示6个,超过会被隐藏
*
* @author top auto create
* @since 1.0, null
*/
public static class Form extends TaobaoObject {
private static final long serialVersionUID = 6689164174263964424L;
/**
* 消息体的关键字对应的值
*/
@ApiField("key")
private String key;
/**
* 消息体的关键字
*/
@ApiField("value")
private String value;
public String getKey() {
return this.key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return this.value;
}
public void setValue(String value) {
this.value = value;
}
}
/**
* 单行富文本信息
*
* @author top auto create
* @since 1.0, null
*/
public static class Rich extends TaobaoObject {
private static final long serialVersionUID = 8432289494137644913L;
/**
* 单行富文本信息的数目
*/
@ApiField("num")
private String num;
/**
* 单行富文本信息的单位
*/
@ApiField("unit")
private String unit;
public String getNum() {
return this.num;
}
public void setNum(String num) {
this.num = num;
}
public String getUnit() {
return this.unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
}
/**
* 消息体
*
* @author top auto create
* @since 1.0, null
*/
public static class Body extends TaobaoObject {
private static final long serialVersionUID = 1477515691712412357L;
/**
* 自定义的作者名字
*/
@ApiField("author")
private String author;
/**
* 消息体的内容,最多显示3行
*/
@ApiField("content")
private String content;
/**
* 自定义的附件数目。此数字仅供显示,钉钉不作验证
*/
@ApiField("file_count")
private String fileCount;
/**
* 消息体的表单,最多显示6个,超过会被隐藏
*/
@ApiListField("form")
@ApiField("form")
private List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy