/**
 *
 */
import Util;
import OpenApi;

import EndpointUtil;

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('cccxspace', @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 RemoveSkillGroupRequest {
  instanceId?: string(name='InstanceId'),
  skillGroupId?: string(name='SkillGroupId'),
}

model RemoveSkillGroupResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  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-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

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

model UpGradeInstanceRequest {
  commodityInstanceId?: string(name='CommodityInstanceId'),
  hotlineSeatNum?: int32(name='HotlineSeatNum'),
  onlineSeatNum?: int32(name='OnlineSeatNum'),
  chargeType?: string(name='ChargeType'),
  hotlineVersion?: string(name='HotlineVersion'),
  onlineVersion?: string(name='OnlineVersion'),
}

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

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

async function upGradeInstanceWithOptions(request: UpGradeInstanceRequest, runtime: Util.RuntimeOptions): UpGradeInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpGradeInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function upGradeInstance(request: UpGradeInstanceRequest): UpGradeInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return upGradeInstanceWithOptions(request, runtime);
}

model CheckOpenXspaceResponseBody = {
  httpStatusCode?: int32(name='HttpStatusCode'),
  status?: boolean(name='Status'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  code?: string(name='Code'),
  message?: string(name='Message'),
}

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

async function checkOpenXspaceWithOptions(runtime: Util.RuntimeOptions): CheckOpenXspaceResponse {
  var req = new OpenApi.OpenApiRequest{};
  return doRPCRequest('CheckOpenXspace', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function checkOpenXspace(): CheckOpenXspaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkOpenXspaceWithOptions(runtime);
}

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

model ListXsInstancesResponseBody = {
  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?: [ 
    {
      status?: int32(name='Status'),
      hotlineSeatNum?: int32(name='HotlineSeatNum'),
      startData?: string(name='StartData'),
      hadSTS?: boolean(name='HadSTS'),
      prodLevel?: string(name='ProdLevel'),
      instanceId?: string(name='InstanceId'),
      name?: string(name='Name'),
      chargetype?: string(name='Chargetype'),
      tenantId?: long(name='TenantId'),
      onlineSeatNum?: int32(name='OnlineSeatNum'),
      administrator?: {
        name?: string(name='Name'),
        userName?: string(name='UserName'),
      }(name='Administrator'),
    }
  ](name='CommodityInstances'),
}

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

async function listXsInstancesWithOptions(request: ListXsInstancesRequest, runtime: Util.RuntimeOptions): ListXsInstancesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListXsInstances', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listXsInstances(request: ListXsInstancesRequest): ListXsInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listXsInstancesWithOptions(request, runtime);
}

model ModifyXsInstanceRequest {
  instanceId?: string(name='InstanceId'),
  name?: string(name='Name'),
  description?: string(name='Description'),
}

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

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

async function modifyXsInstanceWithOptions(request: ModifyXsInstanceRequest, runtime: Util.RuntimeOptions): ModifyXsInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyXsInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyXsInstance(request: ModifyXsInstanceRequest): ModifyXsInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyXsInstanceWithOptions(request, runtime);
}

model ResumeCommodityInstanceRequest {
  commodityInstanceId?: string(name='CommodityInstanceId'),
}

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

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

async function resumeCommodityInstanceWithOptions(request: ResumeCommodityInstanceRequest, runtime: Util.RuntimeOptions): ResumeCommodityInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ResumeCommodityInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function resumeCommodityInstance(request: ResumeCommodityInstanceRequest): ResumeCommodityInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return resumeCommodityInstanceWithOptions(request, runtime);
}

model GetInstanceListRequest {
  userId?: string(name='UserId'),
  instanceName?: string(name='InstanceName'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
}

model GetInstanceListResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  data?: {
    pageNum?: int32(name='PageNum'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    hadSTS?: boolean(name='HadSTS'),
    tenantId?: long(name='TenantId'),
    instanceList?: [ string ](name='InstanceList'),
  }(name='Data'),
}

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-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

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

model QueryCommodityInstanceListRequest {
  accountId?: long(name='AccountId'),
}

model QueryCommodityInstanceListResponseBody = {
  httpStatusCode?: int32(name='HttpStatusCode'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  commodityInstances?: {
    commodityInstance?: [ 
    {
      status?: int32(name='Status'),
      hotlineSeatNum?: int32(name='HotlineSeatNum'),
      startData?: long(name='StartData'),
      endData?: long(name='EndData'),
      instanceId?: string(name='InstanceId'),
      onlineSeatNum?: int32(name='OnlineSeatNum'),
    }
  ](name='CommodityInstance')
  }(name='CommodityInstances'),
}

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

async function queryCommodityInstanceListWithOptions(request: QueryCommodityInstanceListRequest, runtime: Util.RuntimeOptions): QueryCommodityInstanceListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('QueryCommodityInstanceList', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function queryCommodityInstanceList(request: QueryCommodityInstanceListRequest): QueryCommodityInstanceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryCommodityInstanceListWithOptions(request, runtime);
}

model GetInstanceListSaleRequest {
  userId?: string(name='UserId'),
  instanceName?: string(name='InstanceName'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
}

model GetInstanceListSaleResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  data?: {
    pageNum?: int32(name='PageNum'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    hadSTS?: boolean(name='HadSTS'),
    tenantId?: long(name='TenantId'),
    instanceList?: [ string ](name='InstanceList'),
  }(name='Data'),
}

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

async function getInstanceListSaleWithOptions(request: GetInstanceListSaleRequest, runtime: Util.RuntimeOptions): GetInstanceListSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetInstanceListSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getInstanceListSale(request: GetInstanceListSaleRequest): GetInstanceListSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInstanceListSaleWithOptions(request, runtime);
}

model UpdateInstanceRequest {
  name?: string(name='Name'),
  description?: string(name='Description'),
  commodityInstanceId?: string(name='CommodityInstanceId'),
}

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

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

async function updateInstanceWithOptions(request: UpdateInstanceRequest, runtime: Util.RuntimeOptions): UpdateInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function updateInstance(request: UpdateInstanceRequest): UpdateInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateInstanceWithOptions(request, runtime);
}

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

model GetAliyunInstanceRouteSaleResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  data?: [ 
    {
      ruleId?: string(name='RuleId'),
      ruleName?: string(name='RuleName'),
    }
  ](name='Data'),
}

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

async function getAliyunInstanceRouteSaleWithOptions(request: GetAliyunInstanceRouteSaleRequest, runtime: Util.RuntimeOptions): GetAliyunInstanceRouteSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetAliyunInstanceRouteSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getAliyunInstanceRouteSale(request: GetAliyunInstanceRouteSaleRequest): GetAliyunInstanceRouteSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAliyunInstanceRouteSaleWithOptions(request, runtime);
}

model RenewAliyunCommodityInstanceRequest {
  instanceId?: string(name='InstanceId'),
  commodityList?: [ 
    {
      commodityCode?: string(name='CommodityCode'),
      commodityNum?: int32(name='CommodityNum'),
      description?: string(name='Description'),
      commodityStartTime?: long(name='CommodityStartTime'),
      chargeType?: string(name='ChargeType'),
      commodityEndTime?: long(name='CommodityEndTime'),
      commodityName?: string(name='CommodityName'),
      commodityEdition?: int32(name='CommodityEdition'),
      commodityType?: int32(name='CommodityType'),
    }
  ](name='CommodityList'),
}

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

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

async function renewAliyunCommodityInstanceWithOptions(request: RenewAliyunCommodityInstanceRequest, runtime: Util.RuntimeOptions): RenewAliyunCommodityInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RenewAliyunCommodityInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function renewAliyunCommodityInstance(request: RenewAliyunCommodityInstanceRequest): RenewAliyunCommodityInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return renewAliyunCommodityInstanceWithOptions(request, runtime);
}

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

model DescribeXsInstanceResponseBody = {
  httpStatusCode?: int32(name='HttpStatusCode'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  commodityInstance?: {
    status?: int32(name='Status'),
    hotlineSeatNum?: int32(name='HotlineSeatNum'),
    startData?: long(name='StartData'),
    description?: string(name='Description'),
    endData?: long(name='EndData'),
    instanceId?: string(name='InstanceId'),
    name?: string(name='Name'),
    onlineSeatNum?: int32(name='OnlineSeatNum'),
    administrator?: {
      email?: string(name='Email'),
      phoneNumber?: string(name='PhoneNumber'),
      name?: string(name='Name'),
      userName?: string(name='UserName'),
      id?: long(name='Id'),
    }(name='Administrator'),
  }(name='CommodityInstance'),
}

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

async function describeXsInstanceWithOptions(request: DescribeXsInstanceRequest, runtime: Util.RuntimeOptions): DescribeXsInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeXsInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeXsInstance(request: DescribeXsInstanceRequest): DescribeXsInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeXsInstanceWithOptions(request, runtime);
}

model AddAccountAsInstanceRequest {
  instanceId?: string(name='InstanceId'),
  userIds?: [ long ](name='UserIds'),
}

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

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

async function addAccountAsInstanceWithOptions(request: AddAccountAsInstanceRequest, runtime: Util.RuntimeOptions): AddAccountAsInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AddAccountAsInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function addAccountAsInstance(request: AddAccountAsInstanceRequest): AddAccountAsInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return addAccountAsInstanceWithOptions(request, runtime);
}

model AddUserRequest {
  loginName?: string(name='LoginName'),
  realName?: string(name='RealName'),
  phoneNumber?: string(name='PhoneNumber'),
  email?: string(name='Email'),
  instanceId?: string(name='InstanceId'),
  buName?: string(name='BuName'),
}

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

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

async function addUserWithOptions(request: AddUserRequest, runtime: Util.RuntimeOptions): AddUserResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AddUser', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function addUser(request: AddUserRequest): AddUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return addUserWithOptions(request, runtime);
}

model ChangeGradeAliyunInstanceSaleRequest {
  instanceId?: string(name='InstanceId'),
  commodityList?: [ 
    {
      commodityCode?: string(name='CommodityCode'),
      commodityNum?: int32(name='CommodityNum'),
      description?: string(name='Description'),
      commodityStartTime?: long(name='CommodityStartTime'),
      chargeType?: string(name='ChargeType'),
      commodityEndTime?: long(name='CommodityEndTime'),
      commodityName?: string(name='CommodityName'),
      commodityEdition?: int32(name='CommodityEdition'),
      commodityType?: int32(name='CommodityType'),
    }
  ](name='CommodityList'),
}

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

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

async function changeGradeAliyunInstanceSaleWithOptions(request: ChangeGradeAliyunInstanceSaleRequest, runtime: Util.RuntimeOptions): ChangeGradeAliyunInstanceSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ChangeGradeAliyunInstanceSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function changeGradeAliyunInstanceSale(request: ChangeGradeAliyunInstanceSaleRequest): ChangeGradeAliyunInstanceSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeGradeAliyunInstanceSaleWithOptions(request, runtime);
}

model CreateAliyunInstanceNewRequest {
  instanceId?: string(name='InstanceId'),
  instanceName?: string(name='InstanceName'),
  region?: string(name='Region'),
  environment?: string(name='Environment'),
  source?: long(name='Source'),
  description?: string(name='Description'),
  instanceComponent?: string(name='InstanceComponent'),
  userId?: string(name='UserId'),
  commodityList?: [ 
    {
      commodityCode?: string(name='CommodityCode'),
      commodityNum?: int32(name='CommodityNum'),
      description?: string(name='Description'),
      commodityStartTime?: long(name='CommodityStartTime'),
      chargeType?: string(name='ChargeType'),
      commodityEndTime?: long(name='CommodityEndTime'),
      commodityName?: string(name='CommodityName'),
      commodityEdition?: int32(name='CommodityEdition'),
      commodityType?: int32(name='CommodityType'),
    }
  ](name='CommodityList'),
}

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

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

async function createAliyunInstanceNewWithOptions(request: CreateAliyunInstanceNewRequest, runtime: Util.RuntimeOptions): CreateAliyunInstanceNewResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateAliyunInstanceNew', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createAliyunInstanceNew(request: CreateAliyunInstanceNewRequest): CreateAliyunInstanceNewResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAliyunInstanceNewWithOptions(request, runtime);
}

model GetInstanceRequest {
  instanceName?: string(name='InstanceName'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
}

model GetInstanceResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  data?: {
    pageNum?: int32(name='PageNum'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    hadSTS?: boolean(name='HadSTS'),
    tenantId?: long(name='TenantId'),
    instanceList?: [ string ](name='InstanceList'),
  }(name='Data'),
}

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

async function getInstanceWithOptions(request: GetInstanceRequest, runtime: Util.RuntimeOptions): GetInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getInstance(request: GetInstanceRequest): GetInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInstanceWithOptions(request, runtime);
}

model DescribeInstanceRequest {
  commodityInstanceId?: string(name='CommodityInstanceId'),
}

model DescribeInstanceResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: {
    commodityInstance?: {
      commodityInstanceId?: string(name='CommodityInstanceId'),
      description?: string(name='Description'),
      commodityInstanceName?: string(name='CommodityInstanceName'),
      commodities?: [ string ](name='Commodities'),
      administrator?: {
        email?: string(name='Email'),
        name?: string(name='Name'),
        phoneNumber?: string(name='PhoneNumber'),
        accountName?: string(name='AccountName'),
      }(name='Administrator'),
    }(name='CommodityInstance'),
  }(name='Data'),
}

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

async function describeInstanceWithOptions(request: DescribeInstanceRequest, runtime: Util.RuntimeOptions): DescribeInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeInstance(request: DescribeInstanceRequest): DescribeInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceWithOptions(request, runtime);
}

model ReleaseAliyunCommodityInstanceSaleRequest {
  instanceId?: string(name='InstanceId'),
  commodityList?: [ 
    {
      commodityCode?: string(name='CommodityCode'),
      commodityNum?: int32(name='CommodityNum'),
      description?: string(name='Description'),
      commodityStartTime?: long(name='CommodityStartTime'),
      chargeType?: string(name='ChargeType'),
      commodityEndTime?: long(name='CommodityEndTime'),
      commodityName?: string(name='CommodityName'),
      commodityEdition?: int32(name='CommodityEdition'),
      commodityType?: int32(name='CommodityType'),
    }
  ](name='CommodityList'),
}

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

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

async function releaseAliyunCommodityInstanceSaleWithOptions(request: ReleaseAliyunCommodityInstanceSaleRequest, runtime: Util.RuntimeOptions): ReleaseAliyunCommodityInstanceSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ReleaseAliyunCommodityInstanceSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function releaseAliyunCommodityInstanceSale(request: ReleaseAliyunCommodityInstanceSaleRequest): ReleaseAliyunCommodityInstanceSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseAliyunCommodityInstanceSaleWithOptions(request, runtime);
}

model ModifyUserRequest {
  userId?: long(name='UserId'),
  instanceId?: string(name='InstanceId'),
  phoneNumber?: string(name='PhoneNumber'),
  email?: string(name='Email'),
  buName?: string(name='BuName'),
}

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

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

async function modifyUserWithOptions(request: ModifyUserRequest, runtime: Util.RuntimeOptions): ModifyUserResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyUser', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyUser(request: ModifyUserRequest): ModifyUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyUserWithOptions(request, runtime);
}

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

model UpdateSkillGroupResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  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-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

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

model DescribeInstanceSaleRequest {
  commodityInstanceId?: string(name='CommodityInstanceId'),
}

model DescribeInstanceSaleResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: {
    commodityInstance?: {
      commodityInstanceId?: string(name='CommodityInstanceId'),
      description?: string(name='Description'),
      commodityInstanceName?: string(name='CommodityInstanceName'),
      commodities?: [ string ](name='Commodities'),
      administrator?: {
        email?: string(name='Email'),
        name?: string(name='Name'),
        phoneNumber?: string(name='PhoneNumber'),
        accountName?: string(name='AccountName'),
      }(name='Administrator'),
    }(name='CommodityInstance'),
  }(name='Data'),
}

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

async function describeInstanceSaleWithOptions(request: DescribeInstanceSaleRequest, runtime: Util.RuntimeOptions): DescribeInstanceSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeInstanceSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeInstanceSale(request: DescribeInstanceSaleRequest): DescribeInstanceSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInstanceSaleWithOptions(request, runtime);
}

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

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

async function checkOpenSaleWithOptions(runtime: Util.RuntimeOptions): CheckOpenSaleResponse {
  var req = new OpenApi.OpenApiRequest{};
  return doRPCRequest('CheckOpenSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function checkOpenSale(): CheckOpenSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkOpenSaleWithOptions(runtime);
}

model DisplayInstanceUserRequest {
  commodityInstanceId?: string(name='CommodityInstanceId'),
}

model DisplayInstanceUserResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: {
    administratorInfo?: {
      buName?: string(name='BuName'),
      logName?: string(name='LogName'),
      email?: string(name='Email'),
      phoneNumber?: string(name='PhoneNumber'),
      realName?: string(name='RealName'),
    }(name='AdministratorInfo'),
  }(name='Data'),
}

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

async function displayInstanceUserWithOptions(request: DisplayInstanceUserRequest, runtime: Util.RuntimeOptions): DisplayInstanceUserResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DisplayInstanceUser', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function displayInstanceUser(request: DisplayInstanceUserRequest): DisplayInstanceUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return displayInstanceUserWithOptions(request, runtime);
}

model RenewAliyunCommodityInstanceSaleRequest {
  instanceId?: string(name='InstanceId'),
  commodityList?: [ 
    {
      commodityCode?: string(name='CommodityCode'),
      commodityNum?: int32(name='CommodityNum'),
      description?: string(name='Description'),
      commodityStartTime?: long(name='CommodityStartTime'),
      chargeType?: string(name='ChargeType'),
      commodityEndTime?: long(name='CommodityEndTime'),
      commodityName?: string(name='CommodityName'),
      commodityEdition?: int32(name='CommodityEdition'),
      commodityType?: int32(name='CommodityType'),
    }
  ](name='CommodityList'),
}

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

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

async function renewAliyunCommodityInstanceSaleWithOptions(request: RenewAliyunCommodityInstanceSaleRequest, runtime: Util.RuntimeOptions): RenewAliyunCommodityInstanceSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RenewAliyunCommodityInstanceSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function renewAliyunCommodityInstanceSale(request: RenewAliyunCommodityInstanceSaleRequest): RenewAliyunCommodityInstanceSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return renewAliyunCommodityInstanceSaleWithOptions(request, runtime);
}

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

model QuerySkillGroupsResponseBody = {
  totalResults?: int32(name='TotalResults'),
  totalPage?: int32(name='TotalPage'),
  currentPage?: int32(name='CurrentPage'),
  onePageSize?: int32(name='OnePageSize'),
  requestId?: string(name='RequestId'),
  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-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

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

model ReleaseCommodityInstanceRequest {
  commodityInstanceId?: string(name='CommodityInstanceId'),
}

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

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

async function releaseCommodityInstanceWithOptions(request: ReleaseCommodityInstanceRequest, runtime: Util.RuntimeOptions): ReleaseCommodityInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ReleaseCommodityInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function releaseCommodityInstance(request: ReleaseCommodityInstanceRequest): ReleaseCommodityInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseCommodityInstanceWithOptions(request, runtime);
}

model GetInstanceSaleRequest {
  instanceName?: string(name='InstanceName'),
  pageNum?: int32(name='PageNum'),
  pageSize?: int32(name='PageSize'),
}

model GetInstanceSaleResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  data?: {
    pageNum?: int32(name='PageNum'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
    hadSTS?: boolean(name='HadSTS'),
    tenantId?: long(name='TenantId'),
    instanceList?: [ string ](name='InstanceList'),
  }(name='Data'),
}

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

async function getInstanceSaleWithOptions(request: GetInstanceSaleRequest, runtime: Util.RuntimeOptions): GetInstanceSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetInstanceSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getInstanceSale(request: GetInstanceSaleRequest): GetInstanceSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return getInstanceSaleWithOptions(request, runtime);
}

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

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

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

async function deleteXsInstanceWithOptions(request: DeleteXsInstanceRequest, runtime: Util.RuntimeOptions): DeleteXsInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteXsInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteXsInstance(request: DeleteXsInstanceRequest): DeleteXsInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteXsInstanceWithOptions(request, runtime);
}

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

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

async function checkOpenWithOptions(runtime: Util.RuntimeOptions): CheckOpenResponse {
  var req = new OpenApi.OpenApiRequest{};
  return doRPCRequest('CheckOpen', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function checkOpen(): CheckOpenResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkOpenWithOptions(runtime);
}

model AddInstanceUserSaleRequest {
  instanceId?: string(name='InstanceId'),
  loginName?: string(name='LoginName'),
  realName?: string(name='RealName'),
  phoneNumber?: string(name='PhoneNumber'),
  email?: string(name='Email'),
  buName?: string(name='BuName'),
}

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

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

async function addInstanceUserSaleWithOptions(request: AddInstanceUserSaleRequest, runtime: Util.RuntimeOptions): AddInstanceUserSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AddInstanceUserSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function addInstanceUserSale(request: AddInstanceUserSaleRequest): AddInstanceUserSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return addInstanceUserSaleWithOptions(request, runtime);
}

model PhysicalDeleteInstanceRequest {
  accountId?: long(name='AccountId'),
}

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

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

async function physicalDeleteInstanceWithOptions(request: PhysicalDeleteInstanceRequest, runtime: Util.RuntimeOptions): PhysicalDeleteInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('PhysicalDeleteInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function physicalDeleteInstance(request: PhysicalDeleteInstanceRequest): PhysicalDeleteInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return physicalDeleteInstanceWithOptions(request, runtime);
}

model CreateSubTicketRequest {
  instanceId?: string(name='InstanceId'),
  creatorId?: long(name='CreatorId'),
  creatorName?: string(name='CreatorName'),
  templateId?: long(name='TemplateId'),
  fromInfo?: string(name='FromInfo'),
  formData?: string(name='FormData'),
  memberId?: long(name='MemberId'),
  memberName?: string(name='MemberName'),
  priority?: int32(name='Priority'),
  parentCaseId?: long(name='ParentCaseId'),
  bizData?: string(name='BizData'),
  agentId?: long(name='AgentId'),
}

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

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

async function createSubTicketWithOptions(request: CreateSubTicketRequest, runtime: Util.RuntimeOptions): CreateSubTicketResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateSubTicket', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createSubTicket(request: CreateSubTicketRequest): CreateSubTicketResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSubTicketWithOptions(request, runtime);
}

model DisplayInstanceUserSaleRequest {
  commodityInstanceId?: string(name='CommodityInstanceId'),
}

model DisplayInstanceUserSaleResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  data?: {
    administratorInfo?: {
      buName?: string(name='BuName'),
      logName?: string(name='LogName'),
      email?: string(name='Email'),
      phoneNumber?: string(name='PhoneNumber'),
      realName?: string(name='RealName'),
    }(name='AdministratorInfo'),
  }(name='Data'),
}

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

async function displayInstanceUserSaleWithOptions(request: DisplayInstanceUserSaleRequest, runtime: Util.RuntimeOptions): DisplayInstanceUserSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DisplayInstanceUserSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function displayInstanceUserSale(request: DisplayInstanceUserSaleRequest): DisplayInstanceUserSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return displayInstanceUserSaleWithOptions(request, runtime);
}

model UpdateInstanceSaleRequest {
  name?: string(name='Name'),
  description?: string(name='Description'),
  commodityInstanceId?: string(name='CommodityInstanceId'),
}

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

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

async function updateInstanceSaleWithOptions(request: UpdateInstanceSaleRequest, runtime: Util.RuntimeOptions): UpdateInstanceSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateInstanceSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function updateInstanceSale(request: UpdateInstanceSaleRequest): UpdateInstanceSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateInstanceSaleWithOptions(request, runtime);
}

model RenewInstanceCommodityInstanceRequest {
  commodityInstanceId?: string(name='CommodityInstanceId'),
}

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

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

async function renewInstanceCommodityInstanceWithOptions(request: RenewInstanceCommodityInstanceRequest, runtime: Util.RuntimeOptions): RenewInstanceCommodityInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RenewInstanceCommodityInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function renewInstanceCommodityInstance(request: RenewInstanceCommodityInstanceRequest): RenewInstanceCommodityInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return renewInstanceCommodityInstanceWithOptions(request, runtime);
}

model GetUsersResponseBody = {
  httpStatusCode?: int32(name='HttpStatusCode'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  users?: [ 
    {
      displayName?: string(name='DisplayName'),
      mobilePhone?: string(name='MobilePhone'),
      userName?: string(name='UserName'),
      userId?: long(name='UserId'),
    }
  ](name='Users'),
}

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

async function getUsersWithOptions(runtime: Util.RuntimeOptions): GetUsersResponse {
  var req = new OpenApi.OpenApiRequest{};
  return doRPCRequest('GetUsers', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getUsers(): GetUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUsersWithOptions(runtime);
}

model UpdateInstanceUserRequest {
  instanceId?: string(name='InstanceId'),
  email?: string(name='Email'),
  phoneNumber?: string(name='PhoneNumber'),
  buName?: string(name='BuName'),
}

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

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

async function updateInstanceUserWithOptions(request: UpdateInstanceUserRequest, runtime: Util.RuntimeOptions): UpdateInstanceUserResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateInstanceUser', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function updateInstanceUser(request: UpdateInstanceUserRequest): UpdateInstanceUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateInstanceUserWithOptions(request, runtime);
}

model CreateAliyunInstanceNewSaleRequest {
  instanceId?: string(name='InstanceId'),
  instanceName?: string(name='InstanceName'),
  region?: string(name='Region'),
  environment?: string(name='Environment'),
  source?: long(name='Source'),
  description?: string(name='Description'),
  instanceComponent?: string(name='InstanceComponent'),
  userId?: string(name='UserId'),
  commodityList?: [ 
    {
      commodityCode?: string(name='CommodityCode'),
      commodityNum?: int32(name='CommodityNum'),
      description?: string(name='Description'),
      commodityStartTime?: long(name='CommodityStartTime'),
      chargeType?: string(name='ChargeType'),
      commodityEndTime?: long(name='CommodityEndTime'),
      commodityName?: string(name='CommodityName'),
      commodityEdition?: int32(name='CommodityEdition'),
      commodityType?: int32(name='CommodityType'),
    }
  ](name='CommodityList'),
}

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

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

async function createAliyunInstanceNewSaleWithOptions(request: CreateAliyunInstanceNewSaleRequest, runtime: Util.RuntimeOptions): CreateAliyunInstanceNewSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateAliyunInstanceNewSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createAliyunInstanceNewSale(request: CreateAliyunInstanceNewSaleRequest): CreateAliyunInstanceNewSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAliyunInstanceNewSaleWithOptions(request, runtime);
}

model ChangeGradeAliyunInstanceRequest {
  instanceId?: string(name='InstanceId'),
  commodityList?: [ 
    {
      commodityCode?: string(name='CommodityCode'),
      commodityNum?: int32(name='CommodityNum'),
      description?: string(name='Description'),
      commodityStartTime?: long(name='CommodityStartTime'),
      chargeType?: string(name='ChargeType'),
      commodityEndTime?: long(name='CommodityEndTime'),
      commodityName?: string(name='CommodityName'),
      commodityEdition?: int32(name='CommodityEdition'),
      commodityType?: int32(name='CommodityType'),
    }
  ](name='CommodityList'),
}

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

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

async function changeGradeAliyunInstanceWithOptions(request: ChangeGradeAliyunInstanceRequest, runtime: Util.RuntimeOptions): ChangeGradeAliyunInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ChangeGradeAliyunInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function changeGradeAliyunInstance(request: ChangeGradeAliyunInstanceRequest): ChangeGradeAliyunInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeGradeAliyunInstanceWithOptions(request, runtime);
}

model GetByForeignIdRequest {
  instanceId?: string(name='InstanceId'),
  foreignId?: string(name='ForeignId'),
  sourceId?: long(name='SourceId'),
}

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

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

async function getByForeignIdWithOptions(request: GetByForeignIdRequest, runtime: Util.RuntimeOptions): GetByForeignIdResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetByForeignId', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getByForeignId(request: GetByForeignIdRequest): GetByForeignIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getByForeignIdWithOptions(request, runtime);
}

model ReleaseAliyunCommodityInstanceRequest {
  instanceId?: string(name='InstanceId'),
  commodityList?: [ 
    {
      commodityCode?: string(name='CommodityCode'),
      commodityNum?: int32(name='CommodityNum'),
      description?: string(name='Description'),
      commodityStartTime?: long(name='CommodityStartTime'),
      chargeType?: string(name='ChargeType'),
      commodityEndTime?: long(name='CommodityEndTime'),
      commodityName?: string(name='CommodityName'),
      commodityEdition?: int32(name='CommodityEdition'),
      commodityType?: int32(name='CommodityType'),
    }
  ](name='CommodityList'),
}

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

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

async function releaseAliyunCommodityInstanceWithOptions(request: ReleaseAliyunCommodityInstanceRequest, runtime: Util.RuntimeOptions): ReleaseAliyunCommodityInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ReleaseAliyunCommodityInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function releaseAliyunCommodityInstance(request: ReleaseAliyunCommodityInstanceRequest): ReleaseAliyunCommodityInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseAliyunCommodityInstanceWithOptions(request, runtime);
}

model DoLogicalDeleteInstanceRequest {
  accountId?: long(name='AccountId'),
}

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

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

async function doLogicalDeleteInstanceWithOptions(request: DoLogicalDeleteInstanceRequest, runtime: Util.RuntimeOptions): DoLogicalDeleteInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DoLogicalDeleteInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function doLogicalDeleteInstance(request: DoLogicalDeleteInstanceRequest): DoLogicalDeleteInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return doLogicalDeleteInstanceWithOptions(request, runtime);
}

model AddInstanceUserRequest {
  instanceId?: string(name='InstanceId'),
  loginName?: string(name='LoginName'),
  realName?: string(name='RealName'),
  phoneNumber?: string(name='PhoneNumber'),
  email?: string(name='Email'),
  buName?: string(name='BuName'),
}

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

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

async function addInstanceUserWithOptions(request: AddInstanceUserRequest, runtime: Util.RuntimeOptions): AddInstanceUserResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AddInstanceUser', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function addInstanceUser(request: AddInstanceUserRequest): AddInstanceUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return addInstanceUserWithOptions(request, runtime);
}

model CreateSkillGroupRequest {
  instanceId?: string(name='InstanceId'),
  skillGroupName?: string(name='SkillGroupName'),
  description?: string(name='Description'),
  displayName?: string(name='DisplayName'),
  channelType?: int32(name='ChannelType'),
}

model CreateSkillGroupResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  data?: long(name='Data'),
  requestId?: string(name='RequestId'),
  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-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

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

model CreateXspaceCommodityInstanceRequest {
  alipkUserId?: long(name='AlipkUserId'),
  commodityInstanceId?: string(name='CommodityInstanceId'),
  commodityCode?: string(name='CommodityCode'),
  commodityInstanceComponent?: string(name='CommodityInstanceComponent'),
  env?: string(name='Env'),
  startDate?: long(name='StartDate'),
  endDate?: long(name='EndDate'),
  chargetype?: string(name='Chargetype'),
  hotlineSeatNum?: int32(name='HotlineSeatNum'),
  onlineSeatNum?: int32(name='OnlineSeatNum'),
  region?: string(name='Region'),
  commodityInstanceName?: string(name='CommodityInstanceName'),
  hotlineVersion?: string(name='HotlineVersion'),
  onlineVersion?: string(name='OnlineVersion'),
}

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

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

async function createXspaceCommodityInstanceWithOptions(request: CreateXspaceCommodityInstanceRequest, runtime: Util.RuntimeOptions): CreateXspaceCommodityInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateXspaceCommodityInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createXspaceCommodityInstance(request: CreateXspaceCommodityInstanceRequest): CreateXspaceCommodityInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createXspaceCommodityInstanceWithOptions(request, runtime);
}

model UpdateInstanceUserSaleRequest {
  instanceId?: string(name='InstanceId'),
  email?: string(name='Email'),
  phoneNumber?: string(name='PhoneNumber'),
  buName?: string(name='BuName'),
}

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

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

async function updateInstanceUserSaleWithOptions(request: UpdateInstanceUserSaleRequest, runtime: Util.RuntimeOptions): UpdateInstanceUserSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpdateInstanceUserSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function updateInstanceUserSale(request: UpdateInstanceUserSaleRequest): UpdateInstanceUserSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateInstanceUserSaleWithOptions(request, runtime);
}

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

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

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

async function checkAliyunInstanceStatusSaleWithOptions(request: CheckAliyunInstanceStatusSaleRequest, runtime: Util.RuntimeOptions): CheckAliyunInstanceStatusSaleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CheckAliyunInstanceStatusSale', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function checkAliyunInstanceStatusSale(request: CheckAliyunInstanceStatusSaleRequest): CheckAliyunInstanceStatusSaleResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkAliyunInstanceStatusSaleWithOptions(request, runtime);
}

model SuspendCommodityInstanceRequest {
  commodityInstanceId?: string(name='CommodityInstanceId'),
}

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

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

async function suspendCommodityInstanceWithOptions(request: SuspendCommodityInstanceRequest, runtime: Util.RuntimeOptions): SuspendCommodityInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SuspendCommodityInstance', '2019-11-28', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function suspendCommodityInstance(request: SuspendCommodityInstanceRequest): SuspendCommodityInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return suspendCommodityInstanceWithOptions(request, runtime);
}

