/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('aiccs', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model SendHotlineHeartBeatRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  token?: string(name='Token'),
}

model SendHotlineHeartBeatResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model SendHotlineHeartBeatResponse = {
  headers: map[string]string(name='headers'),
  body: SendHotlineHeartBeatResponseBody(name='body'),
}

async function sendHotlineHeartBeatWithOptions(request: SendHotlineHeartBeatRequest, runtime: Util.RuntimeOptions): SendHotlineHeartBeatResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SendHotlineHeartBeat', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function sendHotlineHeartBeat(request: SendHotlineHeartBeatRequest): SendHotlineHeartBeatResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendHotlineHeartBeatWithOptions(request, runtime);
}

model GetAiOutboundTaskBizDataRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  channelId?: string(name='ChannelId', description='入呼channelId'),
}

model GetAiOutboundTaskBizDataResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  data?: {
    caseId?: long(name='CaseId', description='id'),
    phoneNum?: string(name='PhoneNum', description='外呼号码'),
    bizData?: string(name='BizData', description='业务自定义信息'),
    taskId?: long(name='TaskId', description='任务ID'),
  }(name='Data', description='本次呼叫关联的业务信息'),
}

model GetAiOutboundTaskBizDataResponse = {
  headers: map[string]string(name='headers'),
  body: GetAiOutboundTaskBizDataResponseBody(name='body'),
}

async function getAiOutboundTaskBizDataWithOptions(request: GetAiOutboundTaskBizDataRequest, runtime: Util.RuntimeOptions): GetAiOutboundTaskBizDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetAiOutboundTaskBizData', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getAiOutboundTaskBizData(request: GetAiOutboundTaskBizDataRequest): GetAiOutboundTaskBizDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiOutboundTaskBizDataWithOptions(request, runtime);
}

model StartChatWorkRequest {
  instanceId?: string(name='InstanceId', description='instanceId'),
  accountName?: string(name='AccountName', description='accountName'),
}

model StartChatWorkResponseBody = {
  message?: string(name='Message', description='message'),
  requestId?: string(name='RequestId', description='requestId'),
  httpStatusCode?: int32(name='HttpStatusCode', description='httpStatusCode'),
  data?: string(name='Data', description='data'),
  code?: string(name='Code', description='code'),
  success?: boolean(name='Success', description='success'),
}

model StartChatWorkResponse = {
  headers: map[string]string(name='headers'),
  body: StartChatWorkResponseBody(name='body'),
}

async function startChatWorkWithOptions(request: StartChatWorkRequest, runtime: Util.RuntimeOptions): StartChatWorkResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StartChatWork', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function startChatWork(request: StartChatWorkRequest): StartChatWorkResponse {
  var runtime = new Util.RuntimeOptions{};
  return startChatWorkWithOptions(request, runtime);
}

model GetCallSoundRecordRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  createTime?: string(name='CreateTime'),
  callId?: string(name='CallId'),
}

model GetCallSoundRecordResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: string(name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model GetCallSoundRecordResponse = {
  headers: map[string]string(name='headers'),
  body: GetCallSoundRecordResponseBody(name='body'),
}

async function getCallSoundRecordWithOptions(request: GetCallSoundRecordRequest, runtime: Util.RuntimeOptions): GetCallSoundRecordResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetCallSoundRecord', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getCallSoundRecord(request: GetCallSoundRecordRequest): GetCallSoundRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCallSoundRecordWithOptions(request, runtime);
}

model DeleteAiOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  taskId?: long(name='TaskId', description='任务id'),
}

model DeleteAiOutboundTaskResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model DeleteAiOutboundTaskResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteAiOutboundTaskResponseBody(name='body'),
}

async function deleteAiOutboundTaskWithOptions(request: DeleteAiOutboundTaskRequest, runtime: Util.RuntimeOptions): DeleteAiOutboundTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteAiOutboundTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteAiOutboundTask(request: DeleteAiOutboundTaskRequest): DeleteAiOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAiOutboundTaskWithOptions(request, runtime);
}

model HangUpDoubleCallRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  acid?: string(name='Acid', description='会话ID'),
}

model HangUpDoubleCallResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='是否调用成功'),
  code?: string(name='Code', description='错误码'),
  message?: string(name='Message', description='错误信息'),
}

model HangUpDoubleCallResponse = {
  headers: map[string]string(name='headers'),
  body: HangUpDoubleCallResponseBody(name='body'),
}

async function hangUpDoubleCallWithOptions(request: HangUpDoubleCallRequest, runtime: Util.RuntimeOptions): HangUpDoubleCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('HangUpDoubleCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function hangUpDoubleCall(request: HangUpDoubleCallRequest): HangUpDoubleCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return hangUpDoubleCallWithOptions(request, runtime);
}

model UpdateAgentRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  displayName?: string(name='DisplayName'),
  skillGroupId?: [ long ](name='SkillGroupId'),
  skillGroupIdList?: [ long ](name='SkillGroupIdList'),
}

model UpdateAgentResponseBody = {
  httpStatusCode?: long(name='HttpStatusCode'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateAgentResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateAgentResponseBody(name='body'),
}

async function updateAgentWithOptions(request: UpdateAgentRequest, runtime: Util.RuntimeOptions): UpdateAgentResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateAgent', '2019-10-15', 'HTTPS', 'PUT', 'AK', 'json', req, runtime);
}

async function updateAgent(request: UpdateAgentRequest): UpdateAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAgentWithOptions(request, runtime);
}

model EditQualityRuleTagRequest {
  instanceId?: string(name='InstanceId'),
  analysisTypes?: [ 
    {
      name?: string(name='Name'),
      id?: long(name='Id'),
    }
  ](name='AnalysisTypes'),
}

model EditQualityRuleTagResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EditQualityRuleTagResponse = {
  headers: map[string]string(name='headers'),
  body: EditQualityRuleTagResponseBody(name='body'),
}

async function editQualityRuleTagWithOptions(request: EditQualityRuleTagRequest, runtime: Util.RuntimeOptions): EditQualityRuleTagResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('EditQualityRuleTag', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function editQualityRuleTag(request: EditQualityRuleTagRequest): EditQualityRuleTagResponse {
  var runtime = new Util.RuntimeOptions{};
  return editQualityRuleTagWithOptions(request, runtime);
}

model GetOnlineServiceVolumeRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIds?: [ long ](name='AgentIds', description='坐席id列表'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
  groupIds?: [ long ](name='GroupIds', description='技能组id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据坐席分组'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetOnlineServiceVolumeShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIdsShrink?: string(name='AgentIds', description='坐席id列表'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
  groupIdsShrink?: string(name='GroupIds', description='技能组id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据坐席分组'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetOnlineServiceVolumeResponseBody = {
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='调用接口是否成功'),
  data?: {
    pageNum?: int32(name='PageNum', description='当前页数'),
    pageSize?: int32(name='PageSize', description='页大小'),
    totalNum?: int32(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
}

model GetOnlineServiceVolumeResponse = {
  headers: map[string]string(name='headers'),
  body: GetOnlineServiceVolumeResponseBody(name='body'),
}

async function getOnlineServiceVolumeWithOptions(tmpReq: GetOnlineServiceVolumeRequest, runtime: Util.RuntimeOptions): GetOnlineServiceVolumeResponse {
  Util.validateModel(tmpReq);
  var request = new GetOnlineServiceVolumeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetOnlineServiceVolume', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getOnlineServiceVolume(request: GetOnlineServiceVolumeRequest): GetOnlineServiceVolumeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOnlineServiceVolumeWithOptions(request, runtime);
}

model DeleteOutboundTaskRequest {
  outboundTaskId?: long(name='OutboundTaskId'),
  instanceId?: string(name='InstanceId'),
}

model DeleteOutboundTaskResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteOutboundTaskResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteOutboundTaskResponseBody(name='body'),
}

async function deleteOutboundTaskWithOptions(request: DeleteOutboundTaskRequest, runtime: Util.RuntimeOptions): DeleteOutboundTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteOutboundTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteOutboundTask(request: DeleteOutboundTaskRequest): DeleteOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteOutboundTaskWithOptions(request, runtime);
}

model AddOuterAccountRequest {
  outerAccountId?: string(name='OuterAccountId'),
  outerAccountType?: string(name='OuterAccountType'),
  outerAccountName?: string(name='OuterAccountName'),
  avatar?: string(name='Avatar'),
  realName?: string(name='RealName'),
  outerDepartmentId?: string(name='OuterDepartmentId'),
  outerGroupIds?: string(name='OuterGroupIds'),
  ext?: string(name='Ext'),
  outerDepartmentType?: string(name='OuterDepartmentType'),
  outerGroupType?: string(name='OuterGroupType'),
}

model AddOuterAccountResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model AddOuterAccountResponse = {
  headers: map[string]string(name='headers'),
  body: AddOuterAccountResponseBody(name='body'),
}

async function addOuterAccountWithOptions(request: AddOuterAccountRequest, runtime: Util.RuntimeOptions): AddOuterAccountResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('AddOuterAccount', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function addOuterAccount(request: AddOuterAccountRequest): AddOuterAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return addOuterAccountWithOptions(request, runtime);
}

model AddHotlineNumberRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  hotlineNumber?: string(name='HotlineNumber', description='号码'),
  description?: string(name='Description', description='号码描述'),
  enableInbound?: boolean(name='EnableInbound', description='是否用于入呼'),
  inboundFlowId?: long(name='InboundFlowId', description='入呼ivr流程id'),
  enableOutbound?: boolean(name='EnableOutbound', description='是否用于外呼'),
  outboundAllDepart?: boolean(name='OutboundAllDepart', description='外呼是否对所有部门生效'),
  enableInboundEvaluation?: boolean(name='EnableInboundEvaluation', description='是否开启入呼满意度'),
  enableOutboundEvaluation?: boolean(name='EnableOutboundEvaluation', description='是否开启外呼满意度'),
  evaluationLevel?: int32(name='EvaluationLevel', description='满意度等级'),
  outboundRangeList?: [ 
    {
      departmentId?: long(name='DepartmentId', description='生效部门id'),
      groupIdList?: [ long ](name='GroupIdList', description='生效技能组列表（部门123下）'),
    }
  ](name='OutboundRangeList', description='外呼生效范围'),
}

model AddHotlineNumberShrinkRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  hotlineNumber?: string(name='HotlineNumber', description='号码'),
  description?: string(name='Description', description='号码描述'),
  enableInbound?: boolean(name='EnableInbound', description='是否用于入呼'),
  inboundFlowId?: long(name='InboundFlowId', description='入呼ivr流程id'),
  enableOutbound?: boolean(name='EnableOutbound', description='是否用于外呼'),
  outboundAllDepart?: boolean(name='OutboundAllDepart', description='外呼是否对所有部门生效'),
  enableInboundEvaluation?: boolean(name='EnableInboundEvaluation', description='是否开启入呼满意度'),
  enableOutboundEvaluation?: boolean(name='EnableOutboundEvaluation', description='是否开启外呼满意度'),
  evaluationLevel?: int32(name='EvaluationLevel', description='满意度等级'),
  outboundRangeListShrink?: string(name='OutboundRangeList', description='外呼生效范围'),
}

model AddHotlineNumberResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='接口调用是否成功'),
  code?: string(name='Code', description='错误码'),
  message?: string(name='Message', description='错误信息'),
  httpStatusCode?: long(name='HttpStatusCode', description='http状态码'),
}

model AddHotlineNumberResponse = {
  headers: map[string]string(name='headers'),
  body: AddHotlineNumberResponseBody(name='body'),
}

async function addHotlineNumberWithOptions(tmpReq: AddHotlineNumberRequest, runtime: Util.RuntimeOptions): AddHotlineNumberResponse {
  Util.validateModel(tmpReq);
  var request = new AddHotlineNumberShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.outboundRangeList)) {
    request.outboundRangeListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.outboundRangeList, 'OutboundRangeList', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AddHotlineNumber', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function addHotlineNumber(request: AddHotlineNumberRequest): AddHotlineNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return addHotlineNumberWithOptions(request, runtime);
}

model GetAgentByIdRequest {
  instanceId?: string(name='InstanceId'),
  agentId?: long(name='AgentId'),
}

model GetAgentByIdResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: {
    showName?: string(name='ShowName'),
    foreignKey?: string(name='ForeignKey'),
    servicerType?: int32(name='ServicerType'),
    realName?: string(name='RealName'),
    createUserName?: string(name='CreateUserName'),
    agentId?: int32(name='AgentId'),
    foreignNick?: string(name='ForeignNick'),
  }(name='Data'),
}

model GetAgentByIdResponse = {
  headers: map[string]string(name='headers'),
  body: GetAgentByIdResponseBody(name='body'),
}

async function getAgentByIdWithOptions(request: GetAgentByIdRequest, runtime: Util.RuntimeOptions): GetAgentByIdResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetAgentById', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getAgentById(request: GetAgentByIdRequest): GetAgentByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentByIdWithOptions(request, runtime);
}

model GetQualityRuleDetailRequest {
  instanceId?: string(name='InstanceId'),
  qualityRuleId?: long(name='QualityRuleId'),
}

model GetQualityRuleDetailResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: {
    ruleTag?: int32(name='RuleTag'),
    matchType?: int32(name='MatchType'),
    name?: string(name='Name'),
    ruleCreateTime?: string(name='RuleCreateTime'),
    ruleId?: long(name='RuleId'),
    keyWords?: [ string ](name='KeyWords'),
  }(name='Data'),
}

model GetQualityRuleDetailResponse = {
  headers: map[string]string(name='headers'),
  body: GetQualityRuleDetailResponseBody(name='body'),
}

async function getQualityRuleDetailWithOptions(request: GetQualityRuleDetailRequest, runtime: Util.RuntimeOptions): GetQualityRuleDetailResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetQualityRuleDetail', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getQualityRuleDetail(request: GetQualityRuleDetailRequest): GetQualityRuleDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityRuleDetailWithOptions(request, runtime);
}

model ListRobotParamsRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  robotId?: long(name='RobotId'),
}

model ListRobotParamsResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: [ 
    {
      isEmpty?: int32(name='IsEmpty'),
      paramCode?: string(name='ParamCode'),
      paramName?: string(name='ParamName'),
    }
  ](name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model ListRobotParamsResponse = {
  headers: map[string]string(name='headers'),
  body: ListRobotParamsResponseBody(name='body'),
}

async function listRobotParamsWithOptions(request: ListRobotParamsRequest, runtime: Util.RuntimeOptions): ListRobotParamsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListRobotParams', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listRobotParams(request: ListRobotParamsRequest): ListRobotParamsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRobotParamsWithOptions(request, runtime);
}

model AttachTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId'),
  callString?: string(name='CallString'),
}

model AttachTaskResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: long(name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model AttachTaskResponse = {
  headers: map[string]string(name='headers'),
  body: AttachTaskResponseBody(name='body'),
}

async function attachTaskWithOptions(request: AttachTaskRequest, runtime: Util.RuntimeOptions): AttachTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AttachTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function attachTask(request: AttachTaskRequest): AttachTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachTaskWithOptions(request, runtime);
}

model GetQualityProjectLogRequest {
  instanceId?: string(name='InstanceId'),
  projectId?: long(name='ProjectId'),
}

model GetQualityProjectLogResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: [ 
    {
      projectCreateTime?: string(name='ProjectCreateTime'),
      actionType?: string(name='ActionType'),
      actionTime?: string(name='ActionTime'),
      actionData?: string(name='ActionData'),
      projectId?: long(name='ProjectId'),
    }
  ](name='Data'),
}

model GetQualityProjectLogResponse = {
  headers: map[string]string(name='headers'),
  body: GetQualityProjectLogResponseBody(name='body'),
}

async function getQualityProjectLogWithOptions(request: GetQualityProjectLogRequest, runtime: Util.RuntimeOptions): GetQualityProjectLogResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetQualityProjectLog', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getQualityProjectLog(request: GetQualityProjectLogRequest): GetQualityProjectLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityProjectLogWithOptions(request, runtime);
}

model ResetHotlineNumberRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  hotlineNumber?: string(name='HotlineNumber', description='号码'),
  description?: string(name='Description', description='号码描述'),
  enableInbound?: boolean(name='EnableInbound', description='是否用于入呼'),
  inboundFlowId?: long(name='InboundFlowId', description='入呼ivr流程id'),
  enableOutbound?: boolean(name='EnableOutbound', description='是否用于外呼'),
  outboundAllDepart?: boolean(name='OutboundAllDepart', description='外呼是否对所有部门生效'),
  enableInboundEvaluation?: boolean(name='EnableInboundEvaluation', description='是否开启入呼满意度'),
  enableOutboundEvaluation?: boolean(name='EnableOutboundEvaluation', description='是否开启外呼满意度'),
  evaluationLevel?: int32(name='EvaluationLevel', description='满意度等级'),
  outboundRangeList?: [ 
    {
      departmentId?: long(name='DepartmentId', description='生效部门id'),
      groupIdList?: [ long ](name='GroupIdList', description='生效技能组列表（部门123下）'),
    }
  ](name='OutboundRangeList', description='外呼生效范围'),
}

model ResetHotlineNumberShrinkRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  hotlineNumber?: string(name='HotlineNumber', description='号码'),
  description?: string(name='Description', description='号码描述'),
  enableInbound?: boolean(name='EnableInbound', description='是否用于入呼'),
  inboundFlowId?: long(name='InboundFlowId', description='入呼ivr流程id'),
  enableOutbound?: boolean(name='EnableOutbound', description='是否用于外呼'),
  outboundAllDepart?: boolean(name='OutboundAllDepart', description='外呼是否对所有部门生效'),
  enableInboundEvaluation?: boolean(name='EnableInboundEvaluation', description='是否开启入呼满意度'),
  enableOutboundEvaluation?: boolean(name='EnableOutboundEvaluation', description='是否开启外呼满意度'),
  evaluationLevel?: int32(name='EvaluationLevel', description='满意度等级'),
  outboundRangeListShrink?: string(name='OutboundRangeList', description='外呼生效范围'),
}

model ResetHotlineNumberResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='接口调用是否成功'),
  code?: string(name='Code', description='错误码'),
  message?: string(name='Message', description='错误信息'),
  httpStatusCode?: long(name='HttpStatusCode', description='http状态码'),
}

model ResetHotlineNumberResponse = {
  headers: map[string]string(name='headers'),
  body: ResetHotlineNumberResponseBody(name='body'),
}

async function resetHotlineNumberWithOptions(tmpReq: ResetHotlineNumberRequest, runtime: Util.RuntimeOptions): ResetHotlineNumberResponse {
  Util.validateModel(tmpReq);
  var request = new ResetHotlineNumberShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.outboundRangeList)) {
    request.outboundRangeListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.outboundRangeList, 'OutboundRangeList', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ResetHotlineNumber', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function resetHotlineNumber(request: ResetHotlineNumberRequest): ResetHotlineNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetHotlineNumberWithOptions(request, runtime);
}

model UpdateAiOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  taskId?: long(name='TaskId', description='任务id'),
  name?: string(name='Name', description='任务名（1～15字符）'),
  description?: string(name='Description', description='任务描述（0～100字符）'),
  outboundNums?: [ string ](name='OutboundNums', description='外呼主叫号码'),
  numRepeated?: int32(name='NumRepeated', description='被叫号码重复策略（0:任务内去重，1:任务内不去重）'),
  handlerId?: long(name='HandlerId', description='技能组id（预测式外呼）或者ivr id（自动外呼）'),
  executionTime?: string(name='ExecutionTime', description='任务执行时间'),
  concurrentRate?: int32(name='ConcurrentRate', description='自动外呼的并发'),
  recallRule?: {
    count?: int32(name='Count', description='失败重呼次数（1～3次）'),
    interval?: int32(name='Interval', description='失败重呼间隔时间（1～60分钟）'),
  }(name='RecallRule', description='失败重呼策略'),
  forecastCallRate?: float(name='ForecastCallRate', description='预测式外呼固定外呼比例（>=1）'),
}

model UpdateAiOutboundTaskShrinkRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  taskId?: long(name='TaskId', description='任务id'),
  name?: string(name='Name', description='任务名（1～15字符）'),
  description?: string(name='Description', description='任务描述（0～100字符）'),
  outboundNumsShrink?: string(name='OutboundNums', description='外呼主叫号码'),
  numRepeated?: int32(name='NumRepeated', description='被叫号码重复策略（0:任务内去重，1:任务内不去重）'),
  handlerId?: long(name='HandlerId', description='技能组id（预测式外呼）或者ivr id（自动外呼）'),
  executionTime?: string(name='ExecutionTime', description='任务执行时间'),
  concurrentRate?: int32(name='ConcurrentRate', description='自动外呼的并发'),
  recallRuleShrink?: string(name='RecallRule', description='失败重呼策略'),
  forecastCallRate?: float(name='ForecastCallRate', description='预测式外呼固定外呼比例（>=1）'),
}

model UpdateAiOutboundTaskResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model UpdateAiOutboundTaskResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateAiOutboundTaskResponseBody(name='body'),
}

async function updateAiOutboundTaskWithOptions(tmpReq: UpdateAiOutboundTaskRequest, runtime: Util.RuntimeOptions): UpdateAiOutboundTaskResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateAiOutboundTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.outboundNums)) {
    request.outboundNumsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.outboundNums, 'OutboundNums', 'json');
  }
  if (!Util.isUnset(tmpReq.recallRule)) {
    request.recallRuleShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.recallRule, 'RecallRule', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateAiOutboundTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function updateAiOutboundTask(request: UpdateAiOutboundTaskRequest): UpdateAiOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAiOutboundTaskWithOptions(request, runtime);
}

model ListHotlineRecordDetailRequest {
  clientToken?: string(name='ClientToken', description='clientToken'),
  instanceId?: string(name='InstanceId', description='实例id'),
  closeTimeEnd?: long(name='CloseTimeEnd', description='热线挂断的时间范围'),
  currentPage?: int32(name='CurrentPage', description='当前页'),
  pageSize?: int32(name='PageSize', description='每页数据量'),
  closeTimeStart?: long(name='CloseTimeStart', description='热线挂断的时间范围'),
}

model ListHotlineRecordDetailResponseBody = {
  message?: string(name='Message', description='message'),
  requestId?: string(name='RequestId', description='requestId'),
  httpStatusCode?: int32(name='HttpStatusCode', description='httpStatusCode'),
  resultData?: {
    currentPage?: long(name='CurrentPage'),
    totalResults?: long(name='TotalResults'),
    totalPage?: long(name='TotalPage'),
    onePageSize?: long(name='OnePageSize'),
    data?: [ 
      {
        servicerName?: string(name='ServicerName'),
        startTime?: long(name='StartTime', description='热线开始时间'),
        endTime?: long(name='EndTime', description='热线结束时间'),
        ossUrl?: string(name='OssUrl', description='热线通话录音地址'),
      }
    ](name='Data'),
  }(name='ResultData', description='data'),
  code?: string(name='Code', description='code'),
  success?: boolean(name='Success', description='success'),
}

model ListHotlineRecordDetailResponse = {
  headers: map[string]string(name='headers'),
  body: ListHotlineRecordDetailResponseBody(name='body'),
}

async function listHotlineRecordDetailWithOptions(request: ListHotlineRecordDetailRequest, runtime: Util.RuntimeOptions): ListHotlineRecordDetailResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListHotlineRecordDetail', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listHotlineRecordDetail(request: ListHotlineRecordDetailRequest): ListHotlineRecordDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return listHotlineRecordDetailWithOptions(request, runtime);
}

model GetHotlineMessageLogRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  acid?: string(name='Acid', description='会话id'),
}

model GetHotlineMessageLogResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='调用是否成功'),
  code?: string(name='Code', description='错误码'),
  message?: string(name='Message', description='错误信息'),
  data?: [ 
    {
      acid?: string(name='Acid', description='会话ID'),
      senderType?: int32(name='SenderType', description='发送方类型（1：会员，2：坐席）'),
      startTime?: long(name='StartTime', description='开始时间'),
      endTime?: long(name='EndTime', description='结束时间'),
      mid?: string(name='Mid', description='记录id'),
      content?: string(name='Content', description='会话内容'),
    }
  ](name='Data'),
}

model GetHotlineMessageLogResponse = {
  headers: map[string]string(name='headers'),
  body: GetHotlineMessageLogResponseBody(name='body'),
}

async function getHotlineMessageLogWithOptions(request: GetHotlineMessageLogRequest, runtime: Util.RuntimeOptions): GetHotlineMessageLogResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetHotlineMessageLog', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getHotlineMessageLog(request: GetHotlineMessageLogRequest): GetHotlineMessageLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineMessageLogWithOptions(request, runtime);
}

model CancelTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId'),
}

model CancelTaskResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: boolean(name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model CancelTaskResponse = {
  headers: map[string]string(name='headers'),
  body: CancelTaskResponseBody(name='body'),
}

async function cancelTaskWithOptions(request: CancelTaskRequest, runtime: Util.RuntimeOptions): CancelTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CancelTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function cancelTask(request: CancelTaskRequest): CancelTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelTaskWithOptions(request, runtime);
}

model StartTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId'),
  startNow?: boolean(name='StartNow'),
}

model StartTaskResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: boolean(name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model StartTaskResponse = {
  headers: map[string]string(name='headers'),
  body: StartTaskResponseBody(name='body'),
}

async function startTaskWithOptions(request: StartTaskRequest, runtime: Util.RuntimeOptions): StartTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StartTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function startTask(request: StartTaskRequest): StartTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return startTaskWithOptions(request, runtime);
}

model QueryHotlineNumberRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  currentPage?: int32(name='CurrentPage', description='当前页码'),
  pageSize?: int32(name='PageSize', description='每页大小'),
  hotlineNumber?: string(name='HotlineNumber', description='号码（支持模糊查询）'),
  departmentId?: long(name='DepartmentId', description='部门id（技能组分组）'),
  groupIds?: [ long ](name='GroupIds', description='技能组列表'),
}

model QueryHotlineNumberShrinkRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  currentPage?: int32(name='CurrentPage', description='当前页码'),
  pageSize?: int32(name='PageSize', description='每页大小'),
  hotlineNumber?: string(name='HotlineNumber', description='号码（支持模糊查询）'),
  departmentId?: long(name='DepartmentId', description='部门id（技能组分组）'),
  groupIdsShrink?: string(name='GroupIds', description='技能组列表'),
}

model QueryHotlineNumberResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='是否成功'),
  code?: string(name='Code', description='错误码'),
  message?: string(name='Message', description='错误信息'),
  data?: {
    totalCount?: long(name='TotalCount', description='数据总量'),
    currentPage?: long(name='CurrentPage', description='当前页面'),
    pageSize?: long(name='PageSize', description='每页大小'),
    hotlineNumList?: [ 
      {
        hotlineNumber?: string(name='HotlineNumber', description='号码'),
        description?: string(name='Description', description='号码描述'),
        location?: string(name='Location', description='归属地'),
        sp?: string(name='Sp', description='运营商'),
        inBoundEnabled?: boolean(name='InBoundEnabled', description='是否用于入呼'),
        flowId?: long(name='FlowId', description='入呼流程id'),
        flowName?: string(name='FlowName', description='入呼流程名称'),
        outboundEnabled?: boolean(name='OutboundEnabled', description='是否用于外呼'),
        calloutAllDepartment?: boolean(name='CalloutAllDepartment', description='外呼针对所有部门生效'),
        calloutRangeList?: [ 
          {
            departmentId?: long(name='DepartmentId', description='部门id'),
            departmentName?: string(name='DepartmentName', description='部门名称'),
            groupDOList?: [ 
              {
                groupId?: long(name='GroupId', description='技能组id'),
                groupName?: string(name='GroupName', description='技能组名称'),
              }
            ](name='GroupDOList', description='技能组列表'),
          }
        ](name='CalloutRangeList', description='外呼生效列表'),
        evaluationStatus?: int32(name='EvaluationStatus', description='满意度状态'),
      }
    ](name='HotlineNumList', description='号码列表'),
  }(name='Data', description='返回结果数据'),
}

model QueryHotlineNumberResponse = {
  headers: map[string]string(name='headers'),
  body: QueryHotlineNumberResponseBody(name='body'),
}

async function queryHotlineNumberWithOptions(tmpReq: QueryHotlineNumberRequest, runtime: Util.RuntimeOptions): QueryHotlineNumberResponse {
  Util.validateModel(tmpReq);
  var request = new QueryHotlineNumberShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'json');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('QueryHotlineNumber', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function queryHotlineNumber(request: QueryHotlineNumberRequest): QueryHotlineNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryHotlineNumberWithOptions(request, runtime);
}

model GetQualityProjectListRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  projectId?: long(name='ProjectId', description='质检项ID'),
  projectName?: string(name='ProjectName', description='质检项名称'),
  status?: int32(name='Status', description='质检项状态'),
  pageNo?: int32(name='PageNo', description='PageNo'),
  pageSize?: int32(name='PageSize', description='PageSize'),
  checkFreqType?: long(name='checkFreqType', description='质检频率'),
}

model GetQualityProjectListResponseBody = {
  message?: string(name='Message', description='Message'),
  requestId?: string(name='RequestId', description='RequestId'),
  data?: {
    qualityProjectList?: [ 
      {
        status?: int32(name='Status', description='质检任务状态'),
        qualityType?: int32(name='QualityType', description='质检任务类型'),
        qualityRuleIds?: [ long ](name='QualityRuleIds', description='质检规则列表'),
        createTime?: string(name='CreateTime', description='CreateTime'),
        projectName?: string(name='ProjectName', description='质检任务名称'),
        checkFreqType?: int32(name='CheckFreqType', description='质检任务频率'),
        depList?: [ long ](name='DepList', description='技能组分组列表'),
        servicerList?: [ long ](name='ServicerList', description='坐席列表'),
        version?: int32(name='Version', description='版本'),
        groupList?: [ long ](name='GroupList', description='技能组列表'),
        id?: long(name='Id', description='质检任务Id'),
        modifyTime?: string(name='ModifyTime', description='修改时间'),
      }
    ](name='QualityProjectList', description='质检项列表'),
    pageNo?: int32(name='PageNo', description='PageNo'),
    pageSize?: int32(name='PageSize', description='PageSize'),
    total?: long(name='Total', description='Total'),
  }(name='Data', description='Data'),
  code?: string(name='Code', description='Code'),
  success?: boolean(name='Success', description='Success'),
}

model GetQualityProjectListResponse = {
  headers: map[string]string(name='headers'),
  body: GetQualityProjectListResponseBody(name='body'),
}

async function getQualityProjectListWithOptions(request: GetQualityProjectListRequest, runtime: Util.RuntimeOptions): GetQualityProjectListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetQualityProjectList', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getQualityProjectList(request: GetQualityProjectListRequest): GetQualityProjectListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityProjectListWithOptions(request, runtime);
}

model CreateOutboundTaskRequest {
  taskType?: int32(name='TaskType'),
  taskName?: string(name='TaskName'),
  description?: string(name='Description'),
  startDate?: string(name='StartDate'),
  endDate?: string(name='EndDate'),
  startTime?: string(name='StartTime'),
  endTime?: string(name='EndTime'),
  retryTime?: int32(name='RetryTime'),
  retryInterval?: int32(name='RetryInterval'),
  skillGroup?: long(name='SkillGroup'),
  ani?: string(name='Ani'),
  groupName?: string(name='GroupName'),
  model?: int32(name='Model'),
  departmentId?: long(name='DepartmentId'),
  extAttrs?: string(name='ExtAttrs'),
  callInfos?: string(name='CallInfos'),
  instanceId?: string(name='InstanceId'),
}

model CreateOutboundTaskResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateOutboundTaskResponse = {
  headers: map[string]string(name='headers'),
  body: CreateOutboundTaskResponseBody(name='body'),
}

async function createOutboundTaskWithOptions(request: CreateOutboundTaskRequest, runtime: Util.RuntimeOptions): CreateOutboundTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateOutboundTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createOutboundTask(request: CreateOutboundTaskRequest): CreateOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createOutboundTaskWithOptions(request, runtime);
}

model GetHotlineRuntimeInfoRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  accountName?: string(name='AccountName', description='账号名'),
}

model GetHotlineRuntimeInfoResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='接口调用是否成功'),
  code?: string(name='Code', description='错误码'),
  message?: string(name='Message', description='错误信息'),
  data?: map[string]any(name='Data', description='数据结果'),
}

model GetHotlineRuntimeInfoResponse = {
  headers: map[string]string(name='headers'),
  body: GetHotlineRuntimeInfoResponseBody(name='body'),
}

async function getHotlineRuntimeInfoWithOptions(request: GetHotlineRuntimeInfoRequest, runtime: Util.RuntimeOptions): GetHotlineRuntimeInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetHotlineRuntimeInfo', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getHotlineRuntimeInfo(request: GetHotlineRuntimeInfoRequest): GetHotlineRuntimeInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineRuntimeInfoWithOptions(request, runtime);
}

model MakeDoubleCallRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  accountName?: string(name='AccountName', description='账号名称'),
  servicerPhone?: string(name='ServicerPhone', description='坐席手机号（需要通过坐席手机呼叫才需要填写）'),
  memberPhone?: string(name='MemberPhone', description='用户手机号'),
  outboundCallNumber?: string(name='OutboundCallNumber', description='外呼主叫号码'),
  bizData?: string(name='BizData', description='业务携带数据（JsonString）'),
}

model MakeDoubleCallResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='调用是否成功'),
  code?: string(name='Code', description='错误码'),
  message?: string(name='Message', description='错误信息'),
  data?: {
    acid?: string(name='Acid', description='会话id'),
  }(name='Data', description='返回数据'),
}

model MakeDoubleCallResponse = {
  headers: map[string]string(name='headers'),
  body: MakeDoubleCallResponseBody(name='body'),
}

async function makeDoubleCallWithOptions(request: MakeDoubleCallRequest, runtime: Util.RuntimeOptions): MakeDoubleCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('MakeDoubleCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function makeDoubleCall(request: MakeDoubleCallRequest): MakeDoubleCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return makeDoubleCallWithOptions(request, runtime);
}

model GetSkillGroupAgentStatusDetailsRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
  groupIds?: [ long ](name='GroupIds', description='技能组id列表'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetSkillGroupAgentStatusDetailsShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
  groupIdsShrink?: string(name='GroupIds', description='技能组id列表'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetSkillGroupAgentStatusDetailsResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='接口调用是否成功'),
  data?: {
    pageNum?: long(name='PageNum', description='当前页数'),
    pageSize?: long(name='PageSize', description='每页的数量'),
    totalNum?: long(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
}

model GetSkillGroupAgentStatusDetailsResponse = {
  headers: map[string]string(name='headers'),
  body: GetSkillGroupAgentStatusDetailsResponseBody(name='body'),
}

async function getSkillGroupAgentStatusDetailsWithOptions(tmpReq: GetSkillGroupAgentStatusDetailsRequest, runtime: Util.RuntimeOptions): GetSkillGroupAgentStatusDetailsResponse {
  Util.validateModel(tmpReq);
  var request = new GetSkillGroupAgentStatusDetailsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetSkillGroupAgentStatusDetails', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getSkillGroupAgentStatusDetails(request: GetSkillGroupAgentStatusDetailsRequest): GetSkillGroupAgentStatusDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSkillGroupAgentStatusDetailsWithOptions(request, runtime);
}

model GetAgentServiceStatusRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIds?: [ long ](name='AgentIds', description='坐席id列表'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据坐席分组'),
}

model GetAgentServiceStatusShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIdsShrink?: string(name='AgentIds', description='坐席id列表'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据坐席分组'),
}

model GetAgentServiceStatusResponseBody = {
  message?: string(name='Message', description='错误描述'),
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  data?: {
    pageNum?: long(name='PageNum', description='当前页数'),
    pageSize?: long(name='PageSize', description='页大小'),
    totalNum?: long(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
  code?: string(name='Code', description='错误编码'),
  success?: boolean(name='Success', description='调用接口是否成功'),
}

model GetAgentServiceStatusResponse = {
  headers: map[string]string(name='headers'),
  body: GetAgentServiceStatusResponseBody(name='body'),
}

async function getAgentServiceStatusWithOptions(tmpReq: GetAgentServiceStatusRequest, runtime: Util.RuntimeOptions): GetAgentServiceStatusResponse {
  Util.validateModel(tmpReq);
  var request = new GetAgentServiceStatusShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetAgentServiceStatus', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getAgentServiceStatus(request: GetAgentServiceStatusRequest): GetAgentServiceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentServiceStatusWithOptions(request, runtime);
}

model GetNumLocationRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  phoneNum?: string(name='PhoneNum'),
}

model GetNumLocationResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetNumLocationResponse = {
  headers: map[string]string(name='headers'),
  body: GetNumLocationResponseBody(name='body'),
}

async function getNumLocationWithOptions(request: GetNumLocationRequest, runtime: Util.RuntimeOptions): GetNumLocationResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetNumLocation', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getNumLocation(request: GetNumLocationRequest): GetNumLocationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getNumLocationWithOptions(request, runtime);
}

model GetQualityRuleListRequest {
  instanceId?: string(name='InstanceId'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
}

model GetQualityRuleListResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: {
    pageNo?: int32(name='PageNo'),
    pageSize?: int32(name='PageSize'),
    total?: long(name='Total'),
    qualityRuleList?: [ 
      {
        ruleTag?: int32(name='RuleTag'),
        matchType?: int32(name='MatchType'),
        name?: string(name='Name'),
        ruleCreateTime?: string(name='RuleCreateTime'),
        ruleId?: long(name='RuleId'),
        keyWords?: [ string ](name='KeyWords'),
      }
    ](name='QualityRuleList'),
  }(name='Data'),
}

model GetQualityRuleListResponse = {
  headers: map[string]string(name='headers'),
  body: GetQualityRuleListResponseBody(name='body'),
}

async function getQualityRuleListWithOptions(request: GetQualityRuleListRequest, runtime: Util.RuntimeOptions): GetQualityRuleListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetQualityRuleList', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getQualityRuleList(request: GetQualityRuleListRequest): GetQualityRuleListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityRuleListWithOptions(request, runtime);
}

model ListOutboundPhoneNumberRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
}

model ListOutboundPhoneNumberResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: [ string ](name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  httpStatusCode?: long(name='HttpStatusCode'),
}

model ListOutboundPhoneNumberResponse = {
  headers: map[string]string(name='headers'),
  body: ListOutboundPhoneNumberResponseBody(name='body'),
}

async function listOutboundPhoneNumberWithOptions(request: ListOutboundPhoneNumberRequest, runtime: Util.RuntimeOptions): ListOutboundPhoneNumberResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListOutboundPhoneNumber', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listOutboundPhoneNumber(request: ListOutboundPhoneNumberRequest): ListOutboundPhoneNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOutboundPhoneNumberWithOptions(request, runtime);
}

model ListAgentBySkillGroupIdRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  skillGroupId?: long(name='SkillGroupId'),
}

model ListAgentBySkillGroupIdResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: [ 
    {
      status?: int32(name='Status'),
      displayName?: string(name='DisplayName'),
      agentId?: long(name='AgentId'),
      accountName?: string(name='AccountName'),
      tenantId?: long(name='TenantId'),
    }
  ](name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model ListAgentBySkillGroupIdResponse = {
  headers: map[string]string(name='headers'),
  body: ListAgentBySkillGroupIdResponseBody(name='body'),
}

async function listAgentBySkillGroupIdWithOptions(request: ListAgentBySkillGroupIdRequest, runtime: Util.RuntimeOptions): ListAgentBySkillGroupIdResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListAgentBySkillGroupId', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listAgentBySkillGroupId(request: ListAgentBySkillGroupIdRequest): ListAgentBySkillGroupIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAgentBySkillGroupIdWithOptions(request, runtime);
}

model HangupThirdCallRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  callId?: string(name='CallId'),
  jobId?: string(name='JobId'),
  connectionId?: string(name='ConnectionId'),
}

model HangupThirdCallResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model HangupThirdCallResponse = {
  headers: map[string]string(name='headers'),
  body: HangupThirdCallResponseBody(name='body'),
}

async function hangupThirdCallWithOptions(request: HangupThirdCallRequest, runtime: Util.RuntimeOptions): HangupThirdCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('HangupThirdCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function hangupThirdCall(request: HangupThirdCallRequest): HangupThirdCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return hangupThirdCallWithOptions(request, runtime);
}

model StartHotlineServiceRequest {
  clientToken?: string(name='ClientToken', description='js sdk中自动生成的鉴权token'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
}

model StartHotlineServiceResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  httpStatusCode?: long(name='HttpStatusCode'),
}

model StartHotlineServiceResponse = {
  headers: map[string]string(name='headers'),
  body: StartHotlineServiceResponseBody(name='body'),
}

async function startHotlineServiceWithOptions(request: StartHotlineServiceRequest, runtime: Util.RuntimeOptions): StartHotlineServiceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StartHotlineService', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function startHotlineService(request: StartHotlineServiceRequest): StartHotlineServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return startHotlineServiceWithOptions(request, runtime);
}

model GetAgentRequest {
  clientToken?: string(name='ClientToken', description='js sdk中自动生成的鉴权token'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
}

model GetAgentResponseBody = {
  requestId?: string(name='RequestId'),
  data?: {
    status?: int32(name='Status'),
    displayName?: string(name='DisplayName'),
    agentId?: long(name='AgentId'),
    groupList?: [ 
      {
        displayName?: string(name='DisplayName'),
        description?: string(name='Description'),
        channelType?: int32(name='ChannelType'),
        skillGroupId?: long(name='SkillGroupId'),
        name?: string(name='Name'),
      }
    ](name='GroupList'),
    accountName?: string(name='AccountName'),
    tenantId?: long(name='TenantId'),
  }(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  httpStatusCode?: long(name='HttpStatusCode'),
}

model GetAgentResponse = {
  headers: map[string]string(name='headers'),
  body: GetAgentResponseBody(name='body'),
}

async function getAgentWithOptions(request: GetAgentRequest, runtime: Util.RuntimeOptions): GetAgentResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetAgent', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getAgent(request: GetAgentRequest): GetAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentWithOptions(request, runtime);
}

model StartAiOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  taskId?: long(name='TaskId', description='任务id'),
}

model StartAiOutboundTaskResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model StartAiOutboundTaskResponse = {
  headers: map[string]string(name='headers'),
  body: StartAiOutboundTaskResponseBody(name='body'),
}

async function startAiOutboundTaskWithOptions(request: StartAiOutboundTaskRequest, runtime: Util.RuntimeOptions): StartAiOutboundTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StartAiOutboundTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function startAiOutboundTask(request: StartAiOutboundTaskRequest): StartAiOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return startAiOutboundTaskWithOptions(request, runtime);
}

model GetAgentIndexRealTimeRequest {
  instanceId?: string(name='InstanceId'),
  pageSize?: int32(name='PageSize'),
  currentPage?: int32(name='CurrentPage'),
  depIds?: [ long ](name='DepIds'),
  groupIds?: [ long ](name='GroupIds'),
}

model GetAgentIndexRealTimeResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: {
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
    page?: int32(name='Page'),
    columns?: [ 
      {
        key?: string(name='Key'),
        title?: string(name='Title'),
      }
    ](name='Columns'),
    rows?: [  map[string]any ](name='Rows'),
  }(name='Data'),
}

model GetAgentIndexRealTimeResponse = {
  headers: map[string]string(name='headers'),
  body: GetAgentIndexRealTimeResponseBody(name='body'),
}

async function getAgentIndexRealTimeWithOptions(request: GetAgentIndexRealTimeRequest, runtime: Util.RuntimeOptions): GetAgentIndexRealTimeResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetAgentIndexRealTime', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getAgentIndexRealTime(request: GetAgentIndexRealTimeRequest): GetAgentIndexRealTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentIndexRealTimeWithOptions(request, runtime);
}

model GetHotlineGroupDetailReportRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  startDate?: long(name='StartDate'),
  endDate?: long(name='EndDate'),
  instanceId?: string(name='InstanceId'),
  depIds?: [ long ](name='DepIds'),
  groupIds?: [ long ](name='GroupIds'),
}

model GetHotlineGroupDetailReportResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  data?: {
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
    page?: int32(name='Page'),
    columns?: [ 
      {
        key?: string(name='Key'),
        title?: string(name='Title'),
      }
    ](name='Columns'),
    rows?: [  map[string]any ](name='Rows'),
  }(name='Data'),
}

model GetHotlineGroupDetailReportResponse = {
  headers: map[string]string(name='headers'),
  body: GetHotlineGroupDetailReportResponseBody(name='body'),
}

async function getHotlineGroupDetailReportWithOptions(request: GetHotlineGroupDetailReportRequest, runtime: Util.RuntimeOptions): GetHotlineGroupDetailReportResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetHotlineGroupDetailReport', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getHotlineGroupDetailReport(request: GetHotlineGroupDetailReportRequest): GetHotlineGroupDetailReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineGroupDetailReportWithOptions(request, runtime);
}

model EncryptPhoneNumRequest {
  instanceId?: string(name='InstanceId', description='实例Id'),
  phoneNum?: string(name='PhoneNum', description='号码明文'),
}

model EncryptPhoneNumResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='接口调用是否成功'),
  code?: string(name='Code', description='错误码'),
  message?: string(name='Message', description='错误信息'),
  data?: string(name='Data', description='加密后密文'),
}

model EncryptPhoneNumResponse = {
  headers: map[string]string(name='headers'),
  body: EncryptPhoneNumResponseBody(name='body'),
}

async function encryptPhoneNumWithOptions(request: EncryptPhoneNumRequest, runtime: Util.RuntimeOptions): EncryptPhoneNumResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('EncryptPhoneNum', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function encryptPhoneNum(request: EncryptPhoneNumRequest): EncryptPhoneNumResponse {
  var runtime = new Util.RuntimeOptions{};
  return encryptPhoneNumWithOptions(request, runtime);
}

model GetQualityProjectDetailRequest {
  instanceId?: string(name='InstanceId', description='租户实例ID'),
  projectId?: long(name='ProjectId', description='质检任务ID'),
}

model GetQualityProjectDetailResponseBody = {
  message?: string(name='Message', description='Message'),
  requestId?: string(name='RequestId', description='RequestId'),
  data?: {
    status?: int32(name='Status', description='质检任务状态'),
    qualityType?: int32(name='QualityType', description='质检类型'),
    qualityRuleIds?: [ long ](name='QualityRuleIds', description='质检规则ID'),
    createTime?: string(name='CreateTime', description='创建时间'),
    projectName?: string(name='ProjectName', description='质检任务名称'),
    checkFreqType?: int32(name='CheckFreqType', description='质检周期'),
    depList?: [ long ](name='DepList', description='技能组分组'),
    servicerList?: [ long ](name='ServicerList', description='坐席列表'),
    version?: int32(name='Version', description='Version'),
    groupList?: [ long ](name='GroupList', description='技能组列表'),
    id?: long(name='Id', description='质检任务ID'),
    modifyTime?: string(name='ModifyTime', description='修改时间'),
  }(name='Data', description='Data'),
  code?: string(name='Code', description='Code'),
  success?: string(name='Success', description='Success'),
}

model GetQualityProjectDetailResponse = {
  headers: map[string]string(name='headers'),
  body: GetQualityProjectDetailResponseBody(name='body'),
}

async function getQualityProjectDetailWithOptions(request: GetQualityProjectDetailRequest, runtime: Util.RuntimeOptions): GetQualityProjectDetailResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetQualityProjectDetail', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getQualityProjectDetail(request: GetQualityProjectDetailRequest): GetQualityProjectDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityProjectDetailWithOptions(request, runtime);
}

model GetInstanceListRequest {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  name?: string(name='Name'),
}

model GetInstanceListResponseBody = {
  httpStatusCode?: int32(name='HttpStatusCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
  totalCount?: int32(name='TotalCount'),
  commodityInstances?: [ 
    {
      name?: string(name='Name'),
      instanceId?: string(name='InstanceId'),
    }
  ](name='CommodityInstances'),
}

model GetInstanceListResponse = {
  headers: map[string]string(name='headers'),
  body: GetInstanceListResponseBody(name='body'),
}

async function getInstanceListWithOptions(request: GetInstanceListRequest, runtime: Util.RuntimeOptions): GetInstanceListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetInstanceList', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getInstanceList(request: GetInstanceListRequest): GetInstanceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInstanceListWithOptions(request, runtime);
}

model SendCcoSmartCallOperateRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  prodCode?: string(name='ProdCode'),
  callId?: string(name='CallId'),
  command?: string(name='Command'),
  param?: string(name='Param'),
}

model SendCcoSmartCallOperateResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
}

model SendCcoSmartCallOperateResponse = {
  headers: map[string]string(name='headers'),
  body: SendCcoSmartCallOperateResponseBody(name='body'),
}

async function sendCcoSmartCallOperateWithOptions(request: SendCcoSmartCallOperateRequest, runtime: Util.RuntimeOptions): SendCcoSmartCallOperateResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SendCcoSmartCallOperate', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function sendCcoSmartCallOperate(request: SendCcoSmartCallOperateRequest): SendCcoSmartCallOperateResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendCcoSmartCallOperateWithOptions(request, runtime);
}

model AnswerCallRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  callId?: string(name='CallId'),
  jobId?: string(name='JobId'),
  connectionId?: string(name='ConnectionId'),
}

model AnswerCallResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model AnswerCallResponse = {
  headers: map[string]string(name='headers'),
  body: AnswerCallResponseBody(name='body'),
}

async function answerCallWithOptions(request: AnswerCallRequest, runtime: Util.RuntimeOptions): AnswerCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AnswerCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function answerCall(request: AnswerCallRequest): AnswerCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return answerCallWithOptions(request, runtime);
}

model StartMicroOutboundRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  prodCode?: string(name='ProdCode'),
  accountType?: string(name='AccountType'),
  accountId?: string(name='AccountId'),
  commandCode?: string(name='CommandCode'),
  callingNumber?: string(name='CallingNumber'),
  calledNumber?: string(name='CalledNumber'),
  extInfo?: string(name='ExtInfo'),
  appName?: string(name='AppName'),
}

model StartMicroOutboundResponseBody = {
  invokeCreateTime?: string(name='InvokeCreateTime'),
  requestId?: string(name='RequestId'),
  message?: string(name='Message'),
  invokeCmdId?: string(name='InvokeCmdId'),
  customerInfo?: string(name='CustomerInfo'),
  code?: string(name='Code'),
}

model StartMicroOutboundResponse = {
  headers: map[string]string(name='headers'),
  body: StartMicroOutboundResponseBody(name='body'),
}

async function startMicroOutboundWithOptions(request: StartMicroOutboundRequest, runtime: Util.RuntimeOptions): StartMicroOutboundResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StartMicroOutbound', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function startMicroOutbound(request: StartMicroOutboundRequest): StartMicroOutboundResponse {
  var runtime = new Util.RuntimeOptions{};
  return startMicroOutboundWithOptions(request, runtime);
}

model SuspendHotlineServiceRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  type?: int32(name='Type'),
}

model SuspendHotlineServiceResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model SuspendHotlineServiceResponse = {
  headers: map[string]string(name='headers'),
  body: SuspendHotlineServiceResponseBody(name='body'),
}

async function suspendHotlineServiceWithOptions(request: SuspendHotlineServiceRequest, runtime: Util.RuntimeOptions): SuspendHotlineServiceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SuspendHotlineService', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function suspendHotlineService(request: SuspendHotlineServiceRequest): SuspendHotlineServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return suspendHotlineServiceWithOptions(request, runtime);
}

model GetAgentStatisticsRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIds?: [ long ](name='AgentIds', description='坐席id列表'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据坐席分组'),
}

model GetAgentStatisticsShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIdsShrink?: string(name='AgentIds', description='坐席id列表'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据坐席分组'),
}

model GetAgentStatisticsResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='调用接口是否成功'),
  data?: {
    pageNum?: int32(name='PageNum', description='当前页数'),
    pageSize?: int32(name='PageSize', description='页大小'),
    totalNum?: int32(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
}

model GetAgentStatisticsResponse = {
  headers: map[string]string(name='headers'),
  body: GetAgentStatisticsResponseBody(name='body'),
}

async function getAgentStatisticsWithOptions(tmpReq: GetAgentStatisticsRequest, runtime: Util.RuntimeOptions): GetAgentStatisticsResponse {
  Util.validateModel(tmpReq);
  var request = new GetAgentStatisticsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetAgentStatistics', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getAgentStatistics(request: GetAgentStatisticsRequest): GetAgentStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentStatisticsWithOptions(request, runtime);
}

model CreateTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskName?: string(name='TaskName'),
  robotId?: string(name='RobotId'),
  caller?: string(name='Caller'),
  callString?: string(name='CallString'),
  callStringType?: string(name='CallStringType'),
  retryFlag?: int32(name='RetryFlag'),
  retryCount?: int32(name='RetryCount'),
  retryInterval?: int32(name='RetryInterval'),
  retryStatusCode?: string(name='RetryStatusCode'),
  startNow?: boolean(name='StartNow'),
  workTimeList?: string(name='WorkTimeList'),
  workDay?: string(name='WorkDay'),
  seatCount?: string(name='SeatCount'),
}

model CreateTaskResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: long(name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model CreateTaskResponse = {
  headers: map[string]string(name='headers'),
  body: CreateTaskResponseBody(name='body'),
}

async function createTaskWithOptions(request: CreateTaskRequest, runtime: Util.RuntimeOptions): CreateTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createTask(request: CreateTaskRequest): CreateTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTaskWithOptions(request, runtime);
}

model CreateDepartmentRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  departmentName?: string(name='DepartmentName', description='部门名称'),
}

model CreateDepartmentResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  data?: long(name='Data'),
}

model CreateDepartmentResponse = {
  headers: map[string]string(name='headers'),
  body: CreateDepartmentResponseBody(name='body'),
}

async function createDepartmentWithOptions(request: CreateDepartmentRequest, runtime: Util.RuntimeOptions): CreateDepartmentResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateDepartment', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createDepartment(request: CreateDepartmentRequest): CreateDepartmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDepartmentWithOptions(request, runtime);
}

model GetRecordUrlRequest {
  instanceId?: string(name='InstanceId'),
  acid?: string(name='Acid'),
  recordType?: string(name='RecordType'),
}

model GetRecordUrlResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  message?: string(name='Message'),
  data?: {
    acid?: string(name='Acid', description='会话id'),
    ossLink?: string(name='OssLink', description='录音链接'),
  }(name='Data'),
}

model GetRecordUrlResponse = {
  headers: map[string]string(name='headers'),
  body: GetRecordUrlResponseBody(name='body'),
}

async function getRecordUrlWithOptions(request: GetRecordUrlRequest, runtime: Util.RuntimeOptions): GetRecordUrlResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetRecordUrl', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getRecordUrl(request: GetRecordUrlRequest): GetRecordUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRecordUrlWithOptions(request, runtime);
}

model UpdateOuterAccountRequest {
  outerAccountId?: string(name='OuterAccountId'),
  outerAccountType?: string(name='OuterAccountType'),
  outerAccountName?: string(name='OuterAccountName'),
  avatar?: string(name='Avatar'),
  realName?: string(name='RealName'),
  outerDepartmentId?: string(name='OuterDepartmentId'),
  outerGroupIds?: string(name='OuterGroupIds'),
  ext?: string(name='Ext'),
  outerGroupType?: string(name='OuterGroupType'),
  outerDepartmentType?: string(name='OuterDepartmentType'),
}

model UpdateOuterAccountResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model UpdateOuterAccountResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateOuterAccountResponseBody(name='body'),
}

async function updateOuterAccountWithOptions(request: UpdateOuterAccountRequest, runtime: Util.RuntimeOptions): UpdateOuterAccountResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('UpdateOuterAccount', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function updateOuterAccount(request: UpdateOuterAccountRequest): UpdateOuterAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateOuterAccountWithOptions(request, runtime);
}

model AiccsSmartCallRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  prodCode?: string(name='ProdCode'),
  calledShowNumber?: string(name='CalledShowNumber'),
  calledNumber?: string(name='CalledNumber'),
  voiceCode?: string(name='VoiceCode'),
  outId?: string(name='OutId'),
  playTimes?: int32(name='PlayTimes'),
  volume?: int32(name='Volume'),
  speed?: int32(name='Speed'),
  asrModelId?: string(name='AsrModelId'),
  asrBaseId?: string(name='AsrBaseId'),
  asrAlsAmId?: string(name='AsrAlsAmId'),
  asrVocabularyId?: string(name='AsrVocabularyId'),
  recordFlag?: boolean(name='RecordFlag'),
  pauseTime?: int32(name='PauseTime'),
  muteTime?: int32(name='MuteTime'),
  actionCodeBreak?: boolean(name='ActionCodeBreak'),
  dynamicId?: string(name='DynamicId'),
  earlyMediaAsr?: boolean(name='EarlyMediaAsr'),
  voiceCodeParam?: string(name='VoiceCodeParam'),
  sessionTimeout?: int32(name='SessionTimeout'),
  actionCodeTimeBreak?: int32(name='ActionCodeTimeBreak'),
  ttsConf?: boolean(name='TtsConf'),
  ttsStyle?: string(name='TtsStyle'),
  ttsVolume?: int32(name='TtsVolume'),
  ttsSpeed?: int32(name='TtsSpeed'),
  enableITN?: boolean(name='EnableITN'),
  backgroundFileCode?: string(name='BackgroundFileCode'),
  backgroundVolume?: int32(name='BackgroundVolume'),
  backgroundSpeed?: int32(name='BackgroundSpeed'),
}

model AiccsSmartCallResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
}

model AiccsSmartCallResponse = {
  headers: map[string]string(name='headers'),
  body: AiccsSmartCallResponseBody(name='body'),
}

async function aiccsSmartCallWithOptions(request: AiccsSmartCallRequest, runtime: Util.RuntimeOptions): AiccsSmartCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AiccsSmartCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function aiccsSmartCall(request: AiccsSmartCallRequest): AiccsSmartCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return aiccsSmartCallWithOptions(request, runtime);
}

model GetHotlineWaitingNumberRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
}

model GetHotlineWaitingNumberResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: long(name='Data'),
  code?: string(name='Code'),
  success?: string(name='Success'),
}

model GetHotlineWaitingNumberResponse = {
  headers: map[string]string(name='headers'),
  body: GetHotlineWaitingNumberResponseBody(name='body'),
}

async function getHotlineWaitingNumberWithOptions(request: GetHotlineWaitingNumberRequest, runtime: Util.RuntimeOptions): GetHotlineWaitingNumberResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetHotlineWaitingNumber', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getHotlineWaitingNumber(request: GetHotlineWaitingNumberRequest): GetHotlineWaitingNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineWaitingNumberWithOptions(request, runtime);
}

model HoldCallRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  callId?: string(name='CallId'),
  jobId?: string(name='JobId'),
  connectionId?: string(name='ConnectionId'),
}

model HoldCallResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model HoldCallResponse = {
  headers: map[string]string(name='headers'),
  body: HoldCallResponseBody(name='body'),
}

async function holdCallWithOptions(request: HoldCallRequest, runtime: Util.RuntimeOptions): HoldCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('HoldCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function holdCall(request: HoldCallRequest): HoldCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return holdCallWithOptions(request, runtime);
}

model GetSeatInformationRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='startDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='endDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='pageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='currentPage', description='当前页（默认为1）'),
  depIds?: [ long ](name='depIds', description='部门id列表'),
  existDepartmentGrouping?: boolean(name='existDepartmentGrouping', description='是否根据部门分组'),
}

model GetSeatInformationShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='startDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='endDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='pageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='currentPage', description='当前页（默认为1）'),
  depIdsShrink?: string(name='depIds', description='部门id列表'),
  existDepartmentGrouping?: boolean(name='existDepartmentGrouping', description='是否根据部门分组'),
}

model GetSeatInformationResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='调用接口是否成功'),
  data?: {
    pageNum?: int32(name='PageNum', description='当前页数'),
    pageSize?: int32(name='PageSize', description='页大小'),
    totalNum?: int32(name='TotalNum', description='总记录数'),
    rowr?: string(name='Rowr', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
}

model GetSeatInformationResponse = {
  headers: map[string]string(name='headers'),
  body: GetSeatInformationResponseBody(name='body'),
}

async function getSeatInformationWithOptions(tmpReq: GetSeatInformationRequest, runtime: Util.RuntimeOptions): GetSeatInformationResponse {
  Util.validateModel(tmpReq);
  var request = new GetSeatInformationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'depIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetSeatInformation', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getSeatInformation(request: GetSeatInformationRequest): GetSeatInformationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSeatInformationWithOptions(request, runtime);
}

model GetRtcTokenRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  accountName?: string(name='AccountName', description='账号名称'),
}

model GetRtcTokenResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='是否成功'),
  code?: string(name='Code', description='错误码'),
  message?: string(name='Message', description='错误信息'),
  data?: {
    token?: string(name='Token', description='token信息'),
    rtcId?: string(name='RtcId', description='rtcId'),
    accountName?: string(name='AccountName', description='账号名'),
  }(name='Data', description='data'),
}

model GetRtcTokenResponse = {
  headers: map[string]string(name='headers'),
  body: GetRtcTokenResponseBody(name='body'),
}

async function getRtcTokenWithOptions(request: GetRtcTokenRequest, runtime: Util.RuntimeOptions): GetRtcTokenResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetRtcToken', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getRtcToken(request: GetRtcTokenRequest): GetRtcTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRtcTokenWithOptions(request, runtime);
}

model GetSkillGroupAndAgentStatusSummaryRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
  groupIds?: [ long ](name='GroupIds', description='技能组id列表'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetSkillGroupAndAgentStatusSummaryShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
  groupIdsShrink?: string(name='GroupIds', description='技能组id列表'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetSkillGroupAndAgentStatusSummaryResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='接口调用是否成功'),
  data?: {
    pageNum?: int32(name='PageNum', description='当前页数'),
    pageSize?: int32(name='PageSize', description='每页的数量'),
    totalNum?: int32(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
}

model GetSkillGroupAndAgentStatusSummaryResponse = {
  headers: map[string]string(name='headers'),
  body: GetSkillGroupAndAgentStatusSummaryResponseBody(name='body'),
}

async function getSkillGroupAndAgentStatusSummaryWithOptions(tmpReq: GetSkillGroupAndAgentStatusSummaryRequest, runtime: Util.RuntimeOptions): GetSkillGroupAndAgentStatusSummaryResponse {
  Util.validateModel(tmpReq);
  var request = new GetSkillGroupAndAgentStatusSummaryShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetSkillGroupAndAgentStatusSummary', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getSkillGroupAndAgentStatusSummary(request: GetSkillGroupAndAgentStatusSummaryRequest): GetSkillGroupAndAgentStatusSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSkillGroupAndAgentStatusSummaryWithOptions(request, runtime);
}

model DeleteDepartmentRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  departmentId?: long(name='DepartmentId', description='部门id'),
}

model DeleteDepartmentResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  httpStatusCode?: long(name='HttpStatusCode'),
  data?: boolean(name='Data'),
}

model DeleteDepartmentResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteDepartmentResponseBody(name='body'),
}

async function deleteDepartmentWithOptions(request: DeleteDepartmentRequest, runtime: Util.RuntimeOptions): DeleteDepartmentResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteDepartment', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteDepartment(request: DeleteDepartmentRequest): DeleteDepartmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDepartmentWithOptions(request, runtime);
}

model UpdateDepartmentRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  departmentName?: string(name='DepartmentName', description='部门名称'),
  departmentId?: long(name='DepartmentId', description='部门id'),
}

model UpdateDepartmentResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  httpStatusCode?: long(name='HttpStatusCode'),
  data?: boolean(name='Data'),
}

model UpdateDepartmentResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateDepartmentResponseBody(name='body'),
}

async function updateDepartmentWithOptions(request: UpdateDepartmentRequest, runtime: Util.RuntimeOptions): UpdateDepartmentResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateDepartment', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function updateDepartment(request: UpdateDepartmentRequest): UpdateDepartmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateDepartmentWithOptions(request, runtime);
}

model GetRecordDataRequest {
  instanceId?: string(name='InstanceId'),
  acid?: string(name='Acid'),
}

model GetRecordDataResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: {
    ossLink?: string(name='OssLink'),
    acid?: string(name='Acid'),
  }(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  httpStatusCode?: long(name='HttpStatusCode'),
}

model GetRecordDataResponse = {
  headers: map[string]string(name='headers'),
  body: GetRecordDataResponseBody(name='body'),
}

async function getRecordDataWithOptions(request: GetRecordDataRequest, runtime: Util.RuntimeOptions): GetRecordDataResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetRecordData', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getRecordData(request: GetRecordDataRequest): GetRecordDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRecordDataWithOptions(request, runtime);
}

model StopTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId'),
}

model StopTaskResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: boolean(name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model StopTaskResponse = {
  headers: map[string]string(name='headers'),
  body: StopTaskResponseBody(name='body'),
}

async function stopTaskWithOptions(request: StopTaskRequest, runtime: Util.RuntimeOptions): StopTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StopTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function stopTask(request: StopTaskRequest): StopTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopTaskWithOptions(request, runtime);
}

model GetSkillGroupLatitudeStateRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
  groupIds?: [ long ](name='GroupIds', description='技能组id列表'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetSkillGroupLatitudeStateShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
  groupIdsShrink?: string(name='GroupIds', description='技能组id列表'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetSkillGroupLatitudeStateResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='接口调用是否成功'),
  data?: {
    pageNum?: int32(name='PageNum', description='当前页数'),
    pageSize?: int32(name='PageSize', description='每页的数量'),
    totalNum?: int32(name='TotalNum', description='总共记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
}

model GetSkillGroupLatitudeStateResponse = {
  headers: map[string]string(name='headers'),
  body: GetSkillGroupLatitudeStateResponseBody(name='body'),
}

async function getSkillGroupLatitudeStateWithOptions(tmpReq: GetSkillGroupLatitudeStateRequest, runtime: Util.RuntimeOptions): GetSkillGroupLatitudeStateResponse {
  Util.validateModel(tmpReq);
  var request = new GetSkillGroupLatitudeStateShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetSkillGroupLatitudeState', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getSkillGroupLatitudeState(request: GetSkillGroupLatitudeStateRequest): GetSkillGroupLatitudeStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSkillGroupLatitudeStateWithOptions(request, runtime);
}

model DeleteQualityRuleRequest {
  instanceId?: string(name='InstanceId'),
  id?: long(name='Id'),
}

model DeleteQualityRuleResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteQualityRuleResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteQualityRuleResponseBody(name='body'),
}

async function deleteQualityRuleWithOptions(request: DeleteQualityRuleRequest, runtime: Util.RuntimeOptions): DeleteQualityRuleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteQualityRule', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteQualityRule(request: DeleteQualityRuleRequest): DeleteQualityRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteQualityRuleWithOptions(request, runtime);
}

model GetHotlineServiceStatisticsRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIds?: [ long ](name='AgentIds', description='坐席id列表'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
  groupIds?: [ long ](name='GroupIds', description='技能组id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据坐席分组'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetHotlineServiceStatisticsShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIdsShrink?: string(name='AgentIds', description='坐席id列表'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
  groupIdsShrink?: string(name='GroupIds', description='技能组id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据坐席分组'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetHotlineServiceStatisticsResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='调用接口是否成功'),
  data?: {
    pageNum?: int32(name='PageNum', description='当前页数'),
    pageSize?: int32(name='PageSize', description='页大小'),
    totalNum?: int32(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
}

model GetHotlineServiceStatisticsResponse = {
  headers: map[string]string(name='headers'),
  body: GetHotlineServiceStatisticsResponseBody(name='body'),
}

async function getHotlineServiceStatisticsWithOptions(tmpReq: GetHotlineServiceStatisticsRequest, runtime: Util.RuntimeOptions): GetHotlineServiceStatisticsResponse {
  Util.validateModel(tmpReq);
  var request = new GetHotlineServiceStatisticsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetHotlineServiceStatistics', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getHotlineServiceStatistics(request: GetHotlineServiceStatisticsRequest): GetHotlineServiceStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineServiceStatisticsWithOptions(request, runtime);
}

model SuspendOutboundTaskRequest {
  outboundTaskId?: long(name='OutboundTaskId'),
  instanceId?: string(name='InstanceId'),
}

model SuspendOutboundTaskResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SuspendOutboundTaskResponse = {
  headers: map[string]string(name='headers'),
  body: SuspendOutboundTaskResponseBody(name='body'),
}

async function suspendOutboundTaskWithOptions(request: SuspendOutboundTaskRequest, runtime: Util.RuntimeOptions): SuspendOutboundTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SuspendOutboundTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function suspendOutboundTask(request: SuspendOutboundTaskRequest): SuspendOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return suspendOutboundTaskWithOptions(request, runtime);
}

model GetConfigNumListRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  departmentId?: long(name='DepartmentId', description='部门ID'),
  accountName?: string(name='AccountName', description='账号名称'),
}

model GetConfigNumListResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='接口调用是否成功'),
  code?: string(name='Code', description='错误码'),
  message?: string(name='Message', description='错误信息'),
  data?: [ string ](name='Data', description='号码列表'),
}

model GetConfigNumListResponse = {
  headers: map[string]string(name='headers'),
  body: GetConfigNumListResponseBody(name='body'),
}

async function getConfigNumListWithOptions(request: GetConfigNumListRequest, runtime: Util.RuntimeOptions): GetConfigNumListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetConfigNumList', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getConfigNumList(request: GetConfigNumListRequest): GetConfigNumListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getConfigNumListWithOptions(request, runtime);
}

model EditQualityProjectRequest {
  instanceId?: string(name='InstanceId'),
  projectId?: long(name='ProjectId'),
  projectName?: string(name='ProjectName'),
  checkFreqType?: int32(name='CheckFreqType'),
  projectVersion?: int32(name='ProjectVersion'),
  scopeType?: int32(name='ScopeType'),
  timeRangeStart?: string(name='TimeRangeStart'),
  timeRangeEnd?: string(name='TimeRangeEnd'),
  analysisIds?: [ long ](name='AnalysisIds'),
  depList?: [ long ](name='DepList'),
  groupList?: [ long ](name='GroupList'),
  servicerList?: [ string ](name='ServicerList'),
  channelTouchType?: [ int32 ](name='ChannelTouchType'),
}

model EditQualityProjectResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: [ 
    {
      instanceId?: string(name='InstanceId'),
      version?: int32(name='Version'),
      projectId?: long(name='ProjectId'),
    }
  ](name='Data'),
}

model EditQualityProjectResponse = {
  headers: map[string]string(name='headers'),
  body: EditQualityProjectResponseBody(name='body'),
}

async function editQualityProjectWithOptions(request: EditQualityProjectRequest, runtime: Util.RuntimeOptions): EditQualityProjectResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('EditQualityProject', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function editQualityProject(request: EditQualityProjectRequest): EditQualityProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return editQualityProjectWithOptions(request, runtime);
}

model ListOuterOrderedNumbersRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  prodCode?: string(name='ProdCode'),
}

model ListOuterOrderedNumbersResponseBody = {
  numbers?: [ string ](name='Numbers'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
}

model ListOuterOrderedNumbersResponse = {
  headers: map[string]string(name='headers'),
  body: ListOuterOrderedNumbersResponseBody(name='body'),
}

async function listOuterOrderedNumbersWithOptions(request: ListOuterOrderedNumbersRequest, runtime: Util.RuntimeOptions): ListOuterOrderedNumbersResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListOuterOrderedNumbers', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listOuterOrderedNumbers(request: ListOuterOrderedNumbersRequest): ListOuterOrderedNumbersResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOuterOrderedNumbersWithOptions(request, runtime);
}

model QueryTaskResultRequest {
  app?: string(name='App', description='app'),
  operator?: string(name='Operator', description='operator'),
  token?: string(name='Token', description='token'),
  param1?: string(name='Param1', description='param1'),
  requestId?: string(name='RequestId', description='requestId'),
}

model QueryTaskResultResponseBody = {
  status?: string(name='Status', description='status'),
  message?: string(name='Message', description='message'),
  buildId?: string(name='BuildId', description='buildId'),
  passNumber?: long(name='PassNumber', description='passNumber'),
  totalNumber?: long(name='TotalNumber', description='totalNumber'),
  url?: string(name='Url', description='url'),
  success?: boolean(name='Success', description='success'),
  testSetRecordId?: long(name='TestSetRecordId', description='testSetRecordId'),
  requestId?: string(name='RequestId', description='requestId'),
}

model QueryTaskResultResponse = {
  headers: map[string]string(name='headers'),
  body: QueryTaskResultResponseBody(name='body'),
}

async function queryTaskResultWithOptions(request: QueryTaskResultRequest, runtime: Util.RuntimeOptions): QueryTaskResultResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('QueryTaskResult', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function queryTaskResult(request: QueryTaskResultRequest): QueryTaskResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTaskResultWithOptions(request, runtime);
}

model StopAiOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  taskId?: long(name='TaskId', description='任务id'),
}

model StopAiOutboundTaskResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model StopAiOutboundTaskResponse = {
  headers: map[string]string(name='headers'),
  body: StopAiOutboundTaskResponseBody(name='body'),
}

async function stopAiOutboundTaskWithOptions(request: StopAiOutboundTaskRequest, runtime: Util.RuntimeOptions): StopAiOutboundTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StopAiOutboundTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function stopAiOutboundTask(request: StopAiOutboundTaskRequest): StopAiOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopAiOutboundTaskWithOptions(request, runtime);
}

model GetAgentBasisStatusRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIds?: [ long ](name='AgentIds', description='坐席id列表'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
}

model GetAgentBasisStatusShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIdsShrink?: string(name='AgentIds', description='坐席id列表'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
}

model GetAgentBasisStatusResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='调用接口是否成功'),
  data?: {
    pageNum?: int32(name='PageNum', description='当前页数'),
    pageSize?: int32(name='PageSize', description='页大小'),
    totalNum?: int32(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
}

model GetAgentBasisStatusResponse = {
  headers: map[string]string(name='headers'),
  body: GetAgentBasisStatusResponseBody(name='body'),
}

async function getAgentBasisStatusWithOptions(tmpReq: GetAgentBasisStatusRequest, runtime: Util.RuntimeOptions): GetAgentBasisStatusResponse {
  Util.validateModel(tmpReq);
  var request = new GetAgentBasisStatusShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetAgentBasisStatus', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getAgentBasisStatus(request: GetAgentBasisStatusRequest): GetAgentBasisStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentBasisStatusWithOptions(request, runtime);
}

model ListRobotNodeRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  robotId?: long(name='RobotId'),
}

model ListRobotNodeResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: [ 
    {
      processName?: string(name='ProcessName'),
      modelName?: string(name='ModelName'),
      nodeName?: string(name='NodeName'),
      isOutput?: int32(name='IsOutput'),
      nodeIdentifier?: string(name='NodeIdentifier'),
    }
  ](name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model ListRobotNodeResponse = {
  headers: map[string]string(name='headers'),
  body: ListRobotNodeResponseBody(name='body'),
}

async function listRobotNodeWithOptions(request: ListRobotNodeRequest, runtime: Util.RuntimeOptions): ListRobotNodeResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListRobotNode', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listRobotNode(request: ListRobotNodeRequest): ListRobotNodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRobotNodeWithOptions(request, runtime);
}

model SmartOutboundRequest {
  appKey?: string(name='AppKey'),
  templateId?: long(name='TemplateId'),
  tenantId?: long(name='TenantId'),
  calling?: string(name='Calling'),
  called?: string(name='Called'),
}

model SmartOutboundResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  message?: string(name='Message'),
  data?: string(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  httpStatusCode?: long(name='HttpStatusCode'),
}

model SmartOutboundResponse = {
  headers: map[string]string(name='headers'),
  body: SmartOutboundResponseBody(name='body'),
}

async function smartOutboundWithOptions(request: SmartOutboundRequest, runtime: Util.RuntimeOptions): SmartOutboundResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SmartOutbound', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function smartOutbound(request: SmartOutboundRequest): SmartOutboundResponse {
  var runtime = new Util.RuntimeOptions{};
  return smartOutboundWithOptions(request, runtime);
}

model GetQualityResultRequest {
  instanceId?: string(name='InstanceId'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
  touchStartTime?: string(name='TouchStartTime'),
  touchEndTime?: string(name='TouchEndTime'),
  channelType?: string(name='ChannelType'),
  hitStatus?: int32(name='HitStatus'),
  groupIds?: [ long ](name='GroupIds'),
  qualityRuleIds?: [ long ](name='QualityRuleIds'),
  projectIds?: [ long ](name='ProjectIds'),
}

model GetQualityResultResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  channelTypeName?: string(name='ChannelTypeName'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: {
    pageNo?: int32(name='PageNo'),
    pageSize?: int32(name='PageSize'),
    totalNum?: int32(name='TotalNum'),
    qualityResultResponseList?: [ 
      {
        touchId?: string(name='TouchId'),
        memberName?: string(name='MemberName'),
        servicerName?: string(name='ServicerName'),
        channelType?: string(name='ChannelType'),
        projectId?: string(name='ProjectId'),
        projectName?: string(name='ProjectName'),
        channelTypeName?: string(name='ChannelTypeName'),
        touchStartTime?: string(name='TouchStartTime'),
        servicerId?: string(name='ServicerId'),
        ruleId?: string(name='RuleId'),
        ruleName?: string(name='RuleName'),
        groupName?: string(name='GroupName'),
        groupId?: string(name='GroupId'),
        instanceName?: string(name='InstanceName'),
        hitStatus?: boolean(name='HitStatus'),
        hitDetail?: string(name='HitDetail'),
      }
    ](name='QualityResultResponseList'),
  }(name='Data'),
}

model GetQualityResultResponse = {
  headers: map[string]string(name='headers'),
  body: GetQualityResultResponseBody(name='body'),
}

async function getQualityResultWithOptions(request: GetQualityResultRequest, runtime: Util.RuntimeOptions): GetQualityResultResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetQualityResult', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getQualityResult(request: GetQualityResultRequest): GetQualityResultResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityResultWithOptions(request, runtime);
}

model GetIndexCurrentValueRequest {
  depIds?: string(name='DepIds'),
  groupIds?: string(name='GroupIds'),
  instanceId?: string(name='InstanceId'),
}

model GetIndexCurrentValueResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: [  map[string]any ](name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model GetIndexCurrentValueResponse = {
  headers: map[string]string(name='headers'),
  body: GetIndexCurrentValueResponseBody(name='body'),
}

async function getIndexCurrentValueWithOptions(request: GetIndexCurrentValueRequest, runtime: Util.RuntimeOptions): GetIndexCurrentValueResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetIndexCurrentValue', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getIndexCurrentValue(request: GetIndexCurrentValueRequest): GetIndexCurrentValueResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIndexCurrentValueWithOptions(request, runtime);
}

model GenerateWebSocketSignRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
}

model GenerateWebSocketSignResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  httpStatusCode?: long(name='HttpStatusCode'),
}

model GenerateWebSocketSignResponse = {
  headers: map[string]string(name='headers'),
  body: GenerateWebSocketSignResponseBody(name='body'),
}

async function generateWebSocketSignWithOptions(request: GenerateWebSocketSignRequest, runtime: Util.RuntimeOptions): GenerateWebSocketSignResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GenerateWebSocketSign', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function generateWebSocketSign(request: GenerateWebSocketSignRequest): GenerateWebSocketSignResponse {
  var runtime = new Util.RuntimeOptions{};
  return generateWebSocketSignWithOptions(request, runtime);
}

model CreateAgentRequest {
  clientToken?: string(name='ClientToken', description='js sdk中自动生成的鉴权token'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  displayName?: string(name='DisplayName'),
  skillGroupId?: [ long ](name='SkillGroupId'),
  skillGroupIdList?: [ long ](name='SkillGroupIdList'),
}

model CreateAgentResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: long(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  httpStatusCode?: long(name='HttpStatusCode'),
}

model CreateAgentResponse = {
  headers: map[string]string(name='headers'),
  body: CreateAgentResponseBody(name='body'),
}

async function createAgentWithOptions(request: CreateAgentRequest, runtime: Util.RuntimeOptions): CreateAgentResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateAgent', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createAgent(request: CreateAgentRequest): CreateAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAgentWithOptions(request, runtime);
}

model QueryTaskDetailRequest {
  outboundTaskId?: string(name='OutboundTaskId'),
  statusList?: string(name='StatusList'),
  endReasonList?: string(name='EndReasonList'),
  skillGroup?: string(name='SkillGroup'),
  servicerName?: string(name='ServicerName'),
  servicerId?: string(name='ServicerId'),
  priorityList?: string(name='PriorityList'),
  taskId?: long(name='TaskId'),
  ani?: string(name='Ani'),
  dnis?: string(name='Dnis'),
  sid?: string(name='Sid'),
  departmentIdList?: string(name='DepartmentIdList'),
  instanceId?: string(name='InstanceId'),
  pageSize?: int32(name='PageSize'),
  currentPage?: int32(name='CurrentPage'),
}

model QueryTaskDetailResponseBody = {
  httpStatusCode?: string(name='HttpStatusCode'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  data?: {
    totalResults?: string(name='TotalResults'),
    currentPage?: string(name='CurrentPage'),
    pageSize?: string(name='PageSize'),
    list?: [ 
      {
        status?: int32(name='Status'),
        servicerName?: string(name='ServicerName'),
        memberName?: string(name='MemberName'),
        outboundNum?: int32(name='OutboundNum'),
        retryTime?: string(name='RetryTime'),
        priority?: int32(name='Priority'),
        gmtModified?: long(name='GmtModified'),
        dnis?: string(name='Dnis'),
        servicerId?: long(name='ServicerId'),
        outboundTaskId?: long(name='OutboundTaskId'),
        buId?: long(name='BuId'),
        endReason?: int32(name='EndReason'),
        gmtCreate?: long(name='GmtCreate'),
        departmentId?: long(name='DepartmentId'),
        ani?: string(name='Ani'),
        memberId?: long(name='MemberId'),
        skillGroup?: int32(name='SkillGroup'),
        extAttrs?: string(name='ExtAttrs'),
        id?: int32(name='Id'),
      }
    ](name='List'),
  }(name='Data'),
}

model QueryTaskDetailResponse = {
  headers: map[string]string(name='headers'),
  body: QueryTaskDetailResponseBody(name='body'),
}

async function queryTaskDetailWithOptions(request: QueryTaskDetailRequest, runtime: Util.RuntimeOptions): QueryTaskDetailResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('QueryTaskDetail', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function queryTaskDetail(request: QueryTaskDetailRequest): QueryTaskDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTaskDetailWithOptions(request, runtime);
}

model EditQualityRuleRequest {
  instanceId?: string(name='InstanceId'),
  name?: string(name='Name'),
  ruleTag?: int32(name='RuleTag'),
  matchType?: int32(name='MatchType'),
  qualityRuleId?: long(name='QualityRuleId'),
  keyWords?: [ string ](name='KeyWords'),
}

model EditQualityRuleResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model EditQualityRuleResponse = {
  headers: map[string]string(name='headers'),
  body: EditQualityRuleResponseBody(name='body'),
}

async function editQualityRuleWithOptions(request: EditQualityRuleRequest, runtime: Util.RuntimeOptions): EditQualityRuleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('EditQualityRule', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function editQualityRule(request: EditQualityRuleRequest): EditQualityRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return editQualityRuleWithOptions(request, runtime);
}

model GetMcuLvsIpRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
}

model GetMcuLvsIpResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='success'),
  code?: string(name='Code', description='error code'),
  message?: string(name='Message', description='error message'),
  data?: string(name='Data', description='result data'),
}

model GetMcuLvsIpResponse = {
  headers: map[string]string(name='headers'),
  body: GetMcuLvsIpResponseBody(name='body'),
}

async function getMcuLvsIpWithOptions(request: GetMcuLvsIpRequest, runtime: Util.RuntimeOptions): GetMcuLvsIpResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetMcuLvsIp', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getMcuLvsIp(request: GetMcuLvsIpRequest): GetMcuLvsIpResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMcuLvsIpWithOptions(request, runtime);
}

model GetDepGroupTreeDataRequest {
  instanceId?: string(name='InstanceId', description='租户实例ID'),
  agentId?: long(name='AgentId', description='坐席ID'),
}

model GetDepGroupTreeDataResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  message?: string(name='Message', description='Message'),
  code?: string(name='Code', description='Code'),
  success?: string(name='Success', description='Success'),
  data?: [ 
    {
      depGroupName?: string(name='DepGroupName', description='depGroupName'),
      depGroupId?: string(name='DepGroupId', description='depGroupId'),
      groupDTOS?: [ 
        {
          skillGroupId?: long(name='SkillGroupId', description='skillGroupId'),
          name?: string(name='Name', description='name'),
        }
      ](name='GroupDTOS', description='groupDTOS'),
    }
  ](name='Data', description='Data'),
}

model GetDepGroupTreeDataResponse = {
  headers: map[string]string(name='headers'),
  body: GetDepGroupTreeDataResponseBody(name='body'),
}

async function getDepGroupTreeDataWithOptions(request: GetDepGroupTreeDataRequest, runtime: Util.RuntimeOptions): GetDepGroupTreeDataResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetDepGroupTreeData', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getDepGroupTreeData(request: GetDepGroupTreeDataRequest): GetDepGroupTreeDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDepGroupTreeDataWithOptions(request, runtime);
}

model DeleteAgentRequest {
  clientToken?: string(name='ClientToken', description='js sdk中自动生成的鉴权token'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
}

model DeleteAgentResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  httpStatusCode?: long(name='HttpStatusCode'),
}

model DeleteAgentResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteAgentResponseBody(name='body'),
}

async function deleteAgentWithOptions(request: DeleteAgentRequest, runtime: Util.RuntimeOptions): DeleteAgentResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('DeleteAgent', '2019-10-15', 'HTTPS', 'DELETE', 'AK', 'json', req, runtime);
}

async function deleteAgent(request: DeleteAgentRequest): DeleteAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAgentWithOptions(request, runtime);
}

model GetCustomerInfoRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  memberId?: long(name='MemberId', description='会员ID'),
}

model GetCustomerInfoResponseBody = {
  requestId?: string(name='RequestId', description='请求ID'),
  message?: string(name='Message', description='错误信息'),
  code?: string(name='Code', description='错误码'),
  success?: boolean(name='Success', description='是否请求成功'),
  data?: {
    nick?: string(name='Nick', description='昵称'),
    photo?: string(name='Photo', description='头像'),
    userId?: long(name='UserId', description='会员ID'),
    realName?: string(name='RealName', description='真实姓名'),
    outerId?: string(name='OuterId', description='外部ID'),
    customizeFields?: map[string]any(name='CustomizeFields', description='自定义字段'),
  }(name='Data', description='会员信息'),
}

model GetCustomerInfoResponse = {
  headers: map[string]string(name='headers'),
  body: GetCustomerInfoResponseBody(name='body'),
}

async function getCustomerInfoWithOptions(request: GetCustomerInfoRequest, runtime: Util.RuntimeOptions): GetCustomerInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetCustomerInfo', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getCustomerInfo(request: GetCustomerInfoRequest): GetCustomerInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCustomerInfoWithOptions(request, runtime);
}

model GetHotlineAgentDetailReportRequest {
  currentPage?: int32(name='CurrentPage'),
  pageSize?: int32(name='PageSize'),
  startDate?: long(name='StartDate'),
  endDate?: long(name='EndDate'),
  instanceId?: string(name='InstanceId'),
  depIds?: [ long ](name='DepIds'),
  groupIds?: [ long ](name='GroupIds'),
}

model GetHotlineAgentDetailReportResponseBody = {
  httpStatusCode?: long(name='HttpStatusCode'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  data?: {
    pageSize?: int32(name='PageSize'),
    total?: int32(name='Total'),
    page?: int32(name='Page'),
    columns?: [ 
      {
        key?: string(name='Key'),
        title?: string(name='Title'),
      }
    ](name='Columns'),
    rows?: [  map[string]any ](name='Rows'),
  }(name='Data'),
}

model GetHotlineAgentDetailReportResponse = {
  headers: map[string]string(name='headers'),
  body: GetHotlineAgentDetailReportResponseBody(name='body'),
}

async function getHotlineAgentDetailReportWithOptions(request: GetHotlineAgentDetailReportRequest, runtime: Util.RuntimeOptions): GetHotlineAgentDetailReportResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetHotlineAgentDetailReport', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getHotlineAgentDetailReport(request: GetHotlineAgentDetailReportRequest): GetHotlineAgentDetailReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineAgentDetailReportWithOptions(request, runtime);
}

model InsertAiOutboundPhoneNumsRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  taskId?: long(name='TaskId', description='任务id'),
  batchVersion?: int32(name='BatchVersion', description='任务批次号（不填则导入到默认批次）'),
  details?: [ 
    {
      bizData?: string(name='BizData', description='自定义信息'),
      phoneNum?: string(name='PhoneNum', description='手机号'),
    }
  ](name='Details', description='号码详情(至多30条)'),
}

model InsertAiOutboundPhoneNumsShrinkRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  taskId?: long(name='TaskId', description='任务id'),
  batchVersion?: int32(name='BatchVersion', description='任务批次号（不填则导入到默认批次）'),
  detailsShrink?: string(name='Details', description='号码详情(至多30条)'),
}

model InsertAiOutboundPhoneNumsResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  data?: {
    totalCount?: int32(name='TotalCount', description='导入总数'),
    successCount?: int32(name='SuccessCount', description='导入成功数量'),
    failInfo?: [ 
      {
        bizData?: string(name='BizData', description='自定义信息'),
        phoneNum?: string(name='PhoneNum', description='外呼被叫号码'),
        msg?: string(name='Msg', description='失败原因描述'),
      }
    ](name='FailInfo', description='失败号码详情'),
  }(name='Data', description='导入结果'),
}

model InsertAiOutboundPhoneNumsResponse = {
  headers: map[string]string(name='headers'),
  body: InsertAiOutboundPhoneNumsResponseBody(name='body'),
}

async function insertAiOutboundPhoneNumsWithOptions(tmpReq: InsertAiOutboundPhoneNumsRequest, runtime: Util.RuntimeOptions): InsertAiOutboundPhoneNumsResponse {
  Util.validateModel(tmpReq);
  var request = new InsertAiOutboundPhoneNumsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.details)) {
    request.detailsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.details, 'Details', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('InsertAiOutboundPhoneNums', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function insertAiOutboundPhoneNums(request: InsertAiOutboundPhoneNumsRequest): InsertAiOutboundPhoneNumsResponse {
  var runtime = new Util.RuntimeOptions{};
  return insertAiOutboundPhoneNumsWithOptions(request, runtime);
}

model SendCcoSmartCallRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  prodCode?: string(name='ProdCode'),
  calledShowNumber?: string(name='CalledShowNumber'),
  calledNumber?: string(name='CalledNumber'),
  voiceCode?: string(name='VoiceCode'),
  outId?: string(name='OutId'),
  playTimes?: int32(name='PlayTimes'),
  volume?: int32(name='Volume'),
  speed?: int32(name='Speed'),
  asrModelId?: string(name='AsrModelId'),
  asrBaseId?: string(name='AsrBaseId'),
  asrAlsAmId?: string(name='AsrAlsAmId'),
  asrVocabularyId?: string(name='AsrVocabularyId'),
  recordFlag?: boolean(name='RecordFlag'),
  pauseTime?: int32(name='PauseTime'),
  muteTime?: int32(name='MuteTime'),
  actionCodeBreak?: boolean(name='ActionCodeBreak'),
  dynamicId?: string(name='DynamicId'),
  earlyMediaAsr?: boolean(name='EarlyMediaAsr'),
  voiceCodeParam?: string(name='VoiceCodeParam'),
  sessionTimeout?: int32(name='SessionTimeout'),
  actionCodeTimeBreak?: int32(name='ActionCodeTimeBreak'),
  ttsConf?: boolean(name='TtsConf'),
  ttsStyle?: string(name='TtsStyle'),
  ttsVolume?: int32(name='TtsVolume'),
  ttsSpeed?: int32(name='TtsSpeed'),
  backgroundFileCode?: string(name='BackgroundFileCode'),
  backgroundVolume?: int32(name='BackgroundVolume'),
  backgroundSpeed?: int32(name='BackgroundSpeed'),
  enableITN?: boolean(name='EnableITN'),
}

model SendCcoSmartCallResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
}

model SendCcoSmartCallResponse = {
  headers: map[string]string(name='headers'),
  body: SendCcoSmartCallResponseBody(name='body'),
}

async function sendCcoSmartCallWithOptions(request: SendCcoSmartCallRequest, runtime: Util.RuntimeOptions): SendCcoSmartCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SendCcoSmartCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function sendCcoSmartCall(request: SendCcoSmartCallRequest): SendCcoSmartCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendCcoSmartCallWithOptions(request, runtime);
}

model ListChatRecordDetailRequest {
  clientToken?: string(name='ClientToken', description='clientToken'),
  instanceId?: string(name='InstanceId', description='实例id'),
  closeTimeEnd?: long(name='CloseTimeEnd', description='在线挂断的时间范围'),
  currentPage?: int32(name='CurrentPage', description='当前页'),
  pageSize?: int32(name='PageSize', description='每页数据量'),
  closeTimeStart?: long(name='CloseTimeStart', description='在线挂断的时间范围'),
}

model ListChatRecordDetailResponseBody = {
  message?: string(name='Message', description='message'),
  requestId?: string(name='RequestId', description='requestId'),
  httpStatusCode?: int32(name='HttpStatusCode', description='httpStatusCode'),
  resultData?: {
    currentPage?: long(name='CurrentPage'),
    totalResults?: long(name='TotalResults'),
    totalPage?: long(name='TotalPage'),
    onePageSize?: long(name='OnePageSize'),
    data?: [ 
      {
        servicerName?: string(name='ServicerName'),
        startTime?: long(name='StartTime', description='在线开始时间'),
        endTime?: long(name='EndTime', description='在线结束时间'),
        messageList?: [ 
          {
            senderName?: string(name='SenderName'),
            content?: string(name='Content'),
            senderType?: long(name='SenderType'),
            createTime?: long(name='CreateTime'),
            msgType?: string(name='MsgType'),
          }
        ](name='MessageList', description='在线会话详细信息'),
      }
    ](name='Data'),
  }(name='ResultData', description='data'),
  code?: string(name='Code', description='code'),
  success?: boolean(name='Success', description='success'),
}

model ListChatRecordDetailResponse = {
  headers: map[string]string(name='headers'),
  body: ListChatRecordDetailResponseBody(name='body'),
}

async function listChatRecordDetailWithOptions(request: ListChatRecordDetailRequest, runtime: Util.RuntimeOptions): ListChatRecordDetailResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListChatRecordDetail', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listChatRecordDetail(request: ListChatRecordDetailRequest): ListChatRecordDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return listChatRecordDetailWithOptions(request, runtime);
}

model AiccsSmartCallOperateRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  prodCode?: string(name='ProdCode'),
  callId?: string(name='CallId'),
  command?: string(name='Command'),
  param?: string(name='Param'),
}

model AiccsSmartCallOperateResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
}

model AiccsSmartCallOperateResponse = {
  headers: map[string]string(name='headers'),
  body: AiccsSmartCallOperateResponseBody(name='body'),
}

async function aiccsSmartCallOperateWithOptions(request: AiccsSmartCallOperateRequest, runtime: Util.RuntimeOptions): AiccsSmartCallOperateResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AiccsSmartCallOperate', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function aiccsSmartCallOperate(request: AiccsSmartCallOperateRequest): AiccsSmartCallOperateResponse {
  var runtime = new Util.RuntimeOptions{};
  return aiccsSmartCallOperateWithOptions(request, runtime);
}

model AddSkillGroupRequest {
  outerGroupId?: string(name='OuterGroupId'),
  outerGroupName?: string(name='OuterGroupName'),
  outerGroupType?: string(name='OuterGroupType'),
  outerDepartmentId?: string(name='OuterDepartmentId'),
  outerDepartmentType?: string(name='OuterDepartmentType'),
}

model AddSkillGroupResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model AddSkillGroupResponse = {
  headers: map[string]string(name='headers'),
  body: AddSkillGroupResponseBody(name='body'),
}

async function addSkillGroupWithOptions(request: AddSkillGroupRequest, runtime: Util.RuntimeOptions): AddSkillGroupResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('AddSkillGroup', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function addSkillGroup(request: AddSkillGroupRequest): AddSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return addSkillGroupWithOptions(request, runtime);
}

model HangupCallRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  callId?: string(name='CallId'),
  jobId?: string(name='JobId'),
  connectionId?: string(name='ConnectionId'),
}

model HangupCallResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model HangupCallResponse = {
  headers: map[string]string(name='headers'),
  body: HangupCallResponseBody(name='body'),
}

async function hangupCallWithOptions(request: HangupCallRequest, runtime: Util.RuntimeOptions): HangupCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('HangupCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function hangupCall(request: HangupCallRequest): HangupCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return hangupCallWithOptions(request, runtime);
}

model DeleteSkillGroupRequest {
  outerGroupType?: string(name='OuterGroupType'),
  outerGroupId?: string(name='OuterGroupId'),
}

model DeleteSkillGroupResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: boolean(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model DeleteSkillGroupResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteSkillGroupResponseBody(name='body'),
}

async function deleteSkillGroupWithOptions(request: DeleteSkillGroupRequest, runtime: Util.RuntimeOptions): DeleteSkillGroupResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('DeleteSkillGroup', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function deleteSkillGroup(request: DeleteSkillGroupRequest): DeleteSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSkillGroupWithOptions(request, runtime);
}

model ListAiccsRobotRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  robotName?: string(name='RobotName'),
}

model ListAiccsRobotResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: [ 
    {
      robotType?: string(name='RobotType'),
      atSence?: string(name='AtSence'),
      atProfession?: string(name='AtProfession'),
      robotName?: string(name='RobotName'),
      id?: long(name='Id'),
    }
  ](name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model ListAiccsRobotResponse = {
  headers: map[string]string(name='headers'),
  body: ListAiccsRobotResponseBody(name='body'),
}

async function listAiccsRobotWithOptions(request: ListAiccsRobotRequest, runtime: Util.RuntimeOptions): ListAiccsRobotResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListAiccsRobot', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listAiccsRobot(request: ListAiccsRobotRequest): ListAiccsRobotResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAiccsRobotWithOptions(request, runtime);
}

model CreateQualityProjectRequest {
  projectName?: string(name='ProjectName'),
  checkFreqType?: int32(name='CheckFreqType'),
  scopeType?: int32(name='ScopeType'),
  timeRangeStart?: string(name='TimeRangeStart'),
  timeRangeEnd?: string(name='TimeRangeEnd'),
  instanceId?: string(name='InstanceId'),
  channelTouchType?: [ int32 ](name='ChannelTouchType'),
  depList?: [ long ](name='DepList'),
  groupList?: [ long ](name='GroupList'),
  servicerList?: [ string ](name='ServicerList'),
  analysisIds?: [ long ](name='AnalysisIds'),
}

model CreateQualityProjectResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: {
    instanceId?: string(name='InstanceId'),
    version?: int32(name='Version'),
    projectId?: long(name='ProjectId'),
  }(name='Data'),
}

model CreateQualityProjectResponse = {
  headers: map[string]string(name='headers'),
  body: CreateQualityProjectResponseBody(name='body'),
}

async function createQualityProjectWithOptions(request: CreateQualityProjectRequest, runtime: Util.RuntimeOptions): CreateQualityProjectResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateQualityProject', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createQualityProject(request: CreateQualityProjectRequest): CreateQualityProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return createQualityProjectWithOptions(request, runtime);
}

model RobotCallRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  calledShowNumber?: string(name='CalledShowNumber'),
  calledNumber?: string(name='CalledNumber'),
  robotId?: long(name='RobotId'),
  outId?: string(name='OutId'),
  recordFlag?: boolean(name='RecordFlag'),
  earlyMediaAsr?: boolean(name='EarlyMediaAsr'),
  params?: string(name='Params'),
}

model RobotCallResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
}

model RobotCallResponse = {
  headers: map[string]string(name='headers'),
  body: RobotCallResponseBody(name='body'),
}

async function robotCallWithOptions(request: RobotCallRequest, runtime: Util.RuntimeOptions): RobotCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RobotCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function robotCall(request: RobotCallRequest): RobotCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return robotCallWithOptions(request, runtime);
}

model QuerySkillGroupsRequest {
  instanceId?: string(name='InstanceId'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
  clientToken?: string(name='ClientToken'),
  channelType?: int32(name='ChannelType', description='技能组类型（1：热线，2：在线，4：工单）'),
  departmentId?: long(name='DepartmentId', description='部门ID'),
}

model QuerySkillGroupsResponseBody = {
  onePageSize?: int32(name='OnePageSize'),
  totalPage?: int32(name='TotalPage'),
  requestId?: string(name='RequestId'),
  currentPage?: int32(name='CurrentPage'),
  totalResults?: int32(name='TotalResults'),
  data?: [ 
    {
      displayName?: string(name='DisplayName'),
      description?: string(name='Description'),
      channelType?: int32(name='ChannelType'),
      skillGroupName?: string(name='SkillGroupName'),
      skillGroupId?: long(name='SkillGroupId'),
    }
  ](name='Data'),
}

model QuerySkillGroupsResponse = {
  headers: map[string]string(name='headers'),
  body: QuerySkillGroupsResponseBody(name='body'),
}

async function querySkillGroupsWithOptions(request: QuerySkillGroupsRequest, runtime: Util.RuntimeOptions): QuerySkillGroupsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('QuerySkillGroups', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function querySkillGroups(request: QuerySkillGroupsRequest): QuerySkillGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySkillGroupsWithOptions(request, runtime);
}

model CreateQualityRuleRequest {
  instanceId?: string(name='InstanceId'),
  name?: string(name='Name'),
  ruleTag?: int32(name='RuleTag'),
  matchType?: int32(name='MatchType'),
  keyWords?: [ string ](name='KeyWords'),
}

model CreateQualityRuleResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateQualityRuleResponse = {
  headers: map[string]string(name='headers'),
  body: CreateQualityRuleResponseBody(name='body'),
}

async function createQualityRuleWithOptions(request: CreateQualityRuleRequest, runtime: Util.RuntimeOptions): CreateQualityRuleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateQualityRule', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createQualityRule(request: CreateQualityRuleRequest): CreateQualityRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createQualityRuleWithOptions(request, runtime);
}

model ListRolesRequest {
  clientToken?: string(name='ClientToken', description='clientToken'),
  instanceId?: string(name='InstanceId', description='租户实例id'),
}

model ListRolesResponseBody = {
  message?: string(name='Message', description='message'),
  requestId?: string(name='RequestId', description='requestId'),
  httpStatusCode?: int32(name='HttpStatusCode', description='httpStatusCode'),
  data?: [ 
    {
      roleId?: long(name='RoleId', description='角色id'),
      createTime?: string(name='CreateTime', description='创建时间'),
      buId?: long(name='BuId', description='租户id'),
      title?: string(name='Title', description='角色名称'),
      code?: string(name='Code', description='角色code'),
      description?: string(name='Description', description='角色描述'),
      roleGroupId?: long(name='RoleGroupId', description='所属角色组id'),
      roleGroupName?: string(name='RoleGroupName', description='所属角色组名称'),
    }
  ](name='Data', description='data'),
  success?: boolean(name='Success', description='success'),
}

model ListRolesResponse = {
  headers: map[string]string(name='headers'),
  body: ListRolesResponseBody(name='body'),
}

async function listRolesWithOptions(request: ListRolesRequest, runtime: Util.RuntimeOptions): ListRolesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListRoles', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listRoles(request: ListRolesRequest): ListRolesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRolesWithOptions(request, runtime);
}

model ListSkillGroupRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  channelType?: int32(name='ChannelType'),
}

model ListSkillGroupResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: [ 
    {
      displayName?: string(name='DisplayName'),
      description?: string(name='Description'),
      channelType?: int32(name='ChannelType'),
      skillGroupId?: long(name='SkillGroupId'),
      name?: string(name='Name'),
    }
  ](name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model ListSkillGroupResponse = {
  headers: map[string]string(name='headers'),
  body: ListSkillGroupResponseBody(name='body'),
}

async function listSkillGroupWithOptions(request: ListSkillGroupRequest, runtime: Util.RuntimeOptions): ListSkillGroupResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListSkillGroup', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listSkillGroup(request: ListSkillGroupRequest): ListSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSkillGroupWithOptions(request, runtime);
}

model GetHotlineCallActionRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  act?: int32(name='Act'),
  fromSource?: string(name='FromSource'),
  biz?: string(name='Biz'),
  acc?: string(name='Acc'),
}

model GetHotlineCallActionResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: {
    touchId?: long(name='TouchId'),
    depId?: long(name='DepId'),
    servicerName?: string(name='ServicerName'),
    memberName?: string(name='MemberName'),
    channelType?: long(name='ChannelType'),
    subTouchId?: long(name='SubTouchId'),
    calloutName?: string(name='CalloutName'),
    actionId?: long(name='ActionId'),
    servicerId?: long(name='ServicerId'),
    buId?: long(name='BuId'),
    calloutId?: long(name='CalloutId'),
    caseId?: long(name='CaseId'),
    channelId?: string(name='ChannelId'),
    isTransfer?: string(name='IsTransfer'),
    memberId?: long(name='MemberId'),
    taskId?: long(name='TaskId'),
    memberList?: string(name='MemberList'),
  }(name='Data'),
}

model GetHotlineCallActionResponse = {
  headers: map[string]string(name='headers'),
  body: GetHotlineCallActionResponseBody(name='body'),
}

async function getHotlineCallActionWithOptions(request: GetHotlineCallActionRequest, runtime: Util.RuntimeOptions): GetHotlineCallActionResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetHotlineCallAction', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getHotlineCallAction(request: GetHotlineCallActionRequest): GetHotlineCallActionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineCallActionWithOptions(request, runtime);
}

model GetOnlineSeatInformationRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIds?: [ long ](name='AgentIds', description='坐席id列表'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
}

model GetOnlineSeatInformationShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIdsShrink?: string(name='AgentIds', description='坐席id列表'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
}

model GetOnlineSeatInformationResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='调用接口是否成功'),
  data?: {
    pageNum?: int32(name='PageNum', description='当前页数'),
    pageSize?: int32(name='PageSize', description='页大小'),
    totalNum?: int32(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
}

model GetOnlineSeatInformationResponse = {
  headers: map[string]string(name='headers'),
  body: GetOnlineSeatInformationResponseBody(name='body'),
}

async function getOnlineSeatInformationWithOptions(tmpReq: GetOnlineSeatInformationRequest, runtime: Util.RuntimeOptions): GetOnlineSeatInformationResponse {
  Util.validateModel(tmpReq);
  var request = new GetOnlineSeatInformationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetOnlineSeatInformation', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getOnlineSeatInformation(request: GetOnlineSeatInformationRequest): GetOnlineSeatInformationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOnlineSeatInformationWithOptions(request, runtime);
}

model DeleteQualityProjectRequest {
  instanceId?: string(name='InstanceId'),
  projectId?: long(name='ProjectId'),
}

model DeleteQualityProjectResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteQualityProjectResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteQualityProjectResponseBody(name='body'),
}

async function deleteQualityProjectWithOptions(request: DeleteQualityProjectRequest, runtime: Util.RuntimeOptions): DeleteQualityProjectResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteQualityProject', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteQualityProject(request: DeleteQualityProjectRequest): DeleteQualityProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteQualityProjectWithOptions(request, runtime);
}

model QueryTouchListRequest {
  instanceId?: string(name='InstanceId'),
  touchId?: [ long ](name='TouchId'),
  channelId?: [ string ](name='ChannelId'),
  channelType?: [ int32 ](name='ChannelType'),
  touchType?: [ int32 ](name='TouchType'),
  memberId?: [ long ](name='MemberId'),
  memberName?: [ string ](name='MemberName'),
  servicerId?: [ long ](name='ServicerId'),
  servicerName?: [ string ](name='ServicerName'),
  queueId?: [ long ](name='QueueId'),
  evaluationStatus?: [ int32 ](name='EvaluationStatus'),
  evaluationLevel?: [ int32 ](name='EvaluationLevel'),
  evaluationScore?: [ int32 ](name='EvaluationScore'),
  firstTimeStart?: long(name='FirstTimeStart'),
  firstTimeEnd?: long(name='FirstTimeEnd'),
  closeTimeStart?: long(name='CloseTimeStart'),
  closeTimeEnd?: long(name='CloseTimeEnd'),
  pageSize?: int32(name='PageSize'),
  currentPage?: int32(name='CurrentPage'),
}

model QueryTouchListResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  resultData?: {
    totalResults?: int32(name='TotalResults'),
    nextPage?: int32(name='NextPage'),
    currentPage?: int32(name='CurrentPage'),
    totalPage?: int32(name='TotalPage'),
    previousPage?: int32(name='PreviousPage'),
    onePageSize?: int32(name='OnePageSize'),
    empty?: boolean(name='Empty'),
    data?: [ 
      {
        status?: int32(name='Status'),
        toId?: long(name='ToId'),
        parentTouchId?: long(name='ParentTouchId'),
        servicerName?: string(name='ServicerName'),
        channelType?: int32(name='ChannelType'),
        closeTime?: long(name='CloseTime'),
        gmtModified?: long(name='GmtModified'),
        servicerId?: long(name='ServicerId'),
        switchUser?: string(name='SwitchUser'),
        buId?: long(name='BuId'),
        fromId?: long(name='FromId'),
        userTouchId?: long(name='UserTouchId'),
        touchTime?: string(name='TouchTime'),
        touchContent?: string(name='TouchContent'),
        feedback?: string(name='Feedback'),
        touchId?: string(name='TouchId'),
        queueId?: long(name='QueueId'),
        depId?: long(name='DepId'),
        touchEndReason?: int32(name='TouchEndReason'),
        memberName?: string(name='MemberName'),
        commonQueueName?: string(name='CommonQueueName'),
        firstTime?: long(name='FirstTime'),
        touchType?: int32(name='TouchType'),
        gmtCreate?: long(name='GmtCreate'),
        channelId?: string(name='ChannelId'),
        memberId?: long(name='MemberId'),
        extAttrsString?: map[string]any(name='ExtAttrsString'),
        extAttrs?: {
          evaluationScore?: int32(name='EvaluationScore'),
          evaluationLevel?: int32(name='EvaluationLevel'),
          evaluationSolution?: int32(name='EvaluationSolution'),
          ani?: string(name='Ani'),
          onlineJoinRespInterval?: int32(name='OnlineJoinRespInterval'),
          onlineSessionSource?: int32(name='OnlineSessionSource'),
          evaluationStatus?: int32(name='EvaluationStatus'),
          dnis?: string(name='Dnis'),
          outCallRouteNumber?: string(name='OutCallRouteNumber'),
        }(name='ExtAttrs'),
      }
    ](name='Data'),
  }(name='ResultData'),
}

model QueryTouchListResponse = {
  headers: map[string]string(name='headers'),
  body: QueryTouchListResponseBody(name='body'),
}

async function queryTouchListWithOptions(request: QueryTouchListRequest, runtime: Util.RuntimeOptions): QueryTouchListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('QueryTouchList', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function queryTouchList(request: QueryTouchListRequest): QueryTouchListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTouchListWithOptions(request, runtime);
}

model QueryHotlineInQueueRequest {
  outerGroupId?: string(name='OuterGroupId'),
  outerGroupType?: string(name='OuterGroupType'),
}

model QueryHotlineInQueueResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model QueryHotlineInQueueResponse = {
  headers: map[string]string(name='headers'),
  body: QueryHotlineInQueueResponseBody(name='body'),
}

async function queryHotlineInQueueWithOptions(request: QueryHotlineInQueueRequest, runtime: Util.RuntimeOptions): QueryHotlineInQueueResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('QueryHotlineInQueue', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function queryHotlineInQueue(request: QueryHotlineInQueueRequest): QueryHotlineInQueueResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryHotlineInQueueWithOptions(request, runtime);
}

model FinishHotlineServiceRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
}

model FinishHotlineServiceResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  httpStatusCode?: long(name='HttpStatusCode'),
}

model FinishHotlineServiceResponse = {
  headers: map[string]string(name='headers'),
  body: FinishHotlineServiceResponseBody(name='body'),
}

async function finishHotlineServiceWithOptions(request: FinishHotlineServiceRequest, runtime: Util.RuntimeOptions): FinishHotlineServiceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('FinishHotlineService', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function finishHotlineService(request: FinishHotlineServiceRequest): FinishHotlineServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return finishHotlineServiceWithOptions(request, runtime);
}

model ListOutboundStrategiesRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  prodCode?: string(name='ProdCode'),
  buId?: long(name='BuId'),
  keyword?: string(name='Keyword'),
}

model ListOutboundStrategiesResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  outboundStrategies?: [ 
    {
      status?: int32(name='Status'),
      successRate?: int32(name='SuccessRate'),
      process?: int32(name='Process'),
      gmtModifiedStr?: string(name='GmtModifiedStr'),
      outboundNum?: string(name='OutboundNum'),
      modifierId?: long(name='ModifierId'),
      outboundStrategyName?: string(name='OutboundStrategyName'),
      outboundStrategyId?: long(name='OutboundStrategyId'),
      sceneName?: string(name='SceneName'),
      creatorId?: long(name='CreatorId'),
      robotName?: string(name='RobotName'),
      modifierName?: string(name='ModifierName'),
      resourceAllocation?: int32(name='ResourceAllocation'),
      extAttr?: string(name='ExtAttr'),
      numType?: int32(name='NumType'),
      buId?: long(name='BuId'),
      robotId?: string(name='RobotId'),
      creatorName?: string(name='CreatorName'),
      departmentId?: long(name='DepartmentId'),
      robotType?: int32(name='RobotType'),
      ruleCode?: long(name='RuleCode'),
      gmtCreateStr?: string(name='GmtCreateStr'),
    }
  ](name='OutboundStrategies'),
  code?: string(name='Code'),
}

model ListOutboundStrategiesResponse = {
  headers: map[string]string(name='headers'),
  body: ListOutboundStrategiesResponseBody(name='body'),
}

async function listOutboundStrategiesWithOptions(request: ListOutboundStrategiesRequest, runtime: Util.RuntimeOptions): ListOutboundStrategiesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListOutboundStrategies', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listOutboundStrategies(request: ListOutboundStrategiesRequest): ListOutboundStrategiesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOutboundStrategiesWithOptions(request, runtime);
}

model ListTaskRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskName?: string(name='TaskName'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
  status?: string(name='Status'),
  taskId?: long(name='TaskId'),
  robotName?: string(name='RobotName'),
}

model ListTaskResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: {
    pageNo?: long(name='PageNo'),
    pageSize?: long(name='PageSize'),
    total?: long(name='Total'),
    record?: [ 
      {
        status?: string(name='Status'),
        gmtCreate?: string(name='GmtCreate'),
        totalCount?: int32(name='TotalCount'),
        fireTime?: string(name='FireTime'),
        taskName?: string(name='TaskName'),
        robotId?: long(name='RobotId'),
        robotName?: string(name='RobotName'),
        id?: long(name='Id'),
        completeCount?: int32(name='CompleteCount'),
      }
    ](name='Record'),
  }(name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model ListTaskResponse = {
  headers: map[string]string(name='headers'),
  body: ListTaskResponseBody(name='body'),
}

async function listTaskWithOptions(request: ListTaskRequest, runtime: Util.RuntimeOptions): ListTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listTask(request: ListTaskRequest): ListTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTaskWithOptions(request, runtime);
}

model GetAiOutboundTaskExecDetailRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  taskId?: long(name='TaskId', description='任务id'),
  batchVersion?: int32(name='BatchVersion', description='任务批次'),
  phoneNum?: string(name='PhoneNum', description='手机号'),
  caseStatus?: int32(name='CaseStatus', description='单条号码任务执行状态（1：待呼叫，2:呼叫中，3:已完成，4:已终止，5:待重呼）'),
  createTimeStart?: long(name='CreateTimeStart', description='号码导入起始时间戳（毫秒）'),
  createTimeEnd?: long(name='CreateTimeEnd', description='号码导入结束时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='分页大小（<=50）'),
  currentPage?: int32(name='CurrentPage', description='当前页数'),
  caseId?: long(name='CaseId', description='单条外呼id'),
}

model GetAiOutboundTaskExecDetailResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  data?: {
    pageSize?: int32(name='PageSize', description='分页大小'),
    hasNextPage?: boolean(name='HasNextPage', description='是否有下一页'),
    totalResults?: int32(name='TotalResults', description='总数'),
    currentPage?: int32(name='CurrentPage', description='当前页数'),
    list?: [ 
      {
        caseId?: long(name='CaseId', description='id'),
        batchVersion?: int32(name='BatchVersion', description='任务批次'),
        bizData?: string(name='BizData', description='业务自定义信息'),
        phoneNum?: string(name='PhoneNum', description='手机号'),
        callCount?: int32(name='CallCount', description='外呼次数'),
        status?: int32(name='Status', description='执行状态（1：待呼叫，2:呼叫中，3:已完成，4:已终止，5:待重呼）'),
        statusDesc?: int32(name='StatusDesc', description='执行状态描述'),
        lastCallResult?: string(name='LastCallResult', description='最后一次外呼结果'),
        createTime?: long(name='CreateTime', description='号码导入时间戳（毫秒）'),
      }
    ](name='List', description='外呼号码执行列表'),
  }(name='Data', description='任务执行列表'),
}

model GetAiOutboundTaskExecDetailResponse = {
  headers: map[string]string(name='headers'),
  body: GetAiOutboundTaskExecDetailResponseBody(name='body'),
}

async function getAiOutboundTaskExecDetailWithOptions(request: GetAiOutboundTaskExecDetailRequest, runtime: Util.RuntimeOptions): GetAiOutboundTaskExecDetailResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetAiOutboundTaskExecDetail', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getAiOutboundTaskExecDetail(request: GetAiOutboundTaskExecDetailRequest): GetAiOutboundTaskExecDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiOutboundTaskExecDetailWithOptions(request, runtime);
}

model CreateAiOutboundTaskBatchRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  taskId?: long(name='TaskId', description='任务id'),
}

model CreateAiOutboundTaskBatchResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  data?: int32(name='Data', description='新建的任务批次版本id'),
}

model CreateAiOutboundTaskBatchResponse = {
  headers: map[string]string(name='headers'),
  body: CreateAiOutboundTaskBatchResponseBody(name='body'),
}

async function createAiOutboundTaskBatchWithOptions(request: CreateAiOutboundTaskBatchRequest, runtime: Util.RuntimeOptions): CreateAiOutboundTaskBatchResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateAiOutboundTaskBatch', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createAiOutboundTaskBatch(request: CreateAiOutboundTaskBatchRequest): CreateAiOutboundTaskBatchResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAiOutboundTaskBatchWithOptions(request, runtime);
}

model ListHotlineRecordRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  callId?: string(name='CallId'),
}

model ListHotlineRecordResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: [ 
    {
      endTime?: long(name='EndTime'),
      startTime?: long(name='StartTime'),
      connectionId?: string(name='ConnectionId'),
      callId?: string(name='CallId'),
      url?: string(name='Url'),
    }
  ](name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model ListHotlineRecordResponse = {
  headers: map[string]string(name='headers'),
  body: ListHotlineRecordResponseBody(name='body'),
}

async function listHotlineRecordWithOptions(request: ListHotlineRecordRequest, runtime: Util.RuntimeOptions): ListHotlineRecordResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('ListHotlineRecord', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function listHotlineRecord(request: ListHotlineRecordRequest): ListHotlineRecordResponse {
  var runtime = new Util.RuntimeOptions{};
  return listHotlineRecordWithOptions(request, runtime);
}

model ChangeQualityProjectStatusRequest {
  instanceId?: string(name='InstanceId'),
  status?: int32(name='Status'),
  projectId?: long(name='ProjectId'),
}

model ChangeQualityProjectStatusResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ChangeQualityProjectStatusResponse = {
  headers: map[string]string(name='headers'),
  body: ChangeQualityProjectStatusResponseBody(name='body'),
}

async function changeQualityProjectStatusWithOptions(request: ChangeQualityProjectStatusRequest, runtime: Util.RuntimeOptions): ChangeQualityProjectStatusResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ChangeQualityProjectStatus', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function changeQualityProjectStatus(request: ChangeQualityProjectStatusRequest): ChangeQualityProjectStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeQualityProjectStatusWithOptions(request, runtime);
}

model TransferCallToSkillGroupRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  skillGroupId?: long(name='SkillGroupId'),
  callId?: string(name='CallId'),
  jobId?: string(name='JobId'),
  connectionId?: string(name='ConnectionId'),
  holdConnectionId?: string(name='HoldConnectionId'),
  type?: int32(name='Type'),
  isSingleTransfer?: boolean(name='IsSingleTransfer'),
}

model TransferCallToSkillGroupResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model TransferCallToSkillGroupResponse = {
  headers: map[string]string(name='headers'),
  body: TransferCallToSkillGroupResponseBody(name='body'),
}

async function transferCallToSkillGroupWithOptions(request: TransferCallToSkillGroupRequest, runtime: Util.RuntimeOptions): TransferCallToSkillGroupResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('TransferCallToSkillGroup', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function transferCallToSkillGroup(request: TransferCallToSkillGroupRequest): TransferCallToSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return transferCallToSkillGroupWithOptions(request, runtime);
}

model GetSkillGroupServiceCapabilityRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
  groupIds?: [ long ](name='GroupIds', description='技能组id列表'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetSkillGroupServiceCapabilityShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
  groupIdsShrink?: string(name='GroupIds', description='技能组id列表'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetSkillGroupServiceCapabilityResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='调用接口是否成功'),
  data?: {
    pageNum?: int32(name='PageNum', description='当前页数'),
    pageSize?: int32(name='PageSize', description='页大小'),
    totalNum?: long(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
}

model GetSkillGroupServiceCapabilityResponse = {
  headers: map[string]string(name='headers'),
  body: GetSkillGroupServiceCapabilityResponseBody(name='body'),
}

async function getSkillGroupServiceCapabilityWithOptions(tmpReq: GetSkillGroupServiceCapabilityRequest, runtime: Util.RuntimeOptions): GetSkillGroupServiceCapabilityResponse {
  Util.validateModel(tmpReq);
  var request = new GetSkillGroupServiceCapabilityShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetSkillGroupServiceCapability', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getSkillGroupServiceCapability(request: GetSkillGroupServiceCapabilityRequest): GetSkillGroupServiceCapabilityResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSkillGroupServiceCapabilityWithOptions(request, runtime);
}

model RemoveSkillGroupRequest {
  instanceId?: string(name='InstanceId'),
  skillGroupId?: string(name='SkillGroupId'),
  clientToken?: string(name='ClientToken'),
}

model RemoveSkillGroupResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model RemoveSkillGroupResponse = {
  headers: map[string]string(name='headers'),
  body: RemoveSkillGroupResponseBody(name='body'),
}

async function removeSkillGroupWithOptions(request: RemoveSkillGroupRequest, runtime: Util.RuntimeOptions): RemoveSkillGroupResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RemoveSkillGroup', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function removeSkillGroup(request: RemoveSkillGroupRequest): RemoveSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeSkillGroupWithOptions(request, runtime);
}

model DeleteHotlineNumberRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  hotlineNumber?: string(name='HotlineNumber', description='号码'),
}

model DeleteHotlineNumberResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success', description='接口调用是否成功'),
  code?: string(name='Code', description='错误码'),
  message?: string(name='Message', description='错误信息'),
  httpStatusCode?: long(name='HttpStatusCode', description='http状态码'),
}

model DeleteHotlineNumberResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteHotlineNumberResponseBody(name='body'),
}

async function deleteHotlineNumberWithOptions(request: DeleteHotlineNumberRequest, runtime: Util.RuntimeOptions): DeleteHotlineNumberResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteHotlineNumber', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteHotlineNumber(request: DeleteHotlineNumberRequest): DeleteHotlineNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteHotlineNumberWithOptions(request, runtime);
}

model StartCallV2Request {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  caller?: string(name='Caller'),
  callerType?: int32(name='CallerType'),
  callee?: string(name='Callee'),
}

model StartCallV2ResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model StartCallV2Response = {
  headers: map[string]string(name='headers'),
  body: StartCallV2ResponseBody(name='body'),
}

async function startCallV2WithOptions(request: StartCallV2Request, runtime: Util.RuntimeOptions): StartCallV2Response {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StartCallV2', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function startCallV2(request: StartCallV2Request): StartCallV2Response {
  var runtime = new Util.RuntimeOptions{};
  return startCallV2WithOptions(request, runtime);
}

model ChangeChatAgentStatusRequest {
  clientToken?: string(name='ClientToken', description='clientToken'),
  instanceId?: string(name='InstanceId', description='示例id'),
  accountName?: string(name='AccountName', description='账户名称'),
  method?: string(name='Method', description='修改到的状态类型'),
}

model ChangeChatAgentStatusResponseBody = {
  message?: string(name='Message', description='message'),
  requestId?: string(name='RequestId', description='requestId'),
  httpStatusCode?: int32(name='HttpStatusCode', description='httpStatusCode'),
  data?: string(name='Data', description='data'),
  code?: string(name='Code', description='code'),
  success?: boolean(name='Success', description='success'),
}

model ChangeChatAgentStatusResponse = {
  headers: map[string]string(name='headers'),
  body: ChangeChatAgentStatusResponseBody(name='body'),
}

async function changeChatAgentStatusWithOptions(request: ChangeChatAgentStatusRequest, runtime: Util.RuntimeOptions): ChangeChatAgentStatusResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ChangeChatAgentStatus', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function changeChatAgentStatus(request: ChangeChatAgentStatusRequest): ChangeChatAgentStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeChatAgentStatusWithOptions(request, runtime);
}

model DescribeRecordDataRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  prodCode?: string(name='ProdCode'),
  accountType?: string(name='AccountType'),
  accountId?: string(name='AccountId'),
  acid?: string(name='Acid'),
  secLevel?: int32(name='SecLevel'),
}

model DescribeRecordDataResponseBody = {
  acid?: string(name='Acid'),
  requestId?: string(name='RequestId'),
  message?: string(name='Message'),
  ossLink?: string(name='OssLink'),
  agentId?: string(name='AgentId'),
  code?: string(name='Code'),
}

model DescribeRecordDataResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeRecordDataResponseBody(name='body'),
}

async function describeRecordDataWithOptions(request: DescribeRecordDataRequest, runtime: Util.RuntimeOptions): DescribeRecordDataResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeRecordData', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeRecordData(request: DescribeRecordDataRequest): DescribeRecordDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRecordDataWithOptions(request, runtime);
}

model DeleteOuterAccountRequest {
  outerAccountId?: string(name='OuterAccountId'),
  outerAccountType?: string(name='OuterAccountType'),
}

model DeleteOuterAccountResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: boolean(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model DeleteOuterAccountResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteOuterAccountResponseBody(name='body'),
}

async function deleteOuterAccountWithOptions(request: DeleteOuterAccountRequest, runtime: Util.RuntimeOptions): DeleteOuterAccountResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('DeleteOuterAccount', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function deleteOuterAccount(request: DeleteOuterAccountRequest): DeleteOuterAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteOuterAccountWithOptions(request, runtime);
}

model GetDepartmentalLatitudeAgentStatusRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: long(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: long(name='CurrentPage', description='当前页（默认为1）'),
  depIds?: [ long ](name='DepIds', description='技能组分组id列表'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据技能组分组id分组显示'),
}

model GetDepartmentalLatitudeAgentStatusShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: long(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: long(name='CurrentPage', description='当前页（默认为1）'),
  depIdsShrink?: string(name='DepIds', description='技能组分组id列表'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据技能组分组id分组显示'),
}

model GetDepartmentalLatitudeAgentStatusResponseBody = {
  message?: string(name='Message', description='错误描述'),
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  data?: {
    pageNum?: int32(name='PageNum', description='当前页数'),
    pageSize?: int32(name='PageSize', description='每页的数量'),
    totalNum?: int32(name='TotalNum', description='总共记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='数据'),
  code?: string(name='Code', description='错误编码'),
  success?: boolean(name='Success', description='接口调用是否成功'),
}

model GetDepartmentalLatitudeAgentStatusResponse = {
  headers: map[string]string(name='headers'),
  body: GetDepartmentalLatitudeAgentStatusResponseBody(name='body'),
}

async function getDepartmentalLatitudeAgentStatusWithOptions(tmpReq: GetDepartmentalLatitudeAgentStatusRequest, runtime: Util.RuntimeOptions): GetDepartmentalLatitudeAgentStatusResponse {
  Util.validateModel(tmpReq);
  var request = new GetDepartmentalLatitudeAgentStatusShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetDepartmentalLatitudeAgentStatus', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getDepartmentalLatitudeAgentStatus(request: GetDepartmentalLatitudeAgentStatusRequest): GetDepartmentalLatitudeAgentStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDepartmentalLatitudeAgentStatusWithOptions(request, runtime);
}

model GetAiOutboundTaskDetailRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  taskId?: long(name='TaskId', description='任务id'),
}

model GetAiOutboundTaskDetailResponseBody = {
  requestId?: string(name='RequestId', description='请求ID'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  data?: {
    taskId?: long(name='TaskId', description='任务id'),
    status?: int32(name='Status', description='任务状态（0:未开始,1:进行中,2:系统暂停,3:手动暂停,4:已完成,5:已终止）'),
    statusDesc?: string(name='StatusDesc', description='任务状态描述'),
    type?: int32(name='Type', description='任务类型(2:预测式外呼，3:自动外呼)'),
    name?: string(name='Name', description='任务名'),
    description?: string(name='Description', description='任务描述'),
    outboundNums?: [ string ](name='OutboundNums', description='外呼主叫号码'),
    numRepeated?: int32(name='NumRepeated', description='被叫号码重复策略（0去重，1不去重）'),
    handlerId?: long(name='HandlerId', description='技能组id（预测式外呼）或者ivr id（自动外呼）'),
    handlerName?: string(name='HandlerName', description='技能组名称或ivr名称'),
    executionTime?: string(name='ExecutionTime', description='任务执行时间'),
    concurrentRate?: int32(name='ConcurrentRate', description='自动外呼的并发'),
    recallRule?: {
      count?: int32(name='Count', description='重呼次数'),
      interval?: int32(name='Interval', description='重呼间隔时间（分钟）'),
    }(name='RecallRule', description='失败重呼策略'),
    forecastCallRate?: float(name='ForecastCallRate', description='预测式外呼固定外呼比例'),
  }(name='Data', description='任务详情'),
}

model GetAiOutboundTaskDetailResponse = {
  headers: map[string]string(name='headers'),
  body: GetAiOutboundTaskDetailResponseBody(name='body'),
}

async function getAiOutboundTaskDetailWithOptions(request: GetAiOutboundTaskDetailRequest, runtime: Util.RuntimeOptions): GetAiOutboundTaskDetailResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetAiOutboundTaskDetail', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getAiOutboundTaskDetail(request: GetAiOutboundTaskDetailRequest): GetAiOutboundTaskDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiOutboundTaskDetailWithOptions(request, runtime);
}

model GetHotlineAgentDetailRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
}

model GetHotlineAgentDetailResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: {
    agentStatusCode?: string(name='AgentStatusCode'),
    token?: string(name='Token'),
    agentId?: long(name='AgentId'),
    assigned?: boolean(name='Assigned'),
    restType?: int32(name='RestType'),
    agentStatus?: int32(name='AgentStatus'),
    tenantId?: long(name='TenantId'),
  }(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  httpStatusCode?: long(name='HttpStatusCode'),
}

model GetHotlineAgentDetailResponse = {
  headers: map[string]string(name='headers'),
  body: GetHotlineAgentDetailResponseBody(name='body'),
}

async function getHotlineAgentDetailWithOptions(request: GetHotlineAgentDetailRequest, runtime: Util.RuntimeOptions): GetHotlineAgentDetailResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetHotlineAgentDetail', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getHotlineAgentDetail(request: GetHotlineAgentDetailRequest): GetHotlineAgentDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineAgentDetailWithOptions(request, runtime);
}

model GetAllDepartmentRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
}

model GetAllDepartmentResponseBody = {
  message?: string(name='Message', description='message'),
  requestId?: string(name='RequestId', description='requestId'),
  httpStatusCode?: int32(name='HttpStatusCode', description='httpStatusCode'),
  data?: [ 
    {
      departmentId?: long(name='DepartmentId'),
      departmentName?: string(name='DepartmentName'),
    }
  ](name='Data', description='data'),
  code?: string(name='Code', description='code'),
  success?: boolean(name='Success', description='success'),
}

model GetAllDepartmentResponse = {
  headers: map[string]string(name='headers'),
  body: GetAllDepartmentResponseBody(name='body'),
}

async function getAllDepartmentWithOptions(request: GetAllDepartmentRequest, runtime: Util.RuntimeOptions): GetAllDepartmentResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetAllDepartment', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getAllDepartment(request: GetAllDepartmentRequest): GetAllDepartmentResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAllDepartmentWithOptions(request, runtime);
}

model ListTaskDetailRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  statusCode?: string(name='StatusCode'),
  status?: string(name='Status'),
  pageNo?: int32(name='PageNo'),
  pageSize?: int32(name='PageSize'),
  called?: string(name='Called'),
  taskId?: long(name='TaskId'),
  id?: long(name='Id'),
}

model ListTaskDetailResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: {
    pageNo?: long(name='PageNo'),
    pageSize?: long(name='PageSize'),
    total?: long(name='Total'),
    record?: [ 
      {
        status?: string(name='Status'),
        retryCurTimes?: int32(name='RetryCurTimes'),
        called?: string(name='Called'),
        caller?: string(name='Caller'),
        duration?: int32(name='Duration'),
        id?: long(name='Id'),
        statusCode?: string(name='StatusCode'),
        statusCodeDesc?: string(name='StatusCodeDesc'),
        retryTimes?: int32(name='RetryTimes'),
        startTime?: string(name='StartTime'),
        endTime?: string(name='EndTime'),
        direction?: string(name='Direction'),
        tags?: string(name='Tags'),
      }
    ](name='Record'),
  }(name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model ListTaskDetailResponse = {
  headers: map[string]string(name='headers'),
  body: ListTaskDetailResponseBody(name='body'),
}

async function listTaskDetailWithOptions(request: ListTaskDetailRequest, runtime: Util.RuntimeOptions): ListTaskDetailResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListTaskDetail', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listTaskDetail(request: ListTaskDetailRequest): ListTaskDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTaskDetailWithOptions(request, runtime);
}

model GetAiOutboundTaskListRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  type?: int32(name='Type', description='任务类型(2:预测式外呼，3:自动外呼)'),
  createTimeStart?: long(name='CreateTimeStart', description='任务创建起始时间戳（毫秒）'),
  createTimeEnd?: long(name='CreateTimeEnd', description='任务创建截止时间戳（毫秒）'),
  status?: int32(name='Status', description='任务状态（0:未开始,1:进行中,2:系统暂停,3:手动暂停,4:已完成,5:已终止）'),
  pageSize?: int32(name='PageSize', description='分页大小(<=50)'),
  currentPage?: int32(name='CurrentPage', description='查询第几页'),
  searchKey?: string(name='SearchKey', description='过滤条件：匹配任务ID或者模糊匹配任务名'),
}

model GetAiOutboundTaskListResponseBody = {
  requestId?: string(name='RequestId', description='请求id'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  data?: {
    pageSize?: int32(name='PageSize', description='分页大小'),
    hasNextPage?: boolean(name='HasNextPage', description='是否有下一页'),
    totalResults?: int32(name='TotalResults', description='数据总量'),
    currentPage?: int32(name='CurrentPage', description='当前页数'),
    list?: [ 
      {
        taskId?: long(name='TaskId', description='任务id'),
        status?: int32(name='Status', description='任务状态（0:未开始,1:进行中,2:系统暂停,3:手动暂停,4:已完成,5:已终止）'),
        statusDesc?: string(name='StatusDesc', description='任务状态描述'),
        name?: string(name='Name', description='任务名称'),
        description?: string(name='Description', description='任务描述'),
        handlerId?: long(name='HandlerId', description='技能组id（预测式）或者ivr id（自动外呼）'),
        handlerName?: string(name='HandlerName', description='技能组名称或ivr名称'),
        concurrentRate?: int32(name='ConcurrentRate', description='自动外呼的并发'),
        totalCount?: int32(name='TotalCount', description='任务总量'),
        finishCount?: int32(name='FinishCount', description='任务已完成量'),
        finishRate?: float(name='FinishRate', description='任务完成率'),
        createTime?: long(name='CreateTime', description='任务创建时间毫秒时间戳'),
      }
    ](name='List', description='任务信息'),
  }(name='Data', description='任务列表'),
}

model GetAiOutboundTaskListResponse = {
  headers: map[string]string(name='headers'),
  body: GetAiOutboundTaskListResponseBody(name='body'),
}

async function getAiOutboundTaskListWithOptions(request: GetAiOutboundTaskListRequest, runtime: Util.RuntimeOptions): GetAiOutboundTaskListResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetAiOutboundTaskList', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getAiOutboundTaskList(request: GetAiOutboundTaskListRequest): GetAiOutboundTaskListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiOutboundTaskListWithOptions(request, runtime);
}

model MakeCallRequest {
  outerAccountId?: string(name='OuterAccountId'),
  outerAccountType?: string(name='OuterAccountType'),
  commandCode?: string(name='CommandCode'),
  callingNumber?: string(name='CallingNumber'),
  calledNumber?: string(name='CalledNumber'),
  extInfo?: string(name='ExtInfo'),
}

model MakeCallResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model MakeCallResponse = {
  headers: map[string]string(name='headers'),
  body: MakeCallResponseBody(name='body'),
}

async function makeCallWithOptions(request: MakeCallRequest, runtime: Util.RuntimeOptions): MakeCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('MakeCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function makeCall(request: MakeCallRequest): MakeCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return makeCallWithOptions(request, runtime);
}

model FetchCallRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  callId?: string(name='CallId'),
  jobId?: string(name='JobId'),
  connectionId?: string(name='ConnectionId'),
  holdConnectionId?: string(name='HoldConnectionId'),
}

model FetchCallResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model FetchCallResponse = {
  headers: map[string]string(name='headers'),
  body: FetchCallResponseBody(name='body'),
}

async function fetchCallWithOptions(request: FetchCallRequest, runtime: Util.RuntimeOptions): FetchCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('FetchCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function fetchCall(request: FetchCallRequest): FetchCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return fetchCallWithOptions(request, runtime);
}

model GetHotlineAgentStatusRequest {
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
}

model GetHotlineAgentStatusResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: string(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  httpStatusCode?: long(name='HttpStatusCode'),
}

model GetHotlineAgentStatusResponse = {
  headers: map[string]string(name='headers'),
  body: GetHotlineAgentStatusResponseBody(name='body'),
}

async function getHotlineAgentStatusWithOptions(request: GetHotlineAgentStatusRequest, runtime: Util.RuntimeOptions): GetHotlineAgentStatusResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetHotlineAgentStatus', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getHotlineAgentStatus(request: GetHotlineAgentStatusRequest): GetHotlineAgentStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getHotlineAgentStatusWithOptions(request, runtime);
}

model StartCallRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  caller?: string(name='Caller'),
  callee?: string(name='Callee'),
}

model StartCallResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model StartCallResponse = {
  headers: map[string]string(name='headers'),
  body: StartCallResponseBody(name='body'),
}

async function startCallWithOptions(request: StartCallRequest, runtime: Util.RuntimeOptions): StartCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StartCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function startCall(request: StartCallRequest): StartCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return startCallWithOptions(request, runtime);
}

model TerminateAiOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='实例id'),
  taskId?: long(name='TaskId', description='任务id'),
}

model TerminateAiOutboundTaskResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model TerminateAiOutboundTaskResponse = {
  headers: map[string]string(name='headers'),
  body: TerminateAiOutboundTaskResponseBody(name='body'),
}

async function terminateAiOutboundTaskWithOptions(request: TerminateAiOutboundTaskRequest, runtime: Util.RuntimeOptions): TerminateAiOutboundTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('TerminateAiOutboundTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function terminateAiOutboundTask(request: TerminateAiOutboundTaskRequest): TerminateAiOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return terminateAiOutboundTaskWithOptions(request, runtime);
}

model GetQualityRuleTagListRequest {
  instanceId?: string(name='InstanceId'),
}

model GetQualityRuleTagListResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: [ 
    {
      ruleTagName?: string(name='RuleTagName'),
      ruleTagId?: long(name='RuleTagId'),
    }
  ](name='Data'),
}

model GetQualityRuleTagListResponse = {
  headers: map[string]string(name='headers'),
  body: GetQualityRuleTagListResponseBody(name='body'),
}

async function getQualityRuleTagListWithOptions(request: GetQualityRuleTagListRequest, runtime: Util.RuntimeOptions): GetQualityRuleTagListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetQualityRuleTagList', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getQualityRuleTagList(request: GetQualityRuleTagListRequest): GetQualityRuleTagListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQualityRuleTagListWithOptions(request, runtime);
}

model GetOutbounNumListRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
}

model GetOutbounNumListResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: {
    numGroup?: [ 
      {
        type?: int32(name='Type'),
        value?: string(name='Value'),
        description?: string(name='Description'),
      }
    ](name='NumGroup'),
    num?: [ 
      {
        type?: int32(name='Type'),
        value?: string(name='Value'),
        description?: string(name='Description'),
      }
    ](name='Num'),
  }(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  httpStatusCode?: long(name='HttpStatusCode'),
}

model GetOutbounNumListResponse = {
  headers: map[string]string(name='headers'),
  body: GetOutbounNumListResponseBody(name='body'),
}

async function getOutbounNumListWithOptions(request: GetOutbounNumListRequest, runtime: Util.RuntimeOptions): GetOutbounNumListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetOutbounNumList', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getOutbounNumList(request: GetOutbounNumListRequest): GetOutbounNumListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOutbounNumListWithOptions(request, runtime);
}

model CreateThirdSsoAgentRequest {
  clientToken?: string(name='ClientToken', description='clientToken'),
  instanceId?: string(name='InstanceId', description='param1'),
  clientId?: string(name='ClientId', description='param2'),
  accountId?: string(name='AccountId', description='param3'),
  accountName?: string(name='AccountName', description='param4'),
  displayName?: string(name='DisplayName', description='param5'),
  skillGroupIds?: [ long ](name='SkillGroupIds', description='param6'),
  roleIds?: [ long ](name='RoleIds', description='param7'),
}

model CreateThirdSsoAgentResponseBody = {
  message?: string(name='Message', description='message'),
  requestId?: string(name='RequestId', description='requestId'),
  httpStatusCode?: long(name='HttpStatusCode', description='httpStatusCode'),
  data?: long(name='Data', description='新创建的坐席id'),
  code?: string(name='Code', description='code'),
  success?: boolean(name='Success', description='success'),
}

model CreateThirdSsoAgentResponse = {
  headers: map[string]string(name='headers'),
  body: CreateThirdSsoAgentResponseBody(name='body'),
}

async function createThirdSsoAgentWithOptions(request: CreateThirdSsoAgentRequest, runtime: Util.RuntimeOptions): CreateThirdSsoAgentResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateThirdSsoAgent', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createThirdSsoAgent(request: CreateThirdSsoAgentRequest): CreateThirdSsoAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return createThirdSsoAgentWithOptions(request, runtime);
}

model GetSkillGroupStatusTotalRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIds?: [ long ](name='AgentIds', description='坐席id列表'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
  groupIds?: [ long ](name='GroupIds', description='技能组id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据坐席分组'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetSkillGroupStatusTotalShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIdsShrink?: string(name='AgentIds', description='坐席id列表'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
  groupIdsShrink?: string(name='GroupIds', description='技能组id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据坐席分组'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetSkillGroupStatusTotalResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='接口调用是否成功'),
  data?: {
    pageNum?: long(name='PageNum', description='当前页数'),
    pageSize?: long(name='PageSize', description='页大小'),
    totalNum?: long(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
}

model GetSkillGroupStatusTotalResponse = {
  headers: map[string]string(name='headers'),
  body: GetSkillGroupStatusTotalResponseBody(name='body'),
}

async function getSkillGroupStatusTotalWithOptions(tmpReq: GetSkillGroupStatusTotalRequest, runtime: Util.RuntimeOptions): GetSkillGroupStatusTotalResponse {
  Util.validateModel(tmpReq);
  var request = new GetSkillGroupStatusTotalShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetSkillGroupStatusTotal', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getSkillGroupStatusTotal(request: GetSkillGroupStatusTotalRequest): GetSkillGroupStatusTotalResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSkillGroupStatusTotalWithOptions(request, runtime);
}

model InsertTaskDetailRequest {
  outboundTaskId?: long(name='OutboundTaskId'),
  callInfos?: string(name='CallInfos'),
  instanceId?: string(name='InstanceId'),
}

model InsertTaskDetailResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model InsertTaskDetailResponse = {
  headers: map[string]string(name='headers'),
  body: InsertTaskDetailResponseBody(name='body'),
}

async function insertTaskDetailWithOptions(request: InsertTaskDetailRequest, runtime: Util.RuntimeOptions): InsertTaskDetailResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('InsertTaskDetail', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function insertTaskDetail(request: InsertTaskDetailRequest): InsertTaskDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return insertTaskDetailWithOptions(request, runtime);
}

model BatchCreateQualityProjectsRequest {
  projectName?: string(name='ProjectName'),
  checkFreqType?: int32(name='CheckFreqType'),
  timeRangeStart?: string(name='TimeRangeStart'),
  timeRangeEnd?: string(name='TimeRangeEnd'),
  analysisIds?: [ long ](name='AnalysisIds'),
  instanceList?: [ string ](name='InstanceList'),
  channelTouchType?: [ int32 ](name='ChannelTouchType'),
}

model BatchCreateQualityProjectsResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: [ 
    {
      instanceId?: string(name='InstanceId'),
      version?: int32(name='Version'),
      projectId?: long(name='ProjectId'),
    }
  ](name='Data'),
}

model BatchCreateQualityProjectsResponse = {
  headers: map[string]string(name='headers'),
  body: BatchCreateQualityProjectsResponseBody(name='body'),
}

async function batchCreateQualityProjectsWithOptions(request: BatchCreateQualityProjectsRequest, runtime: Util.RuntimeOptions): BatchCreateQualityProjectsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('BatchCreateQualityProjects', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function batchCreateQualityProjects(request: BatchCreateQualityProjectsRequest): BatchCreateQualityProjectsResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchCreateQualityProjectsWithOptions(request, runtime);
}

model UpdateSkillGroupRequest {
  instanceId?: string(name='InstanceId'),
  skillGroupId?: long(name='SkillGroupId'),
  skillGroupName?: string(name='SkillGroupName'),
  description?: string(name='Description'),
  displayName?: string(name='DisplayName'),
  clientToken?: string(name='ClientToken'),
}

model UpdateSkillGroupResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model UpdateSkillGroupResponse = {
  headers: map[string]string(name='headers'),
  body: UpdateSkillGroupResponseBody(name='body'),
}

async function updateSkillGroupWithOptions(request: UpdateSkillGroupRequest, runtime: Util.RuntimeOptions): UpdateSkillGroupResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateSkillGroup', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function updateSkillGroup(request: UpdateSkillGroupRequest): UpdateSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSkillGroupWithOptions(request, runtime);
}

model HotlineSessionQueryRequest {
  instanceId?: string(name='InstanceId'),
  acid?: string(name='Acid'),
  callType?: int32(name='CallType'),
  calledNumber?: string(name='CalledNumber'),
  callingNumber?: string(name='CallingNumber'),
  groupId?: long(name='GroupId'),
  groupName?: string(name='GroupName'),
  memberId?: string(name='MemberId'),
  memberName?: string(name='MemberName'),
  queryEndTime?: long(name='QueryEndTime'),
  queryStartTime?: long(name='QueryStartTime'),
  requestId?: string(name='RequestId'),
  servicerName?: string(name='ServicerName'),
  servicerId?: string(name='ServicerId'),
  params?: string(name='Params'),
  pageSize?: int32(name='PageSize'),
  pageNo?: int32(name='PageNo'),
  callResult?: string(name='CallResult'),
  id?: string(name='Id'),
  acidList?: [ string ](name='AcidList'),
  callTypeList?: [ int32 ](name='CallTypeList'),
  groupIdList?: [ long ](name='GroupIdList'),
  callingNumberList?: [ string ](name='CallingNumberList'),
  calledNumberList?: [ string ](name='CalledNumberList'),
  memberIdList?: [ string ](name='MemberIdList'),
  servicerIdList?: [ string ](name='ServicerIdList'),
  callResultList?: [ string ](name='CallResultList'),
}

model HotlineSessionQueryResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: {
    pageSize?: int32(name='PageSize'),
    pageNumber?: int32(name='PageNumber'),
    totalCount?: int32(name='TotalCount'),
    callDetailRecord?: [ 
      {
        callResult?: string(name='CallResult'),
        trunkCall?: string(name='TrunkCall'),
        servicerName?: string(name='ServicerName'),
        outQueueTime?: string(name='OutQueueTime'),
        callContinueTime?: int32(name='CallContinueTime'),
        createTime?: string(name='CreateTime'),
        pickUpTime?: string(name='PickUpTime'),
        ringContinueTime?: int32(name='RingContinueTime'),
        calledNumber?: string(name='CalledNumber'),
        servicerId?: string(name='ServicerId'),
        hangUpTime?: string(name='HangUpTime'),
        evaluationLevel?: int32(name='EvaluationLevel'),
        passiveTransferId?: string(name='PassiveTransferId'),
        activeTransferId?: string(name='ActiveTransferId'),
        hangUpRole?: string(name='HangUpRole'),
        passiveTransferIdType?: string(name='PassiveTransferIdType'),
        memberName?: string(name='MemberName'),
        evaluationScore?: int32(name='EvaluationScore'),
        acid?: string(name='Acid'),
        ringStartTime?: string(name='RingStartTime'),
        callType?: int32(name='CallType'),
        groupName?: string(name='GroupName'),
        groupId?: long(name='GroupId'),
        ringEndTime?: string(name='RingEndTime'),
        inQueueTime?: string(name='InQueueTime'),
        callingNumber?: string(name='CallingNumber'),
        memberId?: string(name='MemberId'),
        queueUpContinueTime?: int32(name='QueueUpContinueTime'),
        id?: string(name='Id'),
      }
    ](name='CallDetailRecord'),
  }(name='Data'),
}

model HotlineSessionQueryResponse = {
  headers: map[string]string(name='headers'),
  body: HotlineSessionQueryResponseBody(name='body'),
}

async function hotlineSessionQueryWithOptions(request: HotlineSessionQueryRequest, runtime: Util.RuntimeOptions): HotlineSessionQueryResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('HotlineSessionQuery', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function hotlineSessionQuery(request: HotlineSessionQueryRequest): HotlineSessionQueryResponse {
  var runtime = new Util.RuntimeOptions{};
  return hotlineSessionQueryWithOptions(request, runtime);
}

model GetAiOutboundTaskProgressRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  taskId?: long(name='TaskId', description='任务id'),
  batchVersion?: int32(name='BatchVersion', description='任务批次（为空则查询任务下所有数据）'),
}

model GetAiOutboundTaskProgressResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  data?: {
    taskId?: long(name='TaskId', description='任务id'),
    type?: int32(name='Type', description='任务类型（2:预测式3:自动）'),
    taskProgress?: {
      totalCount?: int32(name='TotalCount', description='总任务数'),
      finishCount?: int32(name='FinishCount', description='任务完成数'),
      waitingCallCount?: int32(name='WaitingCallCount', description='待呼叫任务数'),
      callingCount?: int32(name='CallingCount', description='呼叫中任务数'),
      waitingRecallCount?: int32(name='WaitingRecallCount', description='待重呼任务数'),
      terminateCount?: int32(name='TerminateCount', description='已终止任务数'),
      finishRate?: float(name='FinishRate', description='任务完成率'),
      servicerPickupCount?: int32(name='ServicerPickupCount', description='坐席接通数（预测式外呼特有）'),
      userPickupCount?: int32(name='UserPickupCount', description='客户接起数（预测式外呼特有）'),
      servicerPickupRate?: float(name='ServicerPickupRate', description='坐席接通率(预测式外呼特有）'),
      userPickupRate?: float(name='UserPickupRate', description='客户接起率（预测式外呼特有）'),
      connectCount?: int32(name='ConnectCount', description='任务接通量（自动外呼特有）'),
      connectRate?: float(name='ConnectRate', description='任务接通率（自动外呼特有）'),
    }(name='TaskProgress', description='任务维度进展'),
    calloutProgress?: {
      callOutCount?: int32(name='CallOutCount', description='外呼次数'),
      callOutConnectCount?: int32(name='CallOutConnectCount', description='外呼接通次数（自动外呼特有）'),
      callOutConnectRate?: float(name='CallOutConnectRate', description='外呼接通次率（自动外呼特有）'),
      callLossCount?: int32(name='CallLossCount', description='呼损量（预测式外呼特有）'),
      callLossRate?: float(name='CallLossRate', description='呼损率（预测式外呼特有）'),
      callOutServicerPickupCount?: int32(name='CallOutServicerPickupCount', description='坐席接通量（预测式外呼特有）'),
      callOutUserPickupCount?: int32(name='CallOutUserPickupCount', description='客户接起量（预测式外呼特有）'),
      callOutServicerPickupRate?: float(name='CallOutServicerPickupRate', description='坐席接通率（预测式外呼特有）'),
      callOutUserPickupRate?: float(name='CallOutUserPickupRate', description='客户接起率（预测式外呼特有）'),
    }(name='CalloutProgress', description='外呼维度进展'),
  }(name='Data', description='任务进展'),
}

model GetAiOutboundTaskProgressResponse = {
  headers: map[string]string(name='headers'),
  body: GetAiOutboundTaskProgressResponseBody(name='body'),
}

async function getAiOutboundTaskProgressWithOptions(request: GetAiOutboundTaskProgressRequest, runtime: Util.RuntimeOptions): GetAiOutboundTaskProgressResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetAiOutboundTaskProgress', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getAiOutboundTaskProgress(request: GetAiOutboundTaskProgressRequest): GetAiOutboundTaskProgressResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAiOutboundTaskProgressWithOptions(request, runtime);
}

model GetQueueInformationRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
  groupIds?: [ long ](name='GroupIds', description='技能组id列表'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetQueueInformationShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
  groupIdsShrink?: string(name='GroupIds', description='技能组id列表'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
}

model GetQueueInformationResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='调用接口是否成功'),
  data?: {
    pageNum?: int32(name='PageNum', description='当前页数'),
    pageSize?: int32(name='PageSize', description='页大小'),
    totalNum?: int32(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
}

model GetQueueInformationResponse = {
  headers: map[string]string(name='headers'),
  body: GetQueueInformationResponseBody(name='body'),
}

async function getQueueInformationWithOptions(tmpReq: GetQueueInformationRequest, runtime: Util.RuntimeOptions): GetQueueInformationResponse {
  Util.validateModel(tmpReq);
  var request = new GetQueueInformationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetQueueInformation', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getQueueInformation(request: GetQueueInformationRequest): GetQueueInformationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQueueInformationWithOptions(request, runtime);
}

model GetSkillGroupServiceStatusRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIds?: [ long ](name='AgentIds', description='技能组id列表'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
  groupIds?: [ long ](name='GroupIds', description='技能组id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据技能组分组'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
  existRobotInstanceGrouping?: boolean(name='ExistRobotInstanceGrouping', description='是否根据机器实例分组'),
  existChannelInstanceGrouping?: boolean(name='ExistChannelInstanceGrouping', description='是否根据渠道实例分组'),
}

model GetSkillGroupServiceStatusShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIdsShrink?: string(name='AgentIds', description='技能组id列表'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
  groupIdsShrink?: string(name='GroupIds', description='技能组id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据技能组分组'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组'),
  existSkillGroupGrouping?: boolean(name='ExistSkillGroupGrouping', description='是否根据技能组分组'),
  existRobotInstanceGrouping?: boolean(name='ExistRobotInstanceGrouping', description='是否根据机器实例分组'),
  existChannelInstanceGrouping?: boolean(name='ExistChannelInstanceGrouping', description='是否根据渠道实例分组'),
}

model GetSkillGroupServiceStatusResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='调用接口是否成功'),
  data?: {
    pageSize?: int32(name='PageSize', description='页大小'),
    totalNum?: int32(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
    pageNum?: int32(name='PageNum', description='当前页数'),
  }(name='Data', description='data'),
}

model GetSkillGroupServiceStatusResponse = {
  headers: map[string]string(name='headers'),
  body: GetSkillGroupServiceStatusResponseBody(name='body'),
}

async function getSkillGroupServiceStatusWithOptions(tmpReq: GetSkillGroupServiceStatusRequest, runtime: Util.RuntimeOptions): GetSkillGroupServiceStatusResponse {
  Util.validateModel(tmpReq);
  var request = new GetSkillGroupServiceStatusShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.groupIds)) {
    request.groupIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.groupIds, 'GroupIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetSkillGroupServiceStatus', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getSkillGroupServiceStatus(request: GetSkillGroupServiceStatusRequest): GetSkillGroupServiceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSkillGroupServiceStatusWithOptions(request, runtime);
}

model GetAgentDetailReportRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIds?: [ long ](name='AgentIds', description='坐席id列表'),
  depIds?: [ long ](name='DepIds', description='部门id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据坐席分组显示'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组显示'),
}

model GetAgentDetailReportShrinkRequest {
  instanceId?: string(name='InstanceId', description='AICCS实例ID，在智能联络中心控制台上可以看到'),
  startDate?: long(name='StartDate', description='开始日期时间戳（毫秒）'),
  endDate?: long(name='EndDate', description='结束日期时间戳（毫秒）'),
  pageSize?: int32(name='PageSize', description='每页大小（默认为10)'),
  currentPage?: int32(name='CurrentPage', description='当前页（默认为1）'),
  agentIdsShrink?: string(name='AgentIds', description='坐席id列表'),
  depIdsShrink?: string(name='DepIds', description='部门id列表'),
  timeLatitudeType?: string(name='TimeLatitudeType', description='时间纬度类型'),
  existAgentGrouping?: boolean(name='ExistAgentGrouping', description='是否根据坐席分组显示'),
  existDepartmentGrouping?: boolean(name='ExistDepartmentGrouping', description='是否根据部门分组显示'),
}

model GetAgentDetailReportResponseBody = {
  requestId?: string(name='RequestId', description='请求ID，用于跟踪错误原因'),
  message?: string(name='Message', description='错误描述'),
  code?: string(name='Code', description='错误编码'),
  success?: string(name='Success', description='调用接口是否成功'),
  data?: {
    pageNum?: long(name='PageNum', description='当前页数'),
    pageSize?: long(name='PageSize', description='页大小'),
    totalNum?: long(name='TotalNum', description='总记录数'),
    rows?: string(name='Rows', description='信息为list<map>类型的json字符串'),
  }(name='Data', description='data'),
}

model GetAgentDetailReportResponse = {
  headers: map[string]string(name='headers'),
  body: GetAgentDetailReportResponseBody(name='body'),
}

async function getAgentDetailReportWithOptions(tmpReq: GetAgentDetailReportRequest, runtime: Util.RuntimeOptions): GetAgentDetailReportResponse {
  Util.validateModel(tmpReq);
  var request = new GetAgentDetailReportShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.agentIds)) {
    request.agentIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.agentIds, 'AgentIds', 'simple');
  }
  if (!Util.isUnset(tmpReq.depIds)) {
    request.depIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.depIds, 'DepIds', 'simple');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('GetAgentDetailReport', '2019-10-15', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function getAgentDetailReport(request: GetAgentDetailReportRequest): GetAgentDetailReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgentDetailReportWithOptions(request, runtime);
}

model QueryTicketsRequest {
  instanceId?: string(name='InstanceId'),
  caseId?: long(name='CaseId'),
  caseType?: int32(name='CaseType'),
  caseStatus?: int32(name='CaseStatus'),
  srType?: long(name='SrType'),
  taskStatus?: int32(name='TaskStatus'),
  channelId?: string(name='ChannelId'),
  channelType?: int32(name='ChannelType'),
  touchId?: long(name='TouchId'),
  dealId?: long(name='DealId'),
  extra?: map[string]any(name='Extra'),
  pageSize?: int32(name='PageSize'),
  currentPage?: int32(name='CurrentPage'),
}

model QueryTicketsShrinkRequest {
  instanceId?: string(name='InstanceId'),
  caseId?: long(name='CaseId'),
  caseType?: int32(name='CaseType'),
  caseStatus?: int32(name='CaseStatus'),
  srType?: long(name='SrType'),
  taskStatus?: int32(name='TaskStatus'),
  channelId?: string(name='ChannelId'),
  channelType?: int32(name='ChannelType'),
  touchId?: long(name='TouchId'),
  dealId?: long(name='DealId'),
  extraShrink?: string(name='Extra'),
  pageSize?: int32(name='PageSize'),
  currentPage?: int32(name='CurrentPage'),
}

model QueryTicketsResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryTicketsResponse = {
  headers: map[string]string(name='headers'),
  body: QueryTicketsResponseBody(name='body'),
}

async function queryTicketsWithOptions(tmpReq: QueryTicketsRequest, runtime: Util.RuntimeOptions): QueryTicketsResponse {
  Util.validateModel(tmpReq);
  var request = new QueryTicketsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.extra)) {
    request.extraShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.extra, 'Extra', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('QueryTickets', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function queryTickets(request: QueryTicketsRequest): QueryTicketsResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTicketsWithOptions(request, runtime);
}

model ListRobotCallDialogRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  callId?: string(name='CallId'),
  createTime?: string(name='CreateTime'),
}

model ListRobotCallDialogResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: [ 
    {
      role?: string(name='Role'),
      content?: string(name='Content'),
      nodeType?: string(name='NodeType'),
      time?: string(name='Time'),
      tag?: string(name='Tag'),
    }
  ](name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model ListRobotCallDialogResponse = {
  headers: map[string]string(name='headers'),
  body: ListRobotCallDialogResponseBody(name='body'),
}

async function listRobotCallDialogWithOptions(request: ListRobotCallDialogRequest, runtime: Util.RuntimeOptions): ListRobotCallDialogResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListRobotCallDialog', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listRobotCallDialog(request: ListRobotCallDialogRequest): ListRobotCallDialogResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRobotCallDialogWithOptions(request, runtime);
}

model QueryOutboundTaskRequest {
  taskId?: long(name='TaskId'),
  taskType?: int32(name='TaskType'),
  taskName?: string(name='TaskName'),
  startDate?: string(name='StartDate'),
  endDate?: string(name='EndDate'),
  startTime?: string(name='StartTime'),
  endTime?: string(name='EndTime'),
  skillGroup?: long(name='SkillGroup'),
  ani?: string(name='Ani'),
  status?: string(name='Status'),
  groupName?: string(name='GroupName'),
  departmentId?: string(name='DepartmentId'),
  instanceId?: string(name='InstanceId'),
  pageSize?: int32(name='PageSize'),
  currentPage?: int32(name='CurrentPage'),
}

model QueryOutboundTaskResponseBody = {
  httpStatusCode?: string(name='HttpStatusCode'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  data?: {
    totalResults?: string(name='TotalResults'),
    currentPage?: string(name='CurrentPage'),
    pageSize?: string(name='PageSize'),
    list?: [ 
      {
        type?: int32(name='Type'),
        status?: int32(name='Status'),
        endDate?: string(name='EndDate'),
        retryInterval?: int32(name='RetryInterval'),
        retryTime?: int32(name='RetryTime'),
        startDate?: string(name='StartDate'),
        gmtModified?: long(name='GmtModified'),
        creator?: string(name='Creator'),
        endTime?: string(name='EndTime'),
        buId?: long(name='BuId'),
        model?: int32(name='Model'),
        startTime?: string(name='StartTime'),
        modifier?: string(name='Modifier'),
        groupName?: string(name='GroupName'),
        description?: string(name='Description'),
        departmentId?: long(name='DepartmentId'),
        gmtCreate?: long(name='GmtCreate'),
        skillGroup?: long(name='SkillGroup'),
        name?: string(name='Name'),
        extAttrs?: string(name='ExtAttrs'),
        callerNum?: string(name='CallerNum'),
        id?: long(name='Id'),
      }
    ](name='List'),
  }(name='Data'),
}

model QueryOutboundTaskResponse = {
  headers: map[string]string(name='headers'),
  body: QueryOutboundTaskResponseBody(name='body'),
}

async function queryOutboundTaskWithOptions(request: QueryOutboundTaskRequest, runtime: Util.RuntimeOptions): QueryOutboundTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('QueryOutboundTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function queryOutboundTask(request: QueryOutboundTaskRequest): QueryOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryOutboundTaskWithOptions(request, runtime);
}

model CreateAiOutboundTaskRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  type?: int32(name='Type', description='任务类型（2:预测式外呼3:自动外呼）'),
  name?: string(name='Name', description='任务名（1～15字符）'),
  description?: string(name='Description', description='任务描述（0～100字符）'),
  outboundNums?: [ string ](name='OutboundNums', description='外呼主叫号码'),
  numRepeated?: int32(name='NumRepeated', description='被叫号码重复策略（0任务内去重，1不去重）'),
  handlerId?: long(name='HandlerId', description='技能组id（预测式外呼）或者ivr id（自动外呼）'),
  executionTime?: string(name='ExecutionTime', description='任务执行时间'),
  concurrentRate?: int32(name='ConcurrentRate', description='自动外呼的呼叫并发'),
  recallRule?: {
    count?: int32(name='Count', description='重呼次数（1～3）'),
    interval?: int32(name='Interval', description='重呼间隔时间（1～60分钟）'),
  }(name='RecallRule', description='失败重呼策略（为空则不重呼）'),
  forecastCallRate?: float(name='ForecastCallRate', description='预测式外呼固定外呼比例（>=1）'),
}

model CreateAiOutboundTaskShrinkRequest {
  instanceId?: string(name='InstanceId', description='实例ID'),
  type?: int32(name='Type', description='任务类型（2:预测式外呼3:自动外呼）'),
  name?: string(name='Name', description='任务名（1～15字符）'),
  description?: string(name='Description', description='任务描述（0～100字符）'),
  outboundNumsShrink?: string(name='OutboundNums', description='外呼主叫号码'),
  numRepeated?: int32(name='NumRepeated', description='被叫号码重复策略（0任务内去重，1不去重）'),
  handlerId?: long(name='HandlerId', description='技能组id（预测式外呼）或者ivr id（自动外呼）'),
  executionTime?: string(name='ExecutionTime', description='任务执行时间'),
  concurrentRate?: int32(name='ConcurrentRate', description='自动外呼的呼叫并发'),
  recallRuleShrink?: string(name='RecallRule', description='失败重呼策略（为空则不重呼）'),
  forecastCallRate?: float(name='ForecastCallRate', description='预测式外呼固定外呼比例（>=1）'),
}

model CreateAiOutboundTaskResponseBody = {
  requestId?: string(name='RequestId', description='请求ID'),
  message?: string(name='Message'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
  data?: long(name='Data', description='任务id'),
}

model CreateAiOutboundTaskResponse = {
  headers: map[string]string(name='headers'),
  body: CreateAiOutboundTaskResponseBody(name='body'),
}

async function createAiOutboundTaskWithOptions(tmpReq: CreateAiOutboundTaskRequest, runtime: Util.RuntimeOptions): CreateAiOutboundTaskResponse {
  Util.validateModel(tmpReq);
  var request = new CreateAiOutboundTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.outboundNums)) {
    request.outboundNumsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.outboundNums, 'OutboundNums', 'json');
  }
  if (!Util.isUnset(tmpReq.recallRule)) {
    request.recallRuleShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.recallRule, 'RecallRule', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateAiOutboundTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createAiOutboundTask(request: CreateAiOutboundTaskRequest): CreateAiOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAiOutboundTaskWithOptions(request, runtime);
}

model JoinThirdCallRequest {
  clientToken?: string(name='ClientToken'),
  instanceId?: string(name='InstanceId'),
  accountName?: string(name='AccountName'),
  callId?: string(name='CallId'),
  jobId?: string(name='JobId'),
  connectionId?: string(name='ConnectionId'),
  holdConnectionId?: string(name='HoldConnectionId'),
}

model JoinThirdCallResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model JoinThirdCallResponse = {
  headers: map[string]string(name='headers'),
  body: JoinThirdCallResponseBody(name='body'),
}

async function joinThirdCallWithOptions(request: JoinThirdCallRequest, runtime: Util.RuntimeOptions): JoinThirdCallResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('JoinThirdCall', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function joinThirdCall(request: JoinThirdCallRequest): JoinThirdCallResponse {
  var runtime = new Util.RuntimeOptions{};
  return joinThirdCallWithOptions(request, runtime);
}

model StartTaskByAppRequest {
  app?: string(name='App', description='app'),
  operator?: string(name='Operator', description='operator'),
  token?: string(name='Token', description='token'),
  envTypes?: string(name='EnvTypes', description='envTypes'),
  appName?: string(name='AppName', description='appName'),
  appId?: int32(name='AppId', description='appId'),
  buildId?: string(name='BuildId', description='buildId'),
  siteType?: string(name='SiteType', description='siteType'),
  requestId?: string(name='RequestId', description='requestId'),
}

model StartTaskByAppResponseBody = {
  status?: string(name='Status', description='status'),
  message?: string(name='Message', description='message'),
  buildId?: string(name='BuildId', description='buildId'),
  passNumber?: long(name='PassNumber', description='passNumber'),
  totalNumber?: long(name='TotalNumber', description='totalNumber'),
  url?: string(name='Url', description='url'),
  success?: boolean(name='Success', description='success'),
  testSetRecordId?: long(name='TestSetRecordId', description='testSetRecordId'),
  requestId?: string(name='RequestId', description='requestId'),
}

model StartTaskByAppResponse = {
  headers: map[string]string(name='headers'),
  body: StartTaskByAppResponseBody(name='body'),
}

async function startTaskByAppWithOptions(request: StartTaskByAppRequest, runtime: Util.RuntimeOptions): StartTaskByAppResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StartTaskByApp', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function startTaskByApp(request: StartTaskByAppRequest): StartTaskByAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return startTaskByAppWithOptions(request, runtime);
}

model CreateSkillGroupRequest {
  instanceId?: string(name='InstanceId'),
  skillGroupName?: string(name='SkillGroupName'),
  description?: string(name='Description'),
  displayName?: string(name='DisplayName'),
  channelType?: int32(name='ChannelType'),
  clientToken?: string(name='ClientToken'),
  departmentId?: long(name='DepartmentId', description='部门ID'),
}

model CreateSkillGroupResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  data?: long(name='Data'),
  code?: string(name='Code'),
  success?: boolean(name='Success'),
}

model CreateSkillGroupResponse = {
  headers: map[string]string(name='headers'),
  body: CreateSkillGroupResponseBody(name='body'),
}

async function createSkillGroupWithOptions(request: CreateSkillGroupRequest, runtime: Util.RuntimeOptions): CreateSkillGroupResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateSkillGroup', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createSkillGroup(request: CreateSkillGroupRequest): CreateSkillGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSkillGroupWithOptions(request, runtime);
}

model RestartOutboundTaskRequest {
  outboundTaskId?: long(name='OutboundTaskId'),
  instanceId?: string(name='InstanceId'),
}

model RestartOutboundTaskResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model RestartOutboundTaskResponse = {
  headers: map[string]string(name='headers'),
  body: RestartOutboundTaskResponseBody(name='body'),
}

async function restartOutboundTaskWithOptions(request: RestartOutboundTaskRequest, runtime: Util.RuntimeOptions): RestartOutboundTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RestartOutboundTask', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function restartOutboundTask(request: RestartOutboundTaskRequest): RestartOutboundTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return restartOutboundTaskWithOptions(request, runtime);
}

model ListDialogRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: long(name='TaskId'),
  called?: string(name='Called'),
}

model ListDialogResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request'),
  data?: [ 
    {
      role?: string(name='Role'),
      content?: string(name='Content'),
      nodeType?: string(name='NodeType'),
      time?: string(name='Time'),
      tag?: string(name='Tag'),
    }
  ](name='Data'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model ListDialogResponse = {
  headers: map[string]string(name='headers'),
  body: ListDialogResponseBody(name='body'),
}

async function listDialogWithOptions(request: ListDialogRequest, runtime: Util.RuntimeOptions): ListDialogResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListDialog', '2019-10-15', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listDialog(request: ListDialogRequest): ListDialogResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDialogWithOptions(request, runtime);
}

