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

import EndpointUtil;

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
@endpointMap = {
    cn-qingdao = 'dbs-api.cn-hangzhou.aliyuncs.com',
    cn-beijing = 'dbs-api.cn-hangzhou.aliyuncs.com',
    cn-chengdu = 'dbs-api.cn-chengdu.aliyuncs.com',
    cn-zhangjiakou = 'dbs-api.cn-hangzhou.aliyuncs.com',
    cn-huhehaote = 'dbs-api.cn-huhehaote.aliyuncs.com',
    cn-hangzhou = 'dbs-api.cn-hangzhou.aliyuncs.com',
    cn-shanghai = 'dbs-api.cn-hangzhou.aliyuncs.com',
    cn-shenzhen = 'dbs-api.cn-hangzhou.aliyuncs.com',
    cn-hongkong = 'dbs-api.cn-hangzhou.aliyuncs.com',
    ap-southeast-1 = 'dbs-api.ap-southeast-1.aliyuncs.com',
    ap-southeast-2 = 'dbs-api.ap-southeast-2.aliyuncs.com',
    ap-southeast-3 = 'dbs-api.ap-southeast-3.aliyuncs.com',
    ap-southeast-5 = 'dbs-api.ap-southeast-5.aliyuncs.com',
    ap-northeast-1 = 'dbs-api.ap-northeast-1.aliyuncs.com',
    us-west-1 = 'dbs-api.cn-hangzhou.aliyuncs.com',
    us-east-1 = 'dbs-api.cn-hangzhou.aliyuncs.com',
    eu-central-1 = 'dbs-api.eu-central-1.aliyuncs.com',
    cn-hangzhou-finance = 'dbs-api.cn-hangzhou.aliyuncs.com',
    cn-shanghai-finance-1 = 'dbs-api.cn-hangzhou.aliyuncs.com',
    cn-shenzhen-finance-1 = 'dbs-api.cn-hangzhou.aliyuncs.com',
    ap-south-1 = 'dbs-api.ap-south-1.aliyuncs.com',
    eu-west-1 = 'dbs-api.eu-west-1.aliyuncs.com',
    me-east-1 = 'dbs-api.me-east-1.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('dbs', @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 ConfigureBackupPlanRequest {
  backupPlanId?: string(name='BackupPlanId'),
  sourceEndpointInstanceType?: string(name='SourceEndpointInstanceType'),
  sourceEndpointRegion?: string(name='SourceEndpointRegion'),
  sourceEndpointInstanceID?: string(name='SourceEndpointInstanceID'),
  sourceEndpointIP?: string(name='SourceEndpointIP'),
  sourceEndpointPort?: int32(name='SourceEndpointPort'),
  sourceEndpointDatabaseName?: string(name='SourceEndpointDatabaseName'),
  sourceEndpointUserName?: string(name='SourceEndpointUserName'),
  sourceEndpointPassword?: string(name='SourceEndpointPassword'),
  backupGatewayId?: long(name='BackupGatewayId'),
  OSSBucketName?: string(name='OSSBucketName'),
  backupObjects?: string(name='BackupObjects'),
  backupPeriod?: string(name='BackupPeriod'),
  backupStartTime?: string(name='BackupStartTime'),
  enableBackupLog?: boolean(name='EnableBackupLog'),
  backupLogIntervalSeconds?: int32(name='BackupLogIntervalSeconds'),
  backupRetentionPeriod?: int32(name='BackupRetentionPeriod'),
  duplicationInfrequentAccessPeriod?: int32(name='DuplicationInfrequentAccessPeriod'),
  duplicationArchivePeriod?: int32(name='DuplicationArchivePeriod'),
  backupPlanName?: string(name='BackupPlanName'),
  sourceEndpointOracleSID?: string(name='SourceEndpointOracleSID'),
  backupStorageType?: string(name='BackupStorageType'),
  backupSpeedLimit?: long(name='BackupSpeedLimit'),
  backupRateLimit?: long(name='BackupRateLimit'),
  backupStrategyType?: string(name='BackupStrategyType'),
  crossAliyunId?: string(name='CrossAliyunId'),
  crossRoleName?: string(name='CrossRoleName'),
  autoStartBackup?: boolean(name='AutoStartBackup'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model ConfigureBackupPlanResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function configureBackupPlanWithOptions(request: ConfigureBackupPlanRequest, runtime: Util.RuntimeOptions): ConfigureBackupPlanResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ConfigureBackupPlan', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function configureBackupPlan(request: ConfigureBackupPlanRequest): ConfigureBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return configureBackupPlanWithOptions(request, runtime);
}

model CreateBackupPlanRequest {
  region?: string(name='Region'),
  instanceClass?: string(name='InstanceClass'),
  databaseType?: string(name='DatabaseType'),
  backupMethod?: string(name='BackupMethod'),
  period?: string(name='Period'),
  usedTime?: int32(name='UsedTime'),
  payType?: string(name='PayType'),
  databaseRegion?: string(name='DatabaseRegion'),
  storageRegion?: string(name='StorageRegion'),
  instanceType?: string(name='InstanceType'),
  storageType?: string(name='StorageType'),
  fromApp?: string(name='FromApp'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model CreateBackupPlanResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  errMessage?: string(name='ErrMessage'),
  orderId?: string(name='OrderId'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function createBackupPlanWithOptions(request: CreateBackupPlanRequest, runtime: Util.RuntimeOptions): CreateBackupPlanResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateBackupPlan', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createBackupPlan(request: CreateBackupPlanRequest): CreateBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return createBackupPlanWithOptions(request, runtime);
}

model CreateFullBackupSetDownloadRequest {
  backupSetId?: string(name='BackupSetId'),
  backupSetDataFormat?: string(name='BackupSetDataFormat'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model CreateFullBackupSetDownloadResponseBody = {
  requestId?: string(name='RequestId'),
  backupSetDownloadTaskId?: string(name='BackupSetDownloadTaskId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function createFullBackupSetDownloadWithOptions(request: CreateFullBackupSetDownloadRequest, runtime: Util.RuntimeOptions): CreateFullBackupSetDownloadResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateFullBackupSetDownload', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createFullBackupSetDownload(request: CreateFullBackupSetDownloadRequest): CreateFullBackupSetDownloadResponse {
  var runtime = new Util.RuntimeOptions{};
  return createFullBackupSetDownloadWithOptions(request, runtime);
}

model CreateGetDBListFromAgentTaskRequest {
  backupGatewayId?: long(name='BackupGatewayId'),
  databaseType?: string(name='DatabaseType'),
  sourceEndpointRegion?: string(name='SourceEndpointRegion'),
  sourceEndpointIP?: string(name='SourceEndpointIP'),
  sourceEndpointPort?: int32(name='SourceEndpointPort'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model CreateGetDBListFromAgentTaskResponseBody = {
  taskId?: long(name='TaskId'),
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function createGetDBListFromAgentTaskWithOptions(request: CreateGetDBListFromAgentTaskRequest, runtime: Util.RuntimeOptions): CreateGetDBListFromAgentTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateGetDBListFromAgentTask', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createGetDBListFromAgentTask(request: CreateGetDBListFromAgentTaskRequest): CreateGetDBListFromAgentTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createGetDBListFromAgentTaskWithOptions(request, runtime);
}

model CreateIncrementBackupSetDownloadRequest {
  backupSetId?: string(name='BackupSetId'),
  backupSetName?: string(name='BackupSetName'),
  backupSetDataFormat?: string(name='BackupSetDataFormat'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model CreateIncrementBackupSetDownloadResponseBody = {
  requestId?: string(name='RequestId'),
  backupSetDownloadTaskId?: string(name='BackupSetDownloadTaskId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function createIncrementBackupSetDownloadWithOptions(request: CreateIncrementBackupSetDownloadRequest, runtime: Util.RuntimeOptions): CreateIncrementBackupSetDownloadResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateIncrementBackupSetDownload', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createIncrementBackupSetDownload(request: CreateIncrementBackupSetDownloadRequest): CreateIncrementBackupSetDownloadResponse {
  var runtime = new Util.RuntimeOptions{};
  return createIncrementBackupSetDownloadWithOptions(request, runtime);
}

model CreateRestoreTaskRequest {
  backupPlanId?: string(name='BackupPlanId'),
  destinationEndpointInstanceType?: string(name='DestinationEndpointInstanceType'),
  destinationEndpointRegion?: string(name='DestinationEndpointRegion'),
  destinationEndpointInstanceID?: string(name='DestinationEndpointInstanceID'),
  destinationEndpointIP?: string(name='DestinationEndpointIP'),
  destinationEndpointPort?: int32(name='DestinationEndpointPort'),
  destinationEndpointDatabaseName?: string(name='DestinationEndpointDatabaseName'),
  destinationEndpointUserName?: string(name='DestinationEndpointUserName'),
  destinationEndpointPassword?: string(name='DestinationEndpointPassword'),
  backupGatewayId?: long(name='BackupGatewayId'),
  restoreObjects?: string(name='RestoreObjects'),
  restoreTime?: long(name='RestoreTime'),
  backupSetId?: string(name='BackupSetId'),
  restoreTaskName?: string(name='RestoreTaskName'),
  destinationEndpointOracleSID?: string(name='DestinationEndpointOracleSID'),
  restoreDir?: string(name='RestoreDir'),
  restoreHome?: string(name='RestoreHome'),
  duplicateConflict?: string(name='DuplicateConflict'),
  crossAliyunId?: string(name='CrossAliyunId'),
  crossRoleName?: string(name='CrossRoleName'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model CreateRestoreTaskResponseBody = {
  restoreTaskId?: string(name='RestoreTaskId'),
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function createRestoreTaskWithOptions(request: CreateRestoreTaskRequest, runtime: Util.RuntimeOptions): CreateRestoreTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateRestoreTask', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createRestoreTask(request: CreateRestoreTaskRequest): CreateRestoreTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRestoreTaskWithOptions(request, runtime);
}

model DescribeBackupGatewayListRequest {
  region?: string(name='Region'),
  identifier?: string(name='Identifier'),
  pageSize?: int32(name='PageSize'),
  pageNum?: int32(name='PageNum'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model DescribeBackupGatewayListResponseBody = {
  pageNum?: int32(name='PageNum'),
  requestId?: string(name='RequestId'),
  pageSize?: int32(name='PageSize'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  totalElements?: int32(name='TotalElements'),
  totalPages?: int32(name='TotalPages'),
  items?: {
    backupGateway?: [ 
    {
      displayName?: string(name='DisplayName'),
      backupGatewayCreateTime?: long(name='BackupGatewayCreateTime'),
      backupGatewayId?: string(name='BackupGatewayId'),
      region?: string(name='Region'),
      identifier?: string(name='Identifier'),
      sourceEndpointInternetIP?: string(name='SourceEndpointInternetIP'),
      backupGatewayStatus?: string(name='BackupGatewayStatus'),
      sourceEndpointIntranetIP?: string(name='SourceEndpointIntranetIP'),
      lastHeartbeatTime?: long(name='LastHeartbeatTime'),
      sourceEndpointHostname?: string(name='SourceEndpointHostname'),
    }
  ](name='BackupGateway')
  }(name='Items'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function describeBackupGatewayListWithOptions(request: DescribeBackupGatewayListRequest, runtime: Util.RuntimeOptions): DescribeBackupGatewayListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeBackupGatewayList', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeBackupGatewayList(request: DescribeBackupGatewayListRequest): DescribeBackupGatewayListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupGatewayListWithOptions(request, runtime);
}

model DescribeBackupPlanBillingRequest {
  backupPlanId?: string(name='BackupPlanId'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
  showStorageType?: boolean(name='ShowStorageType'),
}

model DescribeBackupPlanBillingResponseBody = {
  item?: {
    fullStorageSize?: long(name='FullStorageSize'),
    buyCreateTimestamp?: long(name='BuyCreateTimestamp'),
    buyExpiredTimestamp?: long(name='BuyExpiredTimestamp'),
    quotaEndTimestamp?: long(name='QuotaEndTimestamp'),
    buySpec?: string(name='BuySpec'),
    quotaStartTimestamp?: long(name='QuotaStartTimestamp'),
    isExpired?: boolean(name='IsExpired'),
    paiedBytes?: long(name='PaiedBytes'),
    totalFreeBytes?: long(name='TotalFreeBytes'),
    usedFullBytes?: long(name='UsedFullBytes'),
    isFreeBytesUnlimited?: boolean(name='IsFreeBytesUnlimited'),
    contStorageSize?: long(name='ContStorageSize'),
    buyChargeType?: string(name='BuyChargeType'),
    usedIncrementBytes?: long(name='UsedIncrementBytes'),
  }(name='Item'),
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function describeBackupPlanBillingWithOptions(request: DescribeBackupPlanBillingRequest, runtime: Util.RuntimeOptions): DescribeBackupPlanBillingResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeBackupPlanBilling', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeBackupPlanBilling(request: DescribeBackupPlanBillingRequest): DescribeBackupPlanBillingResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupPlanBillingWithOptions(request, runtime);
}

model DescribeBackupPlanListRequest {
  backupPlanId?: string(name='BackupPlanId'),
  region?: string(name='Region'),
  pageSize?: int32(name='PageSize'),
  pageNum?: int32(name='PageNum'),
  backupPlanName?: string(name='BackupPlanName'),
  backupPlanStatus?: string(name='BackupPlanStatus'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model DescribeBackupPlanListResponseBody = {
  pageNum?: int32(name='PageNum'),
  requestId?: string(name='RequestId'),
  pageSize?: int32(name='PageSize'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  totalElements?: int32(name='TotalElements'),
  totalPages?: int32(name='TotalPages'),
  items?: {
    backupPlanDetail?: [ 
    {
      crossRoleName?: string(name='CrossRoleName'),
      sourceEndpointInstanceType?: string(name='SourceEndpointInstanceType'),
      backupSetDownloadDir?: string(name='BackupSetDownloadDir'),
      sourceEndpointIpPort?: string(name='SourceEndpointIpPort'),
      crossAliyunId?: string(name='CrossAliyunId'),
      duplicationArchivePeriod?: int32(name='DuplicationArchivePeriod'),
      backupPlanId?: string(name='BackupPlanId'),
      endTimestampForRestore?: long(name='EndTimestampForRestore'),
      backupPlanStatus?: string(name='BackupPlanStatus'),
      backupSetDownloadFullDataFormat?: string(name='BackupSetDownloadFullDataFormat'),
      backupRetentionPeriod?: int32(name='BackupRetentionPeriod'),
      OSSBucketRegion?: string(name='OSSBucketRegion'),
      sourceEndpointOracleSID?: string(name='SourceEndpointOracleSID'),
      backupStorageType?: string(name='BackupStorageType'),
      backupMethod?: string(name='BackupMethod'),
      sourceEndpointRegion?: string(name='SourceEndpointRegion'),
      sourceEndpointDatabaseName?: string(name='SourceEndpointDatabaseName'),
      backupPeriod?: string(name='BackupPeriod'),
      backupSetDownloadGatewayId?: long(name='BackupSetDownloadGatewayId'),
      instanceClass?: string(name='InstanceClass'),
      backupPlanCreateTime?: long(name='BackupPlanCreateTime'),
      backupStartTime?: string(name='BackupStartTime'),
      duplicationInfrequentAccessPeriod?: int32(name='DuplicationInfrequentAccessPeriod'),
      backupSetDownloadTargetType?: string(name='BackupSetDownloadTargetType'),
      errMessage?: string(name='ErrMessage'),
      backupObjects?: string(name='BackupObjects'),
      beginTimestampForRestore?: long(name='BeginTimestampForRestore'),
      sourceEndpointInstanceID?: string(name='SourceEndpointInstanceID'),
      openBackupSetAutoDownload?: boolean(name='OpenBackupSetAutoDownload'),
      backupPlanName?: string(name='BackupPlanName'),
      OSSBucketName?: string(name='OSSBucketName'),
      backupGatewayId?: long(name='BackupGatewayId'),
      sourceEndpointUserName?: string(name='SourceEndpointUserName'),
      backupSetDownloadIncrementDataFormat?: string(name='BackupSetDownloadIncrementDataFormat'),
      enableBackupLog?: boolean(name='EnableBackupLog'),
    }
  ](name='BackupPlanDetail')
  }(name='Items'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function describeBackupPlanListWithOptions(request: DescribeBackupPlanListRequest, runtime: Util.RuntimeOptions): DescribeBackupPlanListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeBackupPlanList', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeBackupPlanList(request: DescribeBackupPlanListRequest): DescribeBackupPlanListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupPlanListWithOptions(request, runtime);
}

model DescribeBackupSetDownloadTaskListRequest {
  backupPlanId?: string(name='BackupPlanId'),
  backupSetDownloadTaskId?: string(name='BackupSetDownloadTaskId'),
  pageSize?: int32(name='PageSize'),
  pageNum?: int32(name='PageNum'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model DescribeBackupSetDownloadTaskListResponseBody = {
  pageNum?: int32(name='PageNum'),
  requestId?: string(name='RequestId'),
  pageSize?: int32(name='PageSize'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  totalElements?: int32(name='TotalElements'),
  totalPages?: int32(name='TotalPages'),
  items?: {
    backupSetDownloadTaskDetail?: [ 
    {
      backupSetDownloadStatus?: string(name='BackupSetDownloadStatus'),
      backupSetDataSize?: long(name='BackupSetDataSize'),
      backupSetDownloadDir?: string(name='BackupSetDownloadDir'),
      backupSetDownloadTargetType?: string(name='BackupSetDownloadTargetType'),
      errMessage?: string(name='ErrMessage'),
      backupPlanId?: string(name='BackupPlanId'),
      backupSetDownloadCreateTime?: long(name='BackupSetDownloadCreateTime'),
      backupSetDbType?: string(name='BackupSetDbType'),
      backupSetDownloadInternetUrl?: string(name='BackupSetDownloadInternetUrl'),
      backupSetId?: string(name='BackupSetId'),
      backupGatewayId?: long(name='BackupGatewayId'),
      backupSetDownloadIntranetUrl?: string(name='BackupSetDownloadIntranetUrl'),
      backupSetDownloadWay?: string(name='BackupSetDownloadWay'),
      backupSetDownloadFinishTime?: long(name='BackupSetDownloadFinishTime'),
      backupSetJobType?: string(name='BackupSetJobType'),
      backupSetDownloadTaskId?: string(name='BackupSetDownloadTaskId'),
      backupSetDownloadTaskName?: string(name='BackupSetDownloadTaskName'),
      backupSetDataFormat?: string(name='BackupSetDataFormat'),
      backupSetCode?: string(name='BackupSetCode'),
    }
  ](name='BackupSetDownloadTaskDetail')
  }(name='Items'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function describeBackupSetDownloadTaskListWithOptions(request: DescribeBackupSetDownloadTaskListRequest, runtime: Util.RuntimeOptions): DescribeBackupSetDownloadTaskListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeBackupSetDownloadTaskList', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeBackupSetDownloadTaskList(request: DescribeBackupSetDownloadTaskListRequest): DescribeBackupSetDownloadTaskListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupSetDownloadTaskListWithOptions(request, runtime);
}

model DescribeFullBackupListRequest {
  backupPlanId?: string(name='BackupPlanId'),
  pageSize?: int32(name='PageSize'),
  pageNum?: int32(name='PageNum'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
  showStorageType?: boolean(name='ShowStorageType'),
  backupSetId?: string(name='BackupSetId'),
}

model DescribeFullBackupListResponseBody = {
  pageNum?: int32(name='PageNum'),
  requestId?: string(name='RequestId'),
  pageSize?: int32(name='PageSize'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  totalElements?: int32(name='TotalElements'),
  totalPages?: int32(name='TotalPages'),
  items?: {
    fullBackupFile?: [ 
    {
      finishTime?: long(name='FinishTime'),
      backupStatus?: string(name='BackupStatus'),
      createTime?: long(name='CreateTime'),
      sourceEndpointIpPort?: string(name='SourceEndpointIpPort'),
      backupObjects?: string(name='BackupObjects'),
      errMessage?: string(name='ErrMessage'),
      endTime?: long(name='EndTime'),
      backupSetExpiredTime?: long(name='BackupSetExpiredTime'),
      startTime?: long(name='StartTime'),
      storageMethod?: string(name='StorageMethod'),
      backupSetId?: string(name='BackupSetId'),
      backupSize?: long(name='BackupSize'),
    }
  ](name='FullBackupFile')
  }(name='Items'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function describeFullBackupListWithOptions(request: DescribeFullBackupListRequest, runtime: Util.RuntimeOptions): DescribeFullBackupListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeFullBackupList', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeFullBackupList(request: DescribeFullBackupListRequest): DescribeFullBackupListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeFullBackupListWithOptions(request, runtime);
}

model DescribeIncrementBackupListRequest {
  backupPlanId?: string(name='BackupPlanId'),
  pageSize?: int32(name='PageSize'),
  pageNum?: int32(name='PageNum'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
  showStorageType?: boolean(name='ShowStorageType'),
}

model DescribeIncrementBackupListResponseBody = {
  pageNum?: int32(name='PageNum'),
  requestId?: string(name='RequestId'),
  pageSize?: int32(name='PageSize'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  totalElements?: int32(name='TotalElements'),
  totalPages?: int32(name='TotalPages'),
  items?: {
    incrementBackupFile?: [ 
    {
      endTime?: long(name='EndTime'),
      backupSetExpiredTime?: long(name='BackupSetExpiredTime'),
      startTime?: long(name='StartTime'),
      storageMethod?: string(name='StorageMethod'),
      backupSetJobId?: string(name='BackupSetJobId'),
      backupSetId?: string(name='BackupSetId'),
      backupStatus?: string(name='BackupStatus'),
      sourceEndpointIpPort?: string(name='SourceEndpointIpPort'),
      backupSize?: long(name='BackupSize'),
    }
  ](name='IncrementBackupFile')
  }(name='Items'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function describeIncrementBackupListWithOptions(request: DescribeIncrementBackupListRequest, runtime: Util.RuntimeOptions): DescribeIncrementBackupListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeIncrementBackupList', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeIncrementBackupList(request: DescribeIncrementBackupListRequest): DescribeIncrementBackupListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeIncrementBackupListWithOptions(request, runtime);
}

model DescribeJobErrorCodeRequest {
  taskId?: string(name='TaskId'),
  language?: string(name='Language'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model DescribeJobErrorCodeResponseBody = {
  item?: {
    jobState?: string(name='JobState'),
    errorMessage?: string(name='ErrorMessage'),
    errorCode?: string(name='ErrorCode'),
    jobId?: string(name='JobId'),
    jobType?: string(name='JobType'),
    language?: string(name='Language'),
  }(name='Item'),
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function describeJobErrorCodeWithOptions(request: DescribeJobErrorCodeRequest, runtime: Util.RuntimeOptions): DescribeJobErrorCodeResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeJobErrorCode', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeJobErrorCode(request: DescribeJobErrorCodeRequest): DescribeJobErrorCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeJobErrorCodeWithOptions(request, runtime);
}

model DescribeNodeCidrListRequest {
  region?: string(name='Region'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model DescribeNodeCidrListResponseBody = {
  requestId?: string(name='RequestId'),
  internetIPs?: {
    internetIP?: [ string ](name='InternetIP')
  }(name='InternetIPs'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  intranetIPs?: {
    intranetIP?: [ string ](name='IntranetIP')
  }(name='IntranetIPs'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function describeNodeCidrListWithOptions(request: DescribeNodeCidrListRequest, runtime: Util.RuntimeOptions): DescribeNodeCidrListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeNodeCidrList', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeNodeCidrList(request: DescribeNodeCidrListRequest): DescribeNodeCidrListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeNodeCidrListWithOptions(request, runtime);
}

model DescribePreCheckProgressListRequest {
  backupPlanId?: string(name='BackupPlanId'),
  restoreTaskId?: string(name='RestoreTaskId'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model DescribePreCheckProgressListResponseBody = {
  status?: string(name='Status'),
  progress?: int32(name='Progress'),
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  items?: {
    preCheckProgressDetail?: [ 
    {
      finishTime?: long(name='FinishTime'),
      state?: string(name='State'),
      bootTime?: long(name='BootTime'),
      jobId?: string(name='JobId'),
      item?: string(name='Item'),
      errMsg?: string(name='ErrMsg'),
      orderNum?: string(name='OrderNum'),
      names?: string(name='Names'),
    }
  ](name='PreCheckProgressDetail')
  }(name='Items'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function describePreCheckProgressListWithOptions(request: DescribePreCheckProgressListRequest, runtime: Util.RuntimeOptions): DescribePreCheckProgressListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribePreCheckProgressList', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describePreCheckProgressList(request: DescribePreCheckProgressListRequest): DescribePreCheckProgressListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePreCheckProgressListWithOptions(request, runtime);
}

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

model DescribeRegionsResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  regions?: {
    regionCode?: [ string ](name='RegionCode')
  }(name='Regions'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

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

model DescribeRestoreRangeInfoRequest {
  backupPlanId?: string(name='BackupPlanId'),
  beginTimestampForRestore?: long(name='BeginTimestampForRestore'),
  endTimestampForRestore?: long(name='EndTimestampForRestore'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
  recentlyRestore?: boolean(name='RecentlyRestore'),
}

model DescribeRestoreRangeInfoResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  items?: {
    DBSRecoverRange?: [ 
    {
      endTimestampForRestore?: long(name='EndTimestampForRestore'),
      sourceEndpointInstanceType?: string(name='SourceEndpointInstanceType'),
      fullBackupList?: {
        fullBackupDetail?: [ 
        {
          endTime?: long(name='EndTime'),
          startTime?: long(name='StartTime'),
          backupSetId?: string(name='BackupSetId'),
        }
      ](name='FullBackupDetail')
      }(name='FullBackupList'),
      rangeType?: string(name='RangeType'),
      beginTimestampForRestore?: long(name='BeginTimestampForRestore'),
      sourceEndpointInstanceID?: string(name='SourceEndpointInstanceID'),
    }
  ](name='DBSRecoverRange')
  }(name='Items'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function describeRestoreRangeInfoWithOptions(request: DescribeRestoreRangeInfoRequest, runtime: Util.RuntimeOptions): DescribeRestoreRangeInfoResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeRestoreRangeInfo', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeRestoreRangeInfo(request: DescribeRestoreRangeInfoRequest): DescribeRestoreRangeInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRestoreRangeInfoWithOptions(request, runtime);
}

model DescribeRestoreTaskListRequest {
  backupPlanId?: string(name='BackupPlanId'),
  restoreTaskId?: string(name='RestoreTaskId'),
  pageSize?: int32(name='PageSize'),
  pageNum?: int32(name='PageNum'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model DescribeRestoreTaskListResponseBody = {
  pageNum?: int32(name='PageNum'),
  requestId?: string(name='RequestId'),
  pageSize?: int32(name='PageSize'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  totalElements?: int32(name='TotalElements'),
  totalPages?: int32(name='TotalPages'),
  items?: {
    restoreTaskDetail?: [ 
    {
      restoreStatus?: string(name='RestoreStatus'),
      fullStruAfterRestoreProgress?: int32(name='FullStruAfterRestoreProgress'),
      crossRoleName?: string(name='CrossRoleName'),
      restoreDir?: string(name='RestoreDir'),
      crossAliyunId?: string(name='CrossAliyunId'),
      restoreObjects?: string(name='RestoreObjects'),
      backupPlanId?: string(name='BackupPlanId'),
      destinationEndpointRegion?: string(name='DestinationEndpointRegion'),
      restoreTaskCreateTime?: long(name='RestoreTaskCreateTime'),
      destinationEndpointUserName?: string(name='DestinationEndpointUserName'),
      restoreTaskFinishTime?: long(name='RestoreTaskFinishTime'),
      destinationEndpointIpPort?: string(name='DestinationEndpointIpPort'),
      destinationEndpointDatabaseName?: string(name='DestinationEndpointDatabaseName'),
      destinationEndpointOracleSID?: string(name='DestinationEndpointOracleSID'),
      destinationEndpointInstanceType?: string(name='DestinationEndpointInstanceType'),
      fullStruforeRestoreProgress?: int32(name='FullStruforeRestoreProgress'),
      errMessage?: string(name='ErrMessage'),
      restoreTaskId?: string(name='RestoreTaskId'),
      fullDataRestoreProgress?: int32(name='FullDataRestoreProgress'),
      continuousRestoreProgress?: int32(name='ContinuousRestoreProgress'),
      destinationEndpointInstanceID?: string(name='DestinationEndpointInstanceID'),
      backupSetId?: string(name='BackupSetId'),
      restoreTaskName?: string(name='RestoreTaskName'),
      backupGatewayId?: long(name='BackupGatewayId'),
      restoreTime?: long(name='RestoreTime'),
    }
  ](name='RestoreTaskDetail')
  }(name='Items'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function describeRestoreTaskListWithOptions(request: DescribeRestoreTaskListRequest, runtime: Util.RuntimeOptions): DescribeRestoreTaskListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeRestoreTaskList', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeRestoreTaskList(request: DescribeRestoreTaskListRequest): DescribeRestoreTaskListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRestoreTaskListWithOptions(request, runtime);
}

model DisableBackupLogRequest {
  backupPlanId?: string(name='BackupPlanId'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model DisableBackupLogResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  needPrecheck?: boolean(name='NeedPrecheck'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function disableBackupLogWithOptions(request: DisableBackupLogRequest, runtime: Util.RuntimeOptions): DisableBackupLogResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DisableBackupLog', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function disableBackupLog(request: DisableBackupLogRequest): DisableBackupLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableBackupLogWithOptions(request, runtime);
}

model EnableBackupLogRequest {
  backupPlanId?: string(name='BackupPlanId'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model EnableBackupLogResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  needPrecheck?: boolean(name='NeedPrecheck'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function enableBackupLogWithOptions(request: EnableBackupLogRequest, runtime: Util.RuntimeOptions): EnableBackupLogResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('EnableBackupLog', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function enableBackupLog(request: EnableBackupLogRequest): EnableBackupLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableBackupLogWithOptions(request, runtime);
}

model GetDBListFromAgentRequest {
  backupGatewayId?: long(name='BackupGatewayId'),
  sourceEndpointRegion?: string(name='SourceEndpointRegion'),
  taskId?: long(name='TaskId'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model GetDBListFromAgentResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  dbList?: {
    dbName?: [ string ](name='dbName')
  }(name='DbList'),
  errCode?: string(name='ErrCode'),
}

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

async function getDBListFromAgentWithOptions(request: GetDBListFromAgentRequest, runtime: Util.RuntimeOptions): GetDBListFromAgentResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('GetDBListFromAgent', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function getDBListFromAgent(request: GetDBListFromAgentRequest): GetDBListFromAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDBListFromAgentWithOptions(request, runtime);
}

model ModifyBackupObjectsRequest {
  backupPlanId?: string(name='BackupPlanId'),
  backupObjects?: string(name='BackupObjects'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model ModifyBackupObjectsResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  needPrecheck?: boolean(name='NeedPrecheck'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function modifyBackupObjectsWithOptions(request: ModifyBackupObjectsRequest, runtime: Util.RuntimeOptions): ModifyBackupObjectsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyBackupObjects', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyBackupObjects(request: ModifyBackupObjectsRequest): ModifyBackupObjectsResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyBackupObjectsWithOptions(request, runtime);
}

model ModifyBackupPlanNameRequest {
  backupPlanId?: string(name='BackupPlanId'),
  backupPlanName?: string(name='BackupPlanName'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model ModifyBackupPlanNameResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function modifyBackupPlanNameWithOptions(request: ModifyBackupPlanNameRequest, runtime: Util.RuntimeOptions): ModifyBackupPlanNameResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyBackupPlanName', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyBackupPlanName(request: ModifyBackupPlanNameRequest): ModifyBackupPlanNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyBackupPlanNameWithOptions(request, runtime);
}

model ModifyBackupSetDownloadRulesRequest {
  backupPlanId?: string(name='BackupPlanId'),
  openAutoDownload?: boolean(name='OpenAutoDownload'),
  backupGatewayId?: long(name='BackupGatewayId'),
  fullDataFormat?: string(name='FullDataFormat'),
  incrementDataFormat?: string(name='IncrementDataFormat'),
  backupSetDownloadDir?: string(name='BackupSetDownloadDir'),
  backupSetDownloadTargetType?: string(name='BackupSetDownloadTargetType'),
  backupSetDownloadTargetTypeLocation?: string(name='BackupSetDownloadTargetTypeLocation'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model ModifyBackupSetDownloadRulesResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function modifyBackupSetDownloadRulesWithOptions(request: ModifyBackupSetDownloadRulesRequest, runtime: Util.RuntimeOptions): ModifyBackupSetDownloadRulesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyBackupSetDownloadRules', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyBackupSetDownloadRules(request: ModifyBackupSetDownloadRulesRequest): ModifyBackupSetDownloadRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyBackupSetDownloadRulesWithOptions(request, runtime);
}

model ModifyBackupSourceEndpointRequest {
  backupPlanId?: string(name='BackupPlanId'),
  sourceEndpointInstanceType?: string(name='SourceEndpointInstanceType'),
  sourceEndpointRegion?: string(name='SourceEndpointRegion'),
  sourceEndpointInstanceID?: string(name='SourceEndpointInstanceID'),
  sourceEndpointIP?: string(name='SourceEndpointIP'),
  sourceEndpointPort?: int32(name='SourceEndpointPort'),
  sourceEndpointDatabaseName?: string(name='SourceEndpointDatabaseName'),
  sourceEndpointUserName?: string(name='SourceEndpointUserName'),
  sourceEndpointPassword?: string(name='SourceEndpointPassword'),
  backupGatewayId?: long(name='BackupGatewayId'),
  backupObjects?: string(name='BackupObjects'),
  sourceEndpointOracleSID?: string(name='SourceEndpointOracleSID'),
  crossAliyunId?: string(name='CrossAliyunId'),
  crossRoleName?: string(name='CrossRoleName'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model ModifyBackupSourceEndpointResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  needPrecheck?: boolean(name='NeedPrecheck'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function modifyBackupSourceEndpointWithOptions(request: ModifyBackupSourceEndpointRequest, runtime: Util.RuntimeOptions): ModifyBackupSourceEndpointResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyBackupSourceEndpoint', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyBackupSourceEndpoint(request: ModifyBackupSourceEndpointRequest): ModifyBackupSourceEndpointResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyBackupSourceEndpointWithOptions(request, runtime);
}

model ModifyBackupStrategyRequest {
  backupPlanId?: string(name='BackupPlanId'),
  backupPeriod?: string(name='BackupPeriod'),
  backupStartTime?: string(name='BackupStartTime'),
  backupStrategyType?: string(name='BackupStrategyType'),
  backupLogIntervalSeconds?: int32(name='BackupLogIntervalSeconds'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model ModifyBackupStrategyResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  needPrecheck?: boolean(name='NeedPrecheck'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function modifyBackupStrategyWithOptions(request: ModifyBackupStrategyRequest, runtime: Util.RuntimeOptions): ModifyBackupStrategyResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyBackupStrategy', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyBackupStrategy(request: ModifyBackupStrategyRequest): ModifyBackupStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyBackupStrategyWithOptions(request, runtime);
}

model ModifyStorageStrategyRequest {
  backupPlanId?: string(name='BackupPlanId'),
  backupRetentionPeriod?: int32(name='BackupRetentionPeriod'),
  duplicationInfrequentAccessPeriod?: int32(name='DuplicationInfrequentAccessPeriod'),
  duplicationArchivePeriod?: int32(name='DuplicationArchivePeriod'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model ModifyStorageStrategyResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  needPrecheck?: boolean(name='NeedPrecheck'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function modifyStorageStrategyWithOptions(request: ModifyStorageStrategyRequest, runtime: Util.RuntimeOptions): ModifyStorageStrategyResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyStorageStrategy', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyStorageStrategy(request: ModifyStorageStrategyRequest): ModifyStorageStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyStorageStrategyWithOptions(request, runtime);
}

model ReleaseBackupPlanRequest {
  backupPlanId?: string(name='BackupPlanId'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model ReleaseBackupPlanResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function releaseBackupPlanWithOptions(request: ReleaseBackupPlanRequest, runtime: Util.RuntimeOptions): ReleaseBackupPlanResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ReleaseBackupPlan', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function releaseBackupPlan(request: ReleaseBackupPlanRequest): ReleaseBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseBackupPlanWithOptions(request, runtime);
}

model RenewBackupPlanRequest {
  backupPlanId?: string(name='BackupPlanId'),
  period?: string(name='Period'),
  usedTime?: int32(name='UsedTime'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model RenewBackupPlanResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  errMessage?: string(name='ErrMessage'),
  orderId?: string(name='OrderId'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function renewBackupPlanWithOptions(request: RenewBackupPlanRequest, runtime: Util.RuntimeOptions): RenewBackupPlanResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RenewBackupPlan', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function renewBackupPlan(request: RenewBackupPlanRequest): RenewBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return renewBackupPlanWithOptions(request, runtime);
}

model StartBackupPlanRequest {
  backupPlanId?: string(name='BackupPlanId'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model StartBackupPlanResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function startBackupPlanWithOptions(request: StartBackupPlanRequest, runtime: Util.RuntimeOptions): StartBackupPlanResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StartBackupPlan', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function startBackupPlan(request: StartBackupPlanRequest): StartBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return startBackupPlanWithOptions(request, runtime);
}

model StartRestoreTaskRequest {
  restoreTaskId?: string(name='RestoreTaskId'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model StartRestoreTaskResponseBody = {
  restoreTaskId?: string(name='RestoreTaskId'),
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function startRestoreTaskWithOptions(request: StartRestoreTaskRequest, runtime: Util.RuntimeOptions): StartRestoreTaskResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StartRestoreTask', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function startRestoreTask(request: StartRestoreTaskRequest): StartRestoreTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return startRestoreTaskWithOptions(request, runtime);
}

model StartTaskRequest {
  taskId?: string(name='TaskId'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model StartTaskResponseBody = {
  taskId?: string(name='TaskId'),
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
  jobTypeName?: string(name='JobTypeName'),
}

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

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

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

model StopBackupPlanRequest {
  backupPlanId?: string(name='BackupPlanId'),
  stopMethod?: string(name='StopMethod'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model StopBackupPlanResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  errMessage?: string(name='ErrMessage'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function stopBackupPlanWithOptions(request: StopBackupPlanRequest, runtime: Util.RuntimeOptions): StopBackupPlanResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('StopBackupPlan', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function stopBackupPlan(request: StopBackupPlanRequest): StopBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopBackupPlanWithOptions(request, runtime);
}

model UpgradeBackupPlanRequest {
  backupPlanId?: string(name='BackupPlanId'),
  instanceClass?: string(name='InstanceClass'),
  ownerId?: string(name='OwnerId'),
  clientToken?: string(name='ClientToken'),
}

model UpgradeBackupPlanResponseBody = {
  requestId?: string(name='RequestId'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  backupPlanId?: string(name='BackupPlanId'),
  errMessage?: string(name='ErrMessage'),
  orderId?: string(name='OrderId'),
  success?: boolean(name='Success'),
  errCode?: string(name='ErrCode'),
}

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

async function upgradeBackupPlanWithOptions(request: UpgradeBackupPlanRequest, runtime: Util.RuntimeOptions): UpgradeBackupPlanResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpgradeBackupPlan', '2019-03-06', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function upgradeBackupPlan(request: UpgradeBackupPlanRequest): UpgradeBackupPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeBackupPlanWithOptions(request, runtime);
}

