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.smartwork.hrm.employee.v2.update
///
public class OapiSmartworkHrmEmployeeV2UpdateRequest : BaseDingTalkRequest
{
///
/// 微应用在企业的AgentId
///
public Nullable Agentid { get; set; }
///
/// 编辑花名册入参
///
public string Param { get; set; }
public EmpUpdateByCustomParamDomain Param_ { set { this.Param = TopUtils.ObjectToJson(value); } }
#region IDingTalkRequest Members
public override string GetApiName()
{
return "dingtalk.oapi.smartwork.hrm.employee.v2.update";
}
public override string GetApiCallType()
{
return DingTalkConstants.CALL_TYPE_OAPI;
}
public override IDictionary GetParameters()
{
TopDictionary parameters = new TopDictionary();
parameters.Add("agentid", this.Agentid);
parameters.Add("param", this.Param);
if (this.otherParams != null)
{
parameters.AddAll(this.otherParams);
}
return parameters;
}
public override void Validate()
{
RequestValidator.ValidateRequired("agentid", this.Agentid);
RequestValidator.ValidateRequired("param", this.Param);
}
///
/// EmpFieldVoDomain Data Structure.
///
[Serializable]
public class EmpFieldVoDomain : TopObject
{
///
/// 字段标识
///
[XmlElement("field_code")]
public string FieldCode { get; set; }
///
/// 字段值
///
[XmlElement("value")]
public string Value { get; set; }
}
///
/// EmpListFieldVoDomain Data Structure.
///
[Serializable]
public class EmpListFieldVoDomain : TopObject
{
///
/// 明细下标(注意:当传入该值时,表示当前传入的section为编辑员工花名册现有的第oldIndex条明细,此时系统会只编辑该条明细中传入的字段;当不传入该值时,表示传入的是新增明细,此时系统会保存该条明细传入的字段,未传字段会清空)
///
[XmlElement("old_index")]
public Nullable OldIndex { get; set; }
///
/// 分组下字段列表
///
[XmlArray("section")]
[XmlArrayItem("emp_field_vo")]
public List Section { get; set; }
}
///
/// EmpGroupFieldVoDomain Data Structure.
///
[Serializable]
public class EmpGroupFieldVoDomain : TopObject
{
///
/// 分组标识
///
[XmlElement("group_id")]
public string GroupId { get; set; }
///
/// 分组下明细(非明细分组仅一条明细)
///
[XmlArray("sections")]
[XmlArrayItem("emp_list_field_vo")]
public List Sections { get; set; }
}
///
/// EmpUpdateByCustomParamDomain Data Structure.
///
[Serializable]
public class EmpUpdateByCustomParamDomain : TopObject
{
///
/// 花名册分组
///
[XmlArray("groups")]
[XmlArrayItem("emp_group_field_vo")]
public List Groups { get; set; }
///
/// 员工userId
///
[XmlElement("userid")]
public string Userid { get; set; }
}
#endregion
}
}