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.oapi.dingmi.robot.update /// public class OapiDingmiRobotUpdateRequest : BaseDingTalkRequest { /// /// 服务号(1) | 群(2) /// public string Type { get; set; } /// /// 系统自动生成 /// public string UpdateBotModel { get; set; } public UpdateBotRequestDTODomain UpdateBotModel_ { set { this.UpdateBotModel = TopUtils.ObjectToJson(value); } } #region IDingTalkRequest Members public override string GetApiName() { return "dingtalk.oapi.dingmi.robot.update"; } public override string GetApiCallType() { return DingTalkConstants.CALL_TYPE_OAPI; } public override IDictionary GetParameters() { TopDictionary parameters = new TopDictionary(); parameters.Add("type", this.Type); parameters.Add("update_bot_model", this.UpdateBotModel); if (this.otherParams != null) { parameters.AddAll(this.otherParams); } return parameters; } public override void Validate() { RequestValidator.ValidateRequired("type", this.Type); RequestValidator.ValidateRequired("update_bot_model", this.UpdateBotModel); } /// /// UpdateBotRequestDTODomain Data Structure. /// [Serializable] public class UpdateBotRequestDTODomain : TopObject { /// /// 头像资源ID /// [XmlElement("avatar")] public string Avatar { get; set; } /// /// 机器人简介描述 /// [XmlElement("brief")] public string Brief { get; set; } /// /// 对机器人的描述 /// [XmlElement("description")] public string Description { get; set; } /// /// 机器人名称 /// [XmlElement("name")] public string Name { get; set; } /// /// 预览图资源地址 /// [XmlElement("preview_media_url")] public string PreviewMediaUrl { get; set; } } #endregion } }