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

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  @endpointMap = {
    cn-beijing = 'gpdb.aliyuncs.com',
    cn-hangzhou = 'gpdb.aliyuncs.com',
    cn-shanghai = 'gpdb.aliyuncs.com',
    cn-shenzhen = 'gpdb.aliyuncs.com',
    cn-hongkong = 'gpdb.aliyuncs.com',
    ap-southeast-1 = 'gpdb.aliyuncs.com',
    us-west-1 = 'gpdb.aliyuncs.com',
    us-east-1 = 'gpdb.aliyuncs.com',
    cn-hangzhou-finance = 'gpdb.aliyuncs.com',
    cn-shanghai-finance-1 = 'gpdb.aliyuncs.com',
    cn-shenzhen-finance-1 = 'gpdb.aliyuncs.com',
    cn-qingdao = 'gpdb.aliyuncs.com',
    cn-north-2-gov-1 = 'gpdb.aliyuncs.com',
  };
  checkConfig(config);
  @endpoint = getEndpoint('gpdb', @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 AddBuDBInstanceRelationRequest {
  ownerId?: long(name='OwnerId'),
  DBInstanceId?: string(name='DBInstanceId'),
  businessUnit?: string(name='BusinessUnit'),
}

model AddBuDBInstanceRelationResponseBody = {
  DBInstanceName?: string(name='DBInstanceName'),
  requestId?: string(name='RequestId'),
  businessUnit?: string(name='BusinessUnit'),
}

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

async function addBuDBInstanceRelationWithOptions(request: AddBuDBInstanceRelationRequest, runtime: Util.RuntimeOptions): AddBuDBInstanceRelationResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AddBuDBInstanceRelation', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function addBuDBInstanceRelation(request: AddBuDBInstanceRelationRequest): AddBuDBInstanceRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return addBuDBInstanceRelationWithOptions(request, runtime);
}

model AllocateInstancePublicConnectionRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  DBInstanceId?: string(name='DBInstanceId'),
  connectionStringPrefix?: string(name='ConnectionStringPrefix'),
  port?: string(name='Port'),
  addressType?: string(name='AddressType'),
}

model AllocateInstancePublicConnectionResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function allocateInstancePublicConnectionWithOptions(request: AllocateInstancePublicConnectionRequest, runtime: Util.RuntimeOptions): AllocateInstancePublicConnectionResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AllocateInstancePublicConnection', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function allocateInstancePublicConnection(request: AllocateInstancePublicConnectionRequest): AllocateInstancePublicConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return allocateInstancePublicConnectionWithOptions(request, runtime);
}

model CheckServiceLinkedRoleRequest {
  regionId?: string(name='RegionId'),
}

model CheckServiceLinkedRoleResponseBody = {
  requestId?: string(name='RequestId'),
  hasServiceLinkedRole?: string(name='HasServiceLinkedRole'),
  regionId?: string(name='RegionId'),
}

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

async function checkServiceLinkedRoleWithOptions(request: CheckServiceLinkedRoleRequest, runtime: Util.RuntimeOptions): CheckServiceLinkedRoleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CheckServiceLinkedRole', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function checkServiceLinkedRole(request: CheckServiceLinkedRoleRequest): CheckServiceLinkedRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkServiceLinkedRoleWithOptions(request, runtime);
}

model CreateAccountRequest {
  ownerId?: long(name='OwnerId'),
  DBInstanceId?: string(name='DBInstanceId'),
  databaseName?: string(name='DatabaseName'),
  accountName?: string(name='AccountName'),
  accountPassword?: string(name='AccountPassword'),
  accountDescription?: string(name='AccountDescription'),
}

model CreateAccountResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function createAccountWithOptions(request: CreateAccountRequest, runtime: Util.RuntimeOptions): CreateAccountResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateAccount', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createAccount(request: CreateAccountRequest): CreateAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAccountWithOptions(request, runtime);
}

model CreateDBInstanceRequest {
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  zoneId?: string(name='ZoneId'),
  engineVersion?: string(name='EngineVersion'),
  engine?: string(name='Engine'),
  DBInstanceClass?: string(name='DBInstanceClass'),
  DBInstanceGroupCount?: string(name='DBInstanceGroupCount'),
  DBInstanceDescription?: string(name='DBInstanceDescription'),
  securityIPList?: string(name='SecurityIPList'),
  payType?: string(name='PayType'),
  period?: string(name='Period'),
  usedTime?: string(name='UsedTime'),
  clientToken?: string(name='ClientToken'),
  instanceNetworkType?: string(name='InstanceNetworkType'),
  VPCId?: string(name='VPCId'),
  vSwitchId?: string(name='VSwitchId'),
  privateIpAddress?: string(name='PrivateIpAddress'),
}

model CreateDBInstanceResponseBody = {
  DBInstanceId?: string(name='DBInstanceId'),
  requestId?: string(name='RequestId'),
  port?: string(name='Port'),
  connectionString?: string(name='ConnectionString'),
  orderId?: string(name='OrderId'),
}

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

async function createDBInstanceWithOptions(request: CreateDBInstanceRequest, runtime: Util.RuntimeOptions): CreateDBInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateDBInstance', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createDBInstance(request: CreateDBInstanceRequest): CreateDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBInstanceWithOptions(request, runtime);
}

model CreateECSDBInstanceRequest {
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  zoneId?: string(name='ZoneId'),
  engineVersion?: string(name='EngineVersion'),
  engine?: string(name='Engine'),
  instanceSpec?: string(name='InstanceSpec'),
  segNodeNum?: int32(name='SegNodeNum'),
  segStorageType?: string(name='SegStorageType'),
  storageSize?: int32(name='StorageSize'),
  DBInstanceDescription?: string(name='DBInstanceDescription'),
  securityIPList?: string(name='SecurityIPList'),
  payType?: string(name='PayType'),
  period?: string(name='Period'),
  usedTime?: string(name='UsedTime'),
  clientToken?: string(name='ClientToken'),
  instanceNetworkType?: string(name='InstanceNetworkType'),
  VPCId?: string(name='VPCId'),
  vSwitchId?: string(name='VSwitchId'),
  privateIpAddress?: string(name='PrivateIpAddress'),
  encryptionKey?: string(name='EncryptionKey'),
  encryptionType?: string(name='EncryptionType'),
  masterNodeNum?: int32(name='MasterNodeNum'),
  srcDbInstanceName?: string(name='SrcDbInstanceName'),
  backupId?: string(name='BackupId'),
  DBInstanceCategory?: string(name='DBInstanceCategory'),
}

model CreateECSDBInstanceResponseBody = {
  requestId?: string(name='RequestId'),
  DBInstanceId?: string(name='DBInstanceId'),
  port?: string(name='Port'),
  connectionString?: string(name='ConnectionString'),
  orderId?: string(name='OrderId'),
}

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

async function createECSDBInstanceWithOptions(request: CreateECSDBInstanceRequest, runtime: Util.RuntimeOptions): CreateECSDBInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateECSDBInstance', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createECSDBInstance(request: CreateECSDBInstanceRequest): CreateECSDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createECSDBInstanceWithOptions(request, runtime);
}

model CreateServiceLinkedRoleRequest {
  regionId?: string(name='RegionId'),
  ownerId?: long(name='OwnerId'),
}

model CreateServiceLinkedRoleResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function createServiceLinkedRoleWithOptions(request: CreateServiceLinkedRoleRequest, runtime: Util.RuntimeOptions): CreateServiceLinkedRoleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateServiceLinkedRole', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createServiceLinkedRole(request: CreateServiceLinkedRoleRequest): CreateServiceLinkedRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createServiceLinkedRoleWithOptions(request, runtime);
}

model DeleteDatabaseRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  DBName?: string(name='DBName'),
}

model DeleteDatabaseResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function deleteDatabaseWithOptions(request: DeleteDatabaseRequest, runtime: Util.RuntimeOptions): DeleteDatabaseResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteDatabase', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteDatabase(request: DeleteDatabaseRequest): DeleteDatabaseResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDatabaseWithOptions(request, runtime);
}

model DeleteDBInstanceRequest {
  ownerId?: long(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
  DBInstanceId?: string(name='DBInstanceId'),
}

model DeleteDBInstanceResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function deleteDBInstanceWithOptions(request: DeleteDBInstanceRequest, runtime: Util.RuntimeOptions): DeleteDBInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteDBInstance', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteDBInstance(request: DeleteDBInstanceRequest): DeleteDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDBInstanceWithOptions(request, runtime);
}

model DescribeAccountsRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  accountName?: string(name='AccountName'),
}

model DescribeAccountsResponseBody = {
  requestId?: string(name='RequestId'),
  accounts?: {
    DBInstanceAccount?: [ 
    {
      accountDescription?: string(name='AccountDescription'),
      DBInstanceId?: string(name='DBInstanceId'),
      accountStatus?: string(name='AccountStatus'),
      accountName?: string(name='AccountName'),
    }
  ](name='DBInstanceAccount')
  }(name='Accounts'),
}

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

async function describeAccountsWithOptions(request: DescribeAccountsRequest, runtime: Util.RuntimeOptions): DescribeAccountsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeAccounts', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeAccounts(request: DescribeAccountsRequest): DescribeAccountsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAccountsWithOptions(request, runtime);
}

model DescribeAvailableResourcesRequest {
  region?: string(name='Region'),
  zoneId?: string(name='ZoneId'),
  chargeType?: string(name='ChargeType'),
}

model DescribeAvailableResourcesResponseBody = {
  regionId?: string(name='RegionId'),
  requestId?: string(name='RequestId'),
  resources?: [ 
    {
      zoneId?: string(name='ZoneId'),
      supportedEngines?: [ 
        {
          supportedEngineVersion?: string(name='SupportedEngineVersion'),
          mode?: string(name='Mode'),
          supportedInstanceClasses?: [ 
            {
              storageType?: string(name='StorageType'),
              description?: string(name='Description'),
              displayClass?: string(name='DisplayClass'),
              instanceClass?: string(name='InstanceClass'),
              nodeCount?: {
                step?: string(name='Step'),
                minCount?: string(name='MinCount'),
                maxCount?: string(name='MaxCount'),
              }(name='NodeCount'),
              storageSize?: {
                step?: string(name='Step'),
                minCount?: string(name='MinCount'),
                maxCount?: string(name='MaxCount'),
              }(name='StorageSize'),
            }
          ](name='SupportedInstanceClasses'),
        }
      ](name='SupportedEngines'),
    }
  ](name='Resources'),
}

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

async function describeAvailableResourcesWithOptions(request: DescribeAvailableResourcesRequest, runtime: Util.RuntimeOptions): DescribeAvailableResourcesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeAvailableResources', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeAvailableResources(request: DescribeAvailableResourcesRequest): DescribeAvailableResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableResourcesWithOptions(request, runtime);
}

model DescribeBackupPolicyRequest {
  DBInstanceId?: string(name='DBInstanceId'),
}

model DescribeBackupPolicyResponseBody = {
  backupRetentionPeriod?: int32(name='BackupRetentionPeriod'),
  requestId?: string(name='RequestId'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod'),
  preferredBackupTime?: string(name='PreferredBackupTime'),
  recoveryPointPeriod?: string(name='RecoveryPointPeriod'),
  enableRecoveryPoint?: boolean(name='EnableRecoveryPoint'),
}

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

async function describeBackupPolicyWithOptions(request: DescribeBackupPolicyRequest, runtime: Util.RuntimeOptions): DescribeBackupPolicyResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeBackupPolicy', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeBackupPolicy(request: DescribeBackupPolicyRequest): DescribeBackupPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupPolicyWithOptions(request, runtime);
}

model DescribeDataBackupsRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  backupId?: string(name='BackupId'),
  startTime?: string(name='StartTime'),
  endTime?: string(name='EndTime'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
  dataType?: string(name='DataType'),
  backupMode?: string(name='BackupMode'),
  backupStatus?: string(name='BackupStatus'),
}

model DescribeDataBackupsResponseBody = {
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  pageNumber?: int32(name='PageNumber'),
  totalCount?: int32(name='TotalCount'),
  items?: [ 
    {
      dataType?: string(name='DataType'),
      consistentTime?: long(name='ConsistentTime'),
      backupStatus?: string(name='BackupStatus'),
      backupStartTime?: string(name='BackupStartTime'),
      backupEndTime?: string(name='BackupEndTime'),
      backupEndTimeLocal?: string(name='BackupEndTimeLocal'),
      backupSetId?: string(name='BackupSetId'),
      baksetName?: string(name='BaksetName'),
      backupSize?: long(name='BackupSize'),
      backupMode?: string(name='BackupMode'),
      backupStartTimeLocal?: string(name='BackupStartTimeLocal'),
      DBInstanceId?: string(name='DBInstanceId'),
    }
  ](name='Items'),
}

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

async function describeDataBackupsWithOptions(request: DescribeDataBackupsRequest, runtime: Util.RuntimeOptions): DescribeDataBackupsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDataBackups', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDataBackups(request: DescribeDataBackupsRequest): DescribeDataBackupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDataBackupsWithOptions(request, runtime);
}

model DescribeDBClusterPerformanceRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  key?: string(name='Key'),
  startTime?: string(name='StartTime'),
  endTime?: string(name='EndTime'),
}

model DescribeDBClusterPerformanceResponseBody = {
  endTime?: string(name='EndTime'),
  startTime?: string(name='StartTime'),
  requestId?: string(name='RequestId'),
  DBClusterId?: string(name='DBClusterId'),
  performanceKeys?: [ 
    {
      name?: string(name='Name'),
      unit?: string(name='Unit'),
      series?: [ 
        {
          role?: string(name='Role'),
          name?: string(name='Name'),
          values?: [ 
            {
              point?: [ string ](name='Point'),
            }
          ](name='Values'),
        }
      ](name='Series'),
    }
  ](name='PerformanceKeys'),
}

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

async function describeDBClusterPerformanceWithOptions(request: DescribeDBClusterPerformanceRequest, runtime: Util.RuntimeOptions): DescribeDBClusterPerformanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBClusterPerformance', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBClusterPerformance(request: DescribeDBClusterPerformanceRequest): DescribeDBClusterPerformanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterPerformanceWithOptions(request, runtime);
}

model DescribeDBInstanceAttributeRequest {
  ownerId?: long(name='OwnerId'),
  DBInstanceId?: string(name='DBInstanceId'),
}

model DescribeDBInstanceAttributeResponseBody = {
  requestId?: string(name='RequestId'),
  items?: {
    DBInstanceAttribute?: [ 
    {
      vpcId?: string(name='VpcId'),
      creationTime?: string(name='CreationTime'),
      DBInstanceCpuCores?: int32(name='DBInstanceCpuCores'),
      segmentCounts?: int32(name='SegmentCounts'),
      storagePerNode?: int32(name='StoragePerNode'),
      DBInstanceMemory?: long(name='DBInstanceMemory'),
      hostType?: string(name='HostType'),
      payType?: string(name='PayType'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tag')
      }(name='Tags'),
      storageType?: string(name='StorageType'),
      availabilityValue?: string(name='AvailabilityValue'),
      readDelayTime?: string(name='ReadDelayTime'),
      cpuCoresPerNode?: int32(name='CpuCoresPerNode'),
      port?: string(name='Port'),
      connectionMode?: string(name='ConnectionMode'),
      lockMode?: string(name='LockMode'),
      engineVersion?: string(name='EngineVersion'),
      storageUnit?: string(name='StorageUnit'),
      memoryPerNode?: int32(name='MemoryPerNode'),
      connectionString?: string(name='ConnectionString'),
      instanceNetworkType?: string(name='InstanceNetworkType'),
      securityIPList?: string(name='SecurityIPList'),
      memoryUnit?: string(name='MemoryUnit'),
      DBInstanceClassType?: string(name='DBInstanceClassType'),
      DBInstanceDescription?: string(name='DBInstanceDescription'),
      DBInstanceGroupCount?: string(name='DBInstanceGroupCount'),
      expireTime?: string(name='ExpireTime'),
      DBInstanceNetType?: string(name='DBInstanceNetType'),
      maintainStartTime?: string(name='MaintainStartTime'),
      maintainEndTime?: string(name='MaintainEndTime'),
      lockReason?: string(name='LockReason'),
      DBInstanceStatus?: string(name='DBInstanceStatus'),
      regionId?: string(name='RegionId'),
      DBInstanceDiskMBPS?: long(name='DBInstanceDiskMBPS'),
      DBInstanceStorage?: long(name='DBInstanceStorage'),
      zoneId?: string(name='ZoneId'),
      maxConnections?: int32(name='MaxConnections'),
      DBInstanceId?: string(name='DBInstanceId'),
      DBInstanceClass?: string(name='DBInstanceClass'),
      engine?: string(name='Engine'),
      DBInstanceCategory?: string(name='DBInstanceCategory'),
    }
  ](name='DBInstanceAttribute')
  }(name='Items'),
}

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

async function describeDBInstanceAttributeWithOptions(request: DescribeDBInstanceAttributeRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceAttributeResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstanceAttribute', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstanceAttribute(request: DescribeDBInstanceAttributeRequest): DescribeDBInstanceAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceAttributeWithOptions(request, runtime);
}

model DescribeDBInstanceIPArrayListRequest {
  DBInstanceId?: string(name='DBInstanceId'),
}

model DescribeDBInstanceIPArrayListResponseBody = {
  requestId?: string(name='RequestId'),
  items?: {
    DBInstanceIPArray?: [ 
    {
      DBInstanceIPArrayAttribute?: string(name='DBInstanceIPArrayAttribute'),
      DBInstanceIPArrayName?: string(name='DBInstanceIPArrayName'),
      securityIPList?: string(name='SecurityIPList'),
    }
  ](name='DBInstanceIPArray')
  }(name='Items'),
}

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

async function describeDBInstanceIPArrayListWithOptions(request: DescribeDBInstanceIPArrayListRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceIPArrayListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstanceIPArrayList', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstanceIPArrayList(request: DescribeDBInstanceIPArrayListRequest): DescribeDBInstanceIPArrayListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceIPArrayListWithOptions(request, runtime);
}

model DescribeDBInstanceNetInfoRequest {
  DBInstanceId?: string(name='DBInstanceId'),
}

model DescribeDBInstanceNetInfoResponseBody = {
  requestId?: string(name='RequestId'),
  DBInstanceNetInfos?: {
    DBInstanceNetInfo?: [ 
    {
      vSwitchId?: string(name='VSwitchId'),
      connectionString?: string(name='ConnectionString'),
      IPType?: string(name='IPType'),
      port?: string(name='Port'),
      vpcInstanceId?: string(name='VpcInstanceId'),
      VPCId?: string(name='VPCId'),
      IPAddress?: string(name='IPAddress'),
      addressType?: string(name='AddressType'),
    }
  ](name='DBInstanceNetInfo')
  }(name='DBInstanceNetInfos'),
  instanceNetworkType?: string(name='InstanceNetworkType'),
}

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

async function describeDBInstanceNetInfoWithOptions(request: DescribeDBInstanceNetInfoRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceNetInfoResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstanceNetInfo', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstanceNetInfo(request: DescribeDBInstanceNetInfoRequest): DescribeDBInstanceNetInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceNetInfoWithOptions(request, runtime);
}

model DescribeDBInstanceOnECSAttributeRequest {
  ownerId?: long(name='OwnerId'),
  DBInstanceId?: string(name='DBInstanceId'),
}

model DescribeDBInstanceOnECSAttributeResponseBody = {
  requestId?: string(name='RequestId'),
  items?: {
    DBInstanceAttribute?: [ 
    {
      creationTime?: string(name='CreationTime'),
      vpcId?: string(name='VpcId'),
      encryptionType?: string(name='EncryptionType'),
      instanceDeployType?: string(name='InstanceDeployType'),
      payType?: string(name='PayType'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tag')
      }(name='Tags'),
      storageType?: string(name='StorageType'),
      connectionMode?: string(name='ConnectionMode'),
      port?: string(name='Port'),
      lockMode?: string(name='LockMode'),
      engineVersion?: string(name='EngineVersion'),
      memorySize?: int32(name='MemorySize'),
      segNodeNum?: int32(name='SegNodeNum'),
      connectionString?: string(name='ConnectionString'),
      instanceNetworkType?: string(name='InstanceNetworkType'),
      encryptionKey?: string(name='EncryptionKey'),
      DBInstanceDescription?: string(name='DBInstanceDescription'),
      cpuCores?: int32(name='CpuCores'),
      expireTime?: string(name='ExpireTime'),
      DBInstanceStatus?: string(name='DBInstanceStatus'),
      storageSize?: int32(name='StorageSize'),
      regionId?: string(name='RegionId'),
      vSwitchId?: string(name='VSwitchId'),
      zoneId?: string(name='ZoneId'),
      DBInstanceId?: string(name='DBInstanceId'),
      engine?: string(name='Engine'),
      DBInstanceClass?: string(name='DBInstanceClass'),
      supportRestore?: boolean(name='SupportRestore'),
      minorVersion?: string(name='MinorVersion'),
      masterNodeNum?: int32(name='MasterNodeNum'),
      DBInstanceCategory?: string(name='DBInstanceCategory'),
    }
  ](name='DBInstanceAttribute')
  }(name='Items'),
}

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

async function describeDBInstanceOnECSAttributeWithOptions(request: DescribeDBInstanceOnECSAttributeRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceOnECSAttributeResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstanceOnECSAttribute', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstanceOnECSAttribute(request: DescribeDBInstanceOnECSAttributeRequest): DescribeDBInstanceOnECSAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceOnECSAttributeWithOptions(request, runtime);
}

model DescribeDBInstancePerformanceRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  key?: string(name='Key'),
  startTime?: string(name='StartTime'),
  endTime?: string(name='EndTime'),
}

model DescribeDBInstancePerformanceResponseBody = {
  endTime?: string(name='EndTime'),
  startTime?: string(name='StartTime'),
  DBInstanceId?: string(name='DBInstanceId'),
  engine?: string(name='Engine'),
  requestId?: string(name='RequestId'),
  performanceKeys?: [ string ](name='PerformanceKeys'),
}

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

async function describeDBInstancePerformanceWithOptions(request: DescribeDBInstancePerformanceRequest, runtime: Util.RuntimeOptions): DescribeDBInstancePerformanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstancePerformance', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstancePerformance(request: DescribeDBInstancePerformanceRequest): DescribeDBInstancePerformanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstancePerformanceWithOptions(request, runtime);
}

model DescribeDBInstancesRequest {
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  DBInstanceDescription?: string(name='DBInstanceDescription'),
  instanceNetworkType?: string(name='InstanceNetworkType'),
  DBInstanceIds?: string(name='DBInstanceIds'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  instanceDeployTypes?: [ string ](name='InstanceDeployTypes'),
  DBInstanceStatuses?: [ string ](name='DBInstanceStatuses'),
  DBInstanceCategories?: [ string ](name='DBInstanceCategories'),
}

model DescribeDBInstancesShrinkRequest {
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  DBInstanceDescription?: string(name='DBInstanceDescription'),
  instanceNetworkType?: string(name='InstanceNetworkType'),
  DBInstanceIds?: string(name='DBInstanceIds'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  instanceDeployTypesShrink?: string(name='InstanceDeployTypes'),
  DBInstanceStatusesShrink?: string(name='DBInstanceStatuses'),
  DBInstanceCategoriesShrink?: string(name='DBInstanceCategories'),
}

model DescribeDBInstancesResponseBody = {
  totalRecordCount?: int32(name='TotalRecordCount'),
  pageRecordCount?: int32(name='PageRecordCount'),
  requestId?: string(name='RequestId'),
  pageNumber?: int32(name='PageNumber'),
  items?: {
    DBInstance?: [ 
    {
      vpcId?: string(name='VpcId'),
      expireTime?: string(name='ExpireTime'),
      DBInstanceNetType?: string(name='DBInstanceNetType'),
      instanceDeployType?: string(name='InstanceDeployType'),
      storageType?: string(name='StorageType'),
      createTime?: string(name='CreateTime'),
      payType?: string(name='PayType'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tag')
      }(name='Tags'),
      lockReason?: string(name='LockReason'),
      DBInstanceStatus?: string(name='DBInstanceStatus'),
      connectionMode?: string(name='ConnectionMode'),
      lockMode?: string(name='LockMode'),
      engineVersion?: string(name='EngineVersion'),
      regionId?: string(name='RegionId'),
      vSwitchId?: string(name='VSwitchId'),
      instanceNetworkType?: string(name='InstanceNetworkType'),
      zoneId?: string(name='ZoneId'),
      DBInstanceId?: string(name='DBInstanceId'),
      engine?: string(name='Engine'),
      DBInstanceDescription?: string(name='DBInstanceDescription'),
      segNodeNum?: string(name='SegNodeNum'),
      storageSize?: string(name='StorageSize'),
      masterNodeNum?: int32(name='MasterNodeNum'),
      DBInstanceCategory?: string(name='DBInstanceCategory'),
    }
  ](name='DBInstance')
  }(name='Items'),
}

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

async function describeDBInstancesWithOptions(tmpReq: DescribeDBInstancesRequest, runtime: Util.RuntimeOptions): DescribeDBInstancesResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeDBInstancesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.instanceDeployTypes)) {
    request.instanceDeployTypesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.instanceDeployTypes, 'InstanceDeployTypes', 'simple');
  }
  if (!Util.isUnset(tmpReq.DBInstanceStatuses)) {
    request.DBInstanceStatusesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.DBInstanceStatuses, 'DBInstanceStatuses', 'simple');
  }
  if (!Util.isUnset(tmpReq.DBInstanceCategories)) {
    request.DBInstanceCategoriesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.DBInstanceCategories, 'DBInstanceCategories', 'simple');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstances', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstances(request: DescribeDBInstancesRequest): DescribeDBInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstancesWithOptions(request, runtime);
}

model DescribeDBInstanceSQLPatternsRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  queryKeywords?: string(name='QueryKeywords'),
  startTime?: string(name='StartTime'),
  database?: string(name='Database'),
  user?: string(name='User'),
  endTime?: string(name='EndTime'),
  sourceIP?: string(name='SourceIP'),
}

model DescribeDBInstanceSQLPatternsResponseBody = {
  endTime?: string(name='EndTime'),
  requestId?: string(name='RequestId'),
  startTime?: string(name='StartTime'),
  DBClusterId?: string(name='DBClusterId'),
  patterns?: [ 
    {
      name?: string(name='Name'),
      values?: map[string]any(name='Values'),
    }
  ](name='Patterns'),
}

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

async function describeDBInstanceSQLPatternsWithOptions(request: DescribeDBInstanceSQLPatternsRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceSQLPatternsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstanceSQLPatterns', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstanceSQLPatterns(request: DescribeDBInstanceSQLPatternsRequest): DescribeDBInstanceSQLPatternsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceSQLPatternsWithOptions(request, runtime);
}

model DescribeDBInstanceSSLRequest {
  DBInstanceId?: string(name='DBInstanceId'),
}

model DescribeDBInstanceSSLResponseBody = {
  DBInstanceName?: string(name='DBInstanceName'),
  requestId?: string(name='RequestId'),
  SSLEnabled?: boolean(name='SSLEnabled'),
  DBInstanceId?: string(name='DBInstanceId'),
  certCommonName?: string(name='CertCommonName'),
  SSLExpiredTime?: string(name='SSLExpiredTime'),
}

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

async function describeDBInstanceSSLWithOptions(request: DescribeDBInstanceSSLRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceSSLResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstanceSSL', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstanceSSL(request: DescribeDBInstanceSSLRequest): DescribeDBInstanceSSLResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceSSLWithOptions(request, runtime);
}

model DescribeLogBackupsRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  startTime?: string(name='StartTime'),
  endTime?: string(name='EndTime'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
}

model DescribeLogBackupsResponseBody = {
  totalLogSize?: long(name='TotalLogSize'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
  items?: [ 
    {
      logFileSize?: long(name='LogFileSize'),
      logTime?: string(name='LogTime'),
      segmentName?: string(name='SegmentName'),
      logFileName?: string(name='LogFileName'),
      DBInstanceId?: string(name='DBInstanceId'),
      backupId?: string(name='BackupId'),
    }
  ](name='Items'),
}

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

async function describeLogBackupsWithOptions(request: DescribeLogBackupsRequest, runtime: Util.RuntimeOptions): DescribeLogBackupsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeLogBackups', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeLogBackups(request: DescribeLogBackupsRequest): DescribeLogBackupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLogBackupsWithOptions(request, runtime);
}

model DescribeModifyParameterLogRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  startTime?: string(name='StartTime'),
  endTime?: string(name='EndTime'),
}

model DescribeModifyParameterLogResponseBody = {
  requestId?: string(name='RequestId'),
  changelogs?: [ 
    {
      parameterValueAfter?: string(name='ParameterValueAfter'),
      parameterValueBefore?: string(name='ParameterValueBefore'),
      parameterName?: string(name='ParameterName'),
      parameterValid?: string(name='ParameterValid'),
      effectTime?: string(name='EffectTime'),
    }
  ](name='Changelogs'),
}

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

async function describeModifyParameterLogWithOptions(request: DescribeModifyParameterLogRequest, runtime: Util.RuntimeOptions): DescribeModifyParameterLogResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeModifyParameterLog', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeModifyParameterLog(request: DescribeModifyParameterLogRequest): DescribeModifyParameterLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeModifyParameterLogWithOptions(request, runtime);
}

model DescribeParametersRequest {
  DBInstanceId?: string(name='DBInstanceId'),
}

model DescribeParametersResponseBody = {
  requestId?: string(name='RequestId'),
  parameters?: [ 
    {
      isChangeableConfig?: string(name='IsChangeableConfig'),
      forceRestartInstance?: string(name='ForceRestartInstance'),
      optionalRange?: string(name='OptionalRange'),
      parameterName?: string(name='ParameterName'),
      parameterValue?: string(name='ParameterValue'),
      parameterDescription?: string(name='ParameterDescription'),
      currentValue?: string(name='CurrentValue'),
    }
  ](name='Parameters'),
}

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

async function describeParametersWithOptions(request: DescribeParametersRequest, runtime: Util.RuntimeOptions): DescribeParametersResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeParameters', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeParameters(request: DescribeParametersRequest): DescribeParametersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeParametersWithOptions(request, runtime);
}

model DescribeRdsVpcsRequest {
  securityToken?: string(name='SecurityToken'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ownerAccount?: string(name='OwnerAccount'),
  regionId?: string(name='RegionId'),
  zoneId?: string(name='ZoneId'),
}

model DescribeRdsVpcsResponseBody = {
  vpcs?: {
    vpc?: [ 
      {
        status?: string(name='Status'),
        vpcName?: string(name='VpcName'),
        vpcId?: string(name='VpcId'),
        isDefault?: boolean(name='IsDefault'),
        cidrBlock?: string(name='CidrBlock'),
        regionNo?: string(name='RegionNo'),
        gmtCreate?: string(name='GmtCreate'),
        aliUid?: string(name='AliUid'),
        vSwitchs?: [ 
          {
            status?: string(name='Status'),
            vSwitchId?: string(name='VSwitchId'),
            isDefault?: boolean(name='IsDefault'),
            cidrBlock?: string(name='CidrBlock'),
            gmtCreate?: string(name='GmtCreate'),
            gmtModified?: string(name='GmtModified'),
            izNo?: string(name='IzNo'),
            vSwitchName?: string(name='VSwitchName'),
          }
        ](name='VSwitchs'),
        gmtModified?: string(name='GmtModified'),
        bid?: string(name='Bid'),
      }
    ](name='Vpc'),
  }(name='Vpcs'),
  requestId?: string(name='RequestId'),
}

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

async function describeRdsVpcsWithOptions(request: DescribeRdsVpcsRequest, runtime: Util.RuntimeOptions): DescribeRdsVpcsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeRdsVpcs', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeRdsVpcs(request: DescribeRdsVpcsRequest): DescribeRdsVpcsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRdsVpcsWithOptions(request, runtime);
}

model DescribeRdsVSwitchsRequest {
  securityToken?: string(name='SecurityToken'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ownerAccount?: string(name='OwnerAccount'),
  regionId?: string(name='RegionId'),
  vpcId?: string(name='VpcId'),
  zoneId?: string(name='ZoneId'),
}

model DescribeRdsVSwitchsResponseBody = {
  requestId?: string(name='RequestId'),
  vSwitches?: {
    vSwitch?: [ 
      {
        status?: string(name='Status'),
        isDefault?: boolean(name='IsDefault'),
        vSwitchId?: string(name='VSwitchId'),
        cidrBlock?: string(name='CidrBlock'),
        regionNo?: string(name='RegionNo'),
        gmtCreate?: string(name='GmtCreate'),
        aliUid?: string(name='AliUid'),
        gmtModified?: string(name='GmtModified'),
        bid?: string(name='Bid'),
        izNo?: string(name='IzNo'),
        vSwitchName?: string(name='VSwitchName'),
      }
    ](name='VSwitch'),
  }(name='VSwitches'),
}

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

async function describeRdsVSwitchsWithOptions(request: DescribeRdsVSwitchsRequest, runtime: Util.RuntimeOptions): DescribeRdsVSwitchsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeRdsVSwitchs', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeRdsVSwitchs(request: DescribeRdsVSwitchsRequest): DescribeRdsVSwitchsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRdsVSwitchsWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  region?: string(name='Region'),
}

model DescribeRegionsResponseBody = {
  requestId?: string(name='RequestId'),
  regions?: {
    region?: [ 
    {
      regionId?: string(name='RegionId'),
      zones?: {
        zone?: [ 
        {
          zoneId?: string(name='ZoneId'),
          vpcEnabled?: boolean(name='VpcEnabled'),
        }
      ](name='Zone')
      }(name='Zones'),
    }
  ](name='Region')
  }(name='Regions'),
}

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

async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeRegions', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeResourceUsageRequest {
  DBInstanceId?: string(name='DBInstanceId'),
}

model DescribeResourceUsageResponseBody = {
  diskUsed?: long(name='DiskUsed'),
  dataSize?: long(name='DataSize'),
  requestId?: string(name='RequestId'),
  backupSize?: long(name='BackupSize'),
  logSize?: long(name='LogSize'),
  DBInstanceId?: string(name='DBInstanceId'),
  engine?: string(name='Engine'),
}

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

async function describeResourceUsageWithOptions(request: DescribeResourceUsageRequest, runtime: Util.RuntimeOptions): DescribeResourceUsageResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeResourceUsage', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeResourceUsage(request: DescribeResourceUsageRequest): DescribeResourceUsageResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourceUsageWithOptions(request, runtime);
}

model DescribeSlowLogRecordsRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  SQLId?: long(name='SQLId'),
  startTime?: string(name='StartTime'),
  endTime?: string(name='EndTime'),
  DBName?: string(name='DBName'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
}

model DescribeSlowLogRecordsResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  engine?: string(name='Engine'),
  requestId?: string(name='RequestId'),
  pageRecordCount?: int32(name='PageRecordCount'),
  totalRecordCount?: int32(name='TotalRecordCount'),
  items?: {
    SQLSlowRecord?: [ 
    {
      executionStartTime?: string(name='ExecutionStartTime'),
      hostAddress?: string(name='HostAddress'),
      queryTimes?: long(name='QueryTimes'),
      SQLText?: string(name='SQLText'),
      returnRowCounts?: long(name='ReturnRowCounts'),
      parseRowCounts?: long(name='ParseRowCounts'),
      DBName?: string(name='DBName'),
      lockTimes?: long(name='LockTimes'),
    }
  ](name='SQLSlowRecord')
  }(name='Items'),
}

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

async function describeSlowLogRecordsWithOptions(request: DescribeSlowLogRecordsRequest, runtime: Util.RuntimeOptions): DescribeSlowLogRecordsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeSlowLogRecords', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeSlowLogRecords(request: DescribeSlowLogRecordsRequest): DescribeSlowLogRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSlowLogRecordsWithOptions(request, runtime);
}

model DescribeSlowSQLLogsRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  queryKeywords?: string(name='QueryKeywords'),
  startTime?: string(name='StartTime'),
  database?: string(name='Database'),
  user?: string(name='User'),
  endTime?: string(name='EndTime'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
  sourceIP?: string(name='SourceIP'),
  executeState?: string(name='ExecuteState'),
  operationClass?: string(name='OperationClass'),
  operationType?: string(name='OperationType'),
  minExecuteCost?: string(name='MinExecuteCost'),
  maxExecuteCost?: string(name='MaxExecuteCost'),
}

model DescribeSlowSQLLogsResponseBody = {
  pageRecordCount?: int32(name='PageRecordCount'),
  requestId?: string(name='RequestId'),
  pageNumber?: int32(name='PageNumber'),
  items?: [ 
    {
      operationClass?: string(name='OperationClass'),
      executeState?: string(name='ExecuteState'),
      executeCost?: float(name='ExecuteCost'),
      SQLText?: string(name='SQLText'),
      sourcePort?: int32(name='SourcePort'),
      DBRole?: string(name='DBRole'),
      operationType?: string(name='OperationType'),
      sourceIP?: string(name='SourceIP'),
      SQLPlan?: string(name='SQLPlan'),
      returnRowCounts?: long(name='ReturnRowCounts'),
      DBName?: string(name='DBName'),
      operationExecuteTime?: string(name='OperationExecuteTime'),
      scanRowCounts?: long(name='ScanRowCounts'),
      accountName?: string(name='AccountName'),
      queryId?: string(name='QueryId'),
    }
  ](name='Items'),
}

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

async function describeSlowSQLLogsWithOptions(request: DescribeSlowSQLLogsRequest, runtime: Util.RuntimeOptions): DescribeSlowSQLLogsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeSlowSQLLogs', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeSlowSQLLogs(request: DescribeSlowSQLLogsRequest): DescribeSlowSQLLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSlowSQLLogsWithOptions(request, runtime);
}

model DescribeSpecificationRequest {
  ownerId?: long(name='OwnerId'),
  DBInstanceId?: string(name='DBInstanceId'),
  storageType?: string(name='StorageType'),
  cpuCores?: int32(name='CpuCores'),
  totalNodeNum?: int32(name='TotalNodeNum'),
}

model DescribeSpecificationResponseBody = {
  requestId?: string(name='RequestId'),
  DBInstanceClass?: [ 
    {
      value?: string(name='Value'),
      text?: string(name='Text'),
    }
  ](name='DBInstanceClass'),
  DBInstanceGroupCount?: [ 
    {
      value?: string(name='Value'),
      text?: string(name='Text'),
    }
  ](name='DBInstanceGroupCount'),
  storageNotice?: [ 
    {
      value?: string(name='Value'),
      text?: string(name='Text'),
    }
  ](name='StorageNotice'),
}

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

async function describeSpecificationWithOptions(request: DescribeSpecificationRequest, runtime: Util.RuntimeOptions): DescribeSpecificationResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeSpecification', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeSpecification(request: DescribeSpecificationRequest): DescribeSpecificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSpecificationWithOptions(request, runtime);
}

model DescribeSQLCollectorPolicyRequest {
  DBInstanceId?: string(name='DBInstanceId'),
}

model DescribeSQLCollectorPolicyResponseBody = {
  SQLCollectorStatus?: string(name='SQLCollectorStatus'),
  requestId?: string(name='RequestId'),
}

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

async function describeSQLCollectorPolicyWithOptions(request: DescribeSQLCollectorPolicyRequest, runtime: Util.RuntimeOptions): DescribeSQLCollectorPolicyResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeSQLCollectorPolicy', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeSQLCollectorPolicy(request: DescribeSQLCollectorPolicyRequest): DescribeSQLCollectorPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLCollectorPolicyWithOptions(request, runtime);
}

model DescribeSQLLogByQueryIdRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  queryId?: string(name='QueryId'),
}

model DescribeSQLLogByQueryIdResponseBody = {
  requestId?: string(name='RequestId'),
  items?: [ 
    {
      operationClass?: string(name='OperationClass'),
      executeState?: string(name='ExecuteState'),
      executeCost?: float(name='ExecuteCost'),
      SQLText?: string(name='SQLText'),
      sourcePort?: int32(name='SourcePort'),
      DBRole?: string(name='DBRole'),
      operationType?: string(name='OperationType'),
      sourceIP?: string(name='SourceIP'),
      SQLPlan?: string(name='SQLPlan'),
      returnRowCounts?: long(name='ReturnRowCounts'),
      DBName?: string(name='DBName'),
      operationExecuteTime?: string(name='OperationExecuteTime'),
      scanRowCounts?: long(name='ScanRowCounts'),
      accountName?: string(name='AccountName'),
      queryId?: string(name='QueryId'),
      sliceIds?: [ string ](name='SliceIds'),
    }
  ](name='Items'),
}

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

async function describeSQLLogByQueryIdWithOptions(request: DescribeSQLLogByQueryIdRequest, runtime: Util.RuntimeOptions): DescribeSQLLogByQueryIdResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeSQLLogByQueryId', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeSQLLogByQueryId(request: DescribeSQLLogByQueryIdRequest): DescribeSQLLogByQueryIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLLogByQueryIdWithOptions(request, runtime);
}

model DescribeSQLLogCountRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  queryKeywords?: string(name='QueryKeywords'),
  startTime?: string(name='StartTime'),
  database?: string(name='Database'),
  user?: string(name='User'),
  endTime?: string(name='EndTime'),
  executeCost?: string(name='ExecuteCost'),
  sourceIP?: string(name='SourceIP'),
  executeState?: string(name='ExecuteState'),
  operationClass?: string(name='OperationClass'),
  operationType?: string(name='OperationType'),
  maxExecuteCost?: string(name='MaxExecuteCost'),
  minExecuteCost?: string(name='MinExecuteCost'),
}

model DescribeSQLLogCountResponseBody = {
  endTime?: string(name='EndTime'),
  requestId?: string(name='RequestId'),
  startTime?: string(name='StartTime'),
  DBClusterId?: string(name='DBClusterId'),
  items?: [ 
    {
      series?: [ 
        {
          values?: [ 
            {
              point?: [ string ](name='Point'),
            }
          ](name='Values'),
        }
      ](name='Series'),
      name?: string(name='Name'),
    }
  ](name='Items'),
}

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

async function describeSQLLogCountWithOptions(request: DescribeSQLLogCountRequest, runtime: Util.RuntimeOptions): DescribeSQLLogCountResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeSQLLogCount', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeSQLLogCount(request: DescribeSQLLogCountRequest): DescribeSQLLogCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLLogCountWithOptions(request, runtime);
}

model DescribeSQLLogFilesRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  fileName?: string(name='FileName'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
}

model DescribeSQLLogFilesResponseBody = {
  requestId?: string(name='RequestId'),
  pageNumber?: int32(name='PageNumber'),
  pageRecordCount?: int32(name='PageRecordCount'),
  totalRecordCount?: int32(name='TotalRecordCount'),
  items?: {
    logFile?: [ 
    {
      fileID?: string(name='FileID'),
      logStartTime?: string(name='LogStartTime'),
      logSize?: string(name='LogSize'),
      logDownloadURL?: string(name='LogDownloadURL'),
      logEndTime?: string(name='LogEndTime'),
      logStatus?: string(name='LogStatus'),
    }
  ](name='LogFile')
  }(name='Items'),
}

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

async function describeSQLLogFilesWithOptions(request: DescribeSQLLogFilesRequest, runtime: Util.RuntimeOptions): DescribeSQLLogFilesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeSQLLogFiles', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeSQLLogFiles(request: DescribeSQLLogFilesRequest): DescribeSQLLogFilesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLLogFilesWithOptions(request, runtime);
}

model DescribeSQLLogRecordsRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  queryKeywords?: string(name='QueryKeywords'),
  startTime?: string(name='StartTime'),
  database?: string(name='Database'),
  user?: string(name='User'),
  form?: string(name='Form'),
  endTime?: string(name='EndTime'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
}

model DescribeSQLLogRecordsResponseBody = {
  requestId?: string(name='RequestId'),
  pageNumber?: int32(name='PageNumber'),
  pageRecordCount?: int32(name='PageRecordCount'),
  totalRecordCount?: int32(name='TotalRecordCount'),
  items?: {
    SQLRecord?: [ 
    {
      hostAddress?: string(name='HostAddress'),
      SQLText?: string(name='SQLText'),
      returnRowCounts?: long(name='ReturnRowCounts'),
      DBName?: string(name='DBName'),
      executeTime?: string(name='ExecuteTime'),
      threadID?: string(name='ThreadID'),
      totalExecutionTimes?: long(name='TotalExecutionTimes'),
      accountName?: string(name='AccountName'),
    }
  ](name='SQLRecord')
  }(name='Items'),
}

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

async function describeSQLLogRecordsWithOptions(request: DescribeSQLLogRecordsRequest, runtime: Util.RuntimeOptions): DescribeSQLLogRecordsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeSQLLogRecords', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeSQLLogRecords(request: DescribeSQLLogRecordsRequest): DescribeSQLLogRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLLogRecordsWithOptions(request, runtime);
}

model DescribeSQLLogsRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  queryKeywords?: string(name='QueryKeywords'),
  startTime?: string(name='StartTime'),
  database?: string(name='Database'),
  user?: string(name='User'),
  endTime?: string(name='EndTime'),
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
  executeCost?: string(name='ExecuteCost'),
  sourceIP?: string(name='SourceIP'),
  executeState?: string(name='ExecuteState'),
  operationClass?: string(name='OperationClass'),
  operationType?: string(name='OperationType'),
  maxExecuteCost?: string(name='MaxExecuteCost'),
  minExecuteCost?: string(name='MinExecuteCost'),
}

model DescribeSQLLogsResponseBody = {
  pageRecordCount?: int32(name='PageRecordCount'),
  requestId?: string(name='RequestId'),
  pageNumber?: int32(name='PageNumber'),
  items?: [ 
    {
      operationClass?: string(name='OperationClass'),
      executeState?: string(name='ExecuteState'),
      executeCost?: float(name='ExecuteCost'),
      SQLText?: string(name='SQLText'),
      sourcePort?: int32(name='SourcePort'),
      DBRole?: string(name='DBRole'),
      operationType?: string(name='OperationType'),
      sourceIP?: string(name='SourceIP'),
      SQLPlan?: string(name='SQLPlan'),
      returnRowCounts?: long(name='ReturnRowCounts'),
      DBName?: string(name='DBName'),
      operationExecuteTime?: string(name='OperationExecuteTime'),
      scanRowCounts?: long(name='ScanRowCounts'),
      accountName?: string(name='AccountName'),
    }
  ](name='Items'),
}

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

async function describeSQLLogsWithOptions(request: DescribeSQLLogsRequest, runtime: Util.RuntimeOptions): DescribeSQLLogsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeSQLLogs', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeSQLLogs(request: DescribeSQLLogsRequest): DescribeSQLLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLLogsWithOptions(request, runtime);
}

model DescribeSQLLogsOnSliceRequest {
  pageSize?: int32(name='PageSize'),
  pageNumber?: int32(name='PageNumber'),
  maxExecuteCost?: string(name='MaxExecuteCost'),
  minExecuteCost?: string(name='MinExecuteCost'),
  executeState?: string(name='ExecuteState'),
  DBInstanceId?: string(name='DBInstanceId'),
  queryId?: string(name='QueryId'),
  sliceId?: string(name='SliceId'),
}

model DescribeSQLLogsOnSliceResponseBody = {
  requestId?: string(name='RequestId'),
  pageRecordCount?: int32(name='PageRecordCount'),
  pageNumber?: int32(name='PageNumber'),
  sliceLogItems?: [ 
    {
      executeStatus?: string(name='ExecuteStatus'),
      executeCost?: float(name='ExecuteCost'),
      returnRowCounts?: long(name='ReturnRowCounts'),
      operationExecuteTime?: string(name='OperationExecuteTime'),
      segmentId?: string(name='SegmentId'),
      peakMemory?: float(name='PeakMemory'),
      operationExecuteEndTime?: string(name='OperationExecuteEndTime'),
      segmentName?: string(name='SegmentName'),
    }
  ](name='SliceLogItems'),
}

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

async function describeSQLLogsOnSliceWithOptions(request: DescribeSQLLogsOnSliceRequest, runtime: Util.RuntimeOptions): DescribeSQLLogsOnSliceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeSQLLogsOnSlice', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeSQLLogsOnSlice(request: DescribeSQLLogsOnSliceRequest): DescribeSQLLogsOnSliceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLLogsOnSliceWithOptions(request, runtime);
}

model DescribeTagsRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ownerAccount?: string(name='OwnerAccount'),
  regionId?: string(name='RegionId'),
  resourceType?: string(name='ResourceType'),
}

model DescribeTagsResponseBody = {
  requestId?: string(name='RequestId'),
  tags?: [ 
    {
      tagValue?: string(name='TagValue'),
      tagKey?: string(name='TagKey'),
    }
  ](name='Tags'),
}

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

async function describeTagsWithOptions(request: DescribeTagsRequest, runtime: Util.RuntimeOptions): DescribeTagsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeTags', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeTags(request: DescribeTagsRequest): DescribeTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTagsWithOptions(request, runtime);
}

model DescribeUserEncryptionKeyListRequest {
  regionId?: string(name='RegionId'),
  pageNumber?: string(name='PageNumber'),
  pageSize?: string(name='PageSize'),
}

model DescribeUserEncryptionKeyListResponseBody = {
  requestId?: string(name='RequestId'),
  kmsKeys?: [ 
    {
      keyId?: string(name='KeyId'),
    }
  ](name='KmsKeys'),
}

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

async function describeUserEncryptionKeyListWithOptions(request: DescribeUserEncryptionKeyListRequest, runtime: Util.RuntimeOptions): DescribeUserEncryptionKeyListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeUserEncryptionKeyList', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeUserEncryptionKeyList(request: DescribeUserEncryptionKeyListRequest): DescribeUserEncryptionKeyListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUserEncryptionKeyListWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ownerAccount?: string(name='OwnerAccount'),
  regionId?: string(name='RegionId'),
  resourceType?: string(name='ResourceType'),
  nextToken?: string(name='NextToken'),
  resourceId?: [ string ](name='ResourceId'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceType?: string(name='ResourceType'),
      tagValue?: string(name='TagValue'),
      resourceId?: string(name='ResourceId'),
      tagKey?: string(name='TagKey'),
    }
  ](name='TagResource')
  }(name='TagResources'),
}

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

async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListTagResources', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model ModifyAccountDescriptionRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  accountName?: string(name='AccountName'),
  accountDescription?: string(name='AccountDescription'),
}

model ModifyAccountDescriptionResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function modifyAccountDescriptionWithOptions(request: ModifyAccountDescriptionRequest, runtime: Util.RuntimeOptions): ModifyAccountDescriptionResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyAccountDescription', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyAccountDescription(request: ModifyAccountDescriptionRequest): ModifyAccountDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAccountDescriptionWithOptions(request, runtime);
}

model ModifyBackupPolicyRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  preferredBackupTime?: string(name='PreferredBackupTime'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod'),
  backupRetentionPeriod?: int32(name='BackupRetentionPeriod'),
  enableRecoveryPoint?: boolean(name='EnableRecoveryPoint'),
  recoveryPointPeriod?: string(name='RecoveryPointPeriod'),
}

model ModifyBackupPolicyResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function modifyBackupPolicyWithOptions(request: ModifyBackupPolicyRequest, runtime: Util.RuntimeOptions): ModifyBackupPolicyResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyBackupPolicy', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyBackupPolicy(request: ModifyBackupPolicyRequest): ModifyBackupPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyBackupPolicyWithOptions(request, runtime);
}

model ModifyDBInstanceConnectionModeRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  connectionMode?: string(name='ConnectionMode'),
}

model ModifyDBInstanceConnectionModeResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function modifyDBInstanceConnectionModeWithOptions(request: ModifyDBInstanceConnectionModeRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceConnectionModeResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyDBInstanceConnectionMode', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyDBInstanceConnectionMode(request: ModifyDBInstanceConnectionModeRequest): ModifyDBInstanceConnectionModeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceConnectionModeWithOptions(request, runtime);
}

model ModifyDBInstanceConnectionStringRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  connectionStringPrefix?: string(name='ConnectionStringPrefix'),
  port?: string(name='Port'),
  currentConnectionString?: string(name='CurrentConnectionString'),
}

model ModifyDBInstanceConnectionStringResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function modifyDBInstanceConnectionStringWithOptions(request: ModifyDBInstanceConnectionStringRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceConnectionStringResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyDBInstanceConnectionString', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyDBInstanceConnectionString(request: ModifyDBInstanceConnectionStringRequest): ModifyDBInstanceConnectionStringResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceConnectionStringWithOptions(request, runtime);
}

model ModifyDBInstanceDescriptionRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  DBInstanceDescription?: string(name='DBInstanceDescription'),
}

model ModifyDBInstanceDescriptionResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function modifyDBInstanceDescriptionWithOptions(request: ModifyDBInstanceDescriptionRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceDescriptionResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyDBInstanceDescription', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyDBInstanceDescription(request: ModifyDBInstanceDescriptionRequest): ModifyDBInstanceDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceDescriptionWithOptions(request, runtime);
}

model ModifyDBInstanceMaintainTimeRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  startTime?: string(name='StartTime'),
  endTime?: string(name='EndTime'),
}

model ModifyDBInstanceMaintainTimeResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function modifyDBInstanceMaintainTimeWithOptions(request: ModifyDBInstanceMaintainTimeRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceMaintainTimeResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyDBInstanceMaintainTime', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyDBInstanceMaintainTime(request: ModifyDBInstanceMaintainTimeRequest): ModifyDBInstanceMaintainTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceMaintainTimeWithOptions(request, runtime);
}

model ModifyDBInstanceNetworkTypeRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  instanceNetworkType?: string(name='InstanceNetworkType'),
  VPCId?: string(name='VPCId'),
  vSwitchId?: string(name='VSwitchId'),
  privateIpAddress?: string(name='PrivateIpAddress'),
}

model ModifyDBInstanceNetworkTypeResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function modifyDBInstanceNetworkTypeWithOptions(request: ModifyDBInstanceNetworkTypeRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceNetworkTypeResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyDBInstanceNetworkType', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyDBInstanceNetworkType(request: ModifyDBInstanceNetworkTypeRequest): ModifyDBInstanceNetworkTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceNetworkTypeWithOptions(request, runtime);
}

model ModifyDBInstanceSSLRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  connectionString?: string(name='ConnectionString'),
  SSLEnabled?: int32(name='SSLEnabled'),
}

model ModifyDBInstanceSSLResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function modifyDBInstanceSSLWithOptions(request: ModifyDBInstanceSSLRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceSSLResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyDBInstanceSSL', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyDBInstanceSSL(request: ModifyDBInstanceSSLRequest): ModifyDBInstanceSSLResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceSSLWithOptions(request, runtime);
}

model ModifyParametersRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  parameters?: string(name='Parameters'),
  forceRestartInstance?: boolean(name='ForceRestartInstance'),
}

model ModifyParametersResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function modifyParametersWithOptions(request: ModifyParametersRequest, runtime: Util.RuntimeOptions): ModifyParametersResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyParameters', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyParameters(request: ModifyParametersRequest): ModifyParametersResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyParametersWithOptions(request, runtime);
}

model ModifySecurityIpsRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  securityIPList?: string(name='SecurityIPList'),
  DBInstanceIPArrayName?: string(name='DBInstanceIPArrayName'),
  DBInstanceIPArrayAttribute?: string(name='DBInstanceIPArrayAttribute'),
}

model ModifySecurityIpsResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function modifySecurityIpsWithOptions(request: ModifySecurityIpsRequest, runtime: Util.RuntimeOptions): ModifySecurityIpsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifySecurityIps', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifySecurityIps(request: ModifySecurityIpsRequest): ModifySecurityIpsResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySecurityIpsWithOptions(request, runtime);
}

model ModifySQLCollectorPolicyRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  SQLCollectorStatus?: string(name='SQLCollectorStatus'),
}

model ModifySQLCollectorPolicyResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function modifySQLCollectorPolicyWithOptions(request: ModifySQLCollectorPolicyRequest, runtime: Util.RuntimeOptions): ModifySQLCollectorPolicyResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifySQLCollectorPolicy', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifySQLCollectorPolicy(request: ModifySQLCollectorPolicyRequest): ModifySQLCollectorPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySQLCollectorPolicyWithOptions(request, runtime);
}

model ReleaseInstancePublicConnectionRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  currentConnectionString?: string(name='CurrentConnectionString'),
  addressType?: string(name='AddressType'),
}

model ReleaseInstancePublicConnectionResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function releaseInstancePublicConnectionWithOptions(request: ReleaseInstancePublicConnectionRequest, runtime: Util.RuntimeOptions): ReleaseInstancePublicConnectionResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ReleaseInstancePublicConnection', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function releaseInstancePublicConnection(request: ReleaseInstancePublicConnectionRequest): ReleaseInstancePublicConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseInstancePublicConnectionWithOptions(request, runtime);
}

model ResetAccountPasswordRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  accountName?: string(name='AccountName'),
  accountPassword?: string(name='AccountPassword'),
}

model ResetAccountPasswordResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function resetAccountPasswordWithOptions(request: ResetAccountPasswordRequest, runtime: Util.RuntimeOptions): ResetAccountPasswordResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ResetAccountPassword', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function resetAccountPassword(request: ResetAccountPasswordRequest): ResetAccountPasswordResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetAccountPasswordWithOptions(request, runtime);
}

model RestartDBInstanceRequest {
  clientToken?: string(name='ClientToken'),
  DBInstanceId?: string(name='DBInstanceId'),
}

model RestartDBInstanceResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function restartDBInstanceWithOptions(request: RestartDBInstanceRequest, runtime: Util.RuntimeOptions): RestartDBInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RestartDBInstance', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function restartDBInstance(request: RestartDBInstanceRequest): RestartDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return restartDBInstanceWithOptions(request, runtime);
}

model SwitchDBInstanceNetTypeRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  connectionStringPrefix?: string(name='ConnectionStringPrefix'),
  port?: string(name='Port'),
}

model SwitchDBInstanceNetTypeResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function switchDBInstanceNetTypeWithOptions(request: SwitchDBInstanceNetTypeRequest, runtime: Util.RuntimeOptions): SwitchDBInstanceNetTypeResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('SwitchDBInstanceNetType', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function switchDBInstanceNetType(request: SwitchDBInstanceNetTypeRequest): SwitchDBInstanceNetTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return switchDBInstanceNetTypeWithOptions(request, runtime);
}

model TagResourcesRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ownerAccount?: string(name='OwnerAccount'),
  regionId?: string(name='RegionId'),
  resourceType?: string(name='ResourceType'),
  resourceId?: [ string ](name='ResourceId'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('TagResources', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ownerAccount?: string(name='OwnerAccount'),
  regionId?: string(name='RegionId'),
  resourceType?: string(name='ResourceType'),
  all?: boolean(name='All'),
  resourceId?: [ string ](name='ResourceId'),
  tagKey?: [ string ](name='TagKey'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId'),
}

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

async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UntagResources', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpgradeDBInstanceRequest {
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  DBInstanceClass?: string(name='DBInstanceClass'),
  DBInstanceGroupCount?: string(name='DBInstanceGroupCount'),
  DBInstanceId?: string(name='DBInstanceId'),
  payType?: string(name='PayType'),
}

model UpgradeDBInstanceResponseBody = {
  DBInstanceId?: string(name='DBInstanceId'),
  requestId?: string(name='RequestId'),
  orderId?: string(name='OrderId'),
}

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

async function upgradeDBInstanceWithOptions(request: UpgradeDBInstanceRequest, runtime: Util.RuntimeOptions): UpgradeDBInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpgradeDBInstance', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function upgradeDBInstance(request: UpgradeDBInstanceRequest): UpgradeDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeDBInstanceWithOptions(request, runtime);
}

model UpgradeDBVersionRequest {
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  DBInstanceId?: string(name='DBInstanceId'),
  minorVersion?: string(name='MinorVersion'),
  majorVersion?: string(name='MajorVersion'),
  switchTimeMode?: string(name='SwitchTimeMode'),
  switchTime?: string(name='SwitchTime'),
}

model UpgradeDBVersionResponseBody = {
  DBInstanceName?: string(name='DBInstanceName'),
  DBInstanceId?: string(name='DBInstanceId'),
  requestId?: string(name='RequestId'),
  taskId?: string(name='TaskId'),
}

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

async function upgradeDBVersionWithOptions(request: UpgradeDBVersionRequest, runtime: Util.RuntimeOptions): UpgradeDBVersionResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpgradeDBVersion', '2016-05-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function upgradeDBVersion(request: UpgradeDBVersionRequest): UpgradeDBVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeDBVersionWithOptions(request, runtime);
}

