using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using Top.Api.Util;
using Top.Api;
using Top.Api.DingTalk;
namespace DingTalk.Api.Request
{
///
/// TOP API: dingtalk.corp.chatbot.install
///
public class CorpChatbotInstallRequest : BaseDingTalkRequest
{
///
/// 安装的机器人信息
///
public string ChatbotVo { get; set; }
public ChatbotVoDomain ChatbotVo_ { set { this.ChatbotVo = TopUtils.ObjectToJson(value); } }
#region IDingTalkRequest Members
public override string GetApiName()
{
return "dingtalk.corp.chatbot.install";
}
public override string GetApiCallType()
{
return DingTalkConstants.CALL_TYPE_TOP;
}
public override IDictionary GetParameters()
{
TopDictionary parameters = new TopDictionary();
parameters.Add("chatbot_vo", this.ChatbotVo);
if (this.otherParams != null)
{
parameters.AddAll(this.otherParams);
}
return parameters;
}
public override void Validate()
{
RequestValidator.ValidateRequired("chatbot_vo", this.ChatbotVo);
}
///
/// ChatbotVoDomain Data Structure.
///
[Serializable]
public class ChatbotVoDomain : TopObject
{
///
/// 0-正常,1-只服务端可管理
///
[XmlElement("authority")]
public Nullable Authority { get; set; }
///
/// 2-企业对内机器人,3-企业对外机器人
///
[XmlElement("bot_type")]
public Nullable BotType { get; set; }
///
/// 机器人简介
///
[XmlElement("breif")]
public string Breif { get; set; }
///
/// 机器人id(钉钉分配)
///
[XmlElement("chatbot_id")]
public string ChatbotId { get; set; }
///
/// 机器详细介绍
///
[XmlElement("description")]
public string Description { get; set; }
///
/// INCOMING = 1,OUTGOING = 2,INOUT = 3
///
[XmlElement("function")]
public Nullable Function { get; set; }
///
/// 机器人头像mediaId
///
[XmlElement("icon")]
public string Icon { get; set; }
///
/// 向群添加机器人时是否可改头像:0-不可必,1-可改
///
[XmlElement("icon_mdify")]
public Nullable IconMdify { get; set; }
///
/// 手机端是否能添加机器人:0-移动端不能加,1-移动端能添加
///
[XmlElement("mobile_switch")]
public Nullable MobileSwitch { get; set; }
///
/// 机器人的名字
///
[XmlElement("name")]
public string Name { get; set; }
///
/// 向群添加机器人时是否可改名字:0-不可必,1-可改
///
[XmlElement("name_modify")]
public Nullable NameModify { get; set; }
///
/// 是否支持单聊:0-不要单聊,1需要单聊
///
[XmlElement("oto_support")]
public Nullable OtoSupport { get; set; }
///
/// 机器人消息回调时在header中添加的token,用于对钉钉鉴权
///
[XmlElement("outgoing_token")]
public string OutgoingToken { get; set; }
///
/// 机器人回调URL
///
[XmlElement("outgoing_url")]
public string OutgoingUrl { get; set; }
///
/// 机器人预览图
///
[XmlElement("preview_media_id")]
public string PreviewMediaId { get; set; }
}
#endregion
}
}