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

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  @endpointMap = {
    ap-northeast-2-pop = 'ft.aliyuncs.com',
    ap-south-1 = 'ft.aliyuncs.com',
    ap-southeast-1 = 'ft.aliyuncs.com',
    ap-southeast-2 = 'ft.aliyuncs.com',
    ap-southeast-3 = 'ft.aliyuncs.com',
    ap-southeast-5 = 'ft.aliyuncs.com',
    cn-beijing = 'ft.aliyuncs.com',
    cn-beijing-finance-1 = 'ft.aliyuncs.com',
    cn-beijing-finance-pop = 'ft.aliyuncs.com',
    cn-beijing-gov-1 = 'ft.aliyuncs.com',
    cn-beijing-nu16-b01 = 'ft.aliyuncs.com',
    cn-chengdu = 'ft.aliyuncs.com',
    cn-edge-1 = 'ft.aliyuncs.com',
    cn-fujian = 'ft.aliyuncs.com',
    cn-haidian-cm12-c01 = 'ft.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'ft.aliyuncs.com',
    cn-hangzhou-finance = 'ft.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'ft.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'ft.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'ft.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'ft.aliyuncs.com',
    cn-hangzhou-test-306 = 'ft.aliyuncs.com',
    cn-hongkong-finance-pop = 'ft.aliyuncs.com',
    cn-huhehaote = 'ft.aliyuncs.com',
    cn-huhehaote-nebula-1 = 'ft.aliyuncs.com',
    cn-qingdao = 'ft.aliyuncs.com',
    cn-qingdao-nebula = 'ft.aliyuncs.com',
    cn-shanghai-et15-b01 = 'ft.aliyuncs.com',
    cn-shanghai-et2-b01 = 'ft.aliyuncs.com',
    cn-shanghai-finance-1 = 'ft.aliyuncs.com',
    cn-shanghai-inner = 'ft.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'ft.aliyuncs.com',
    cn-shenzhen-finance-1 = 'ft.aliyuncs.com',
    cn-shenzhen-inner = 'ft.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'ft.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'ft.aliyuncs.com',
    cn-wuhan = 'ft.aliyuncs.com',
    cn-wulanchabu = 'ft.aliyuncs.com',
    cn-yushanfang = 'ft.aliyuncs.com',
    cn-zhangbei = 'ft.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'ft.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'ft.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'ft.aliyuncs.com',
    eu-central-1 = 'ft.aliyuncs.com',
    eu-west-1 = 'ft.aliyuncs.com',
    eu-west-1-oxs = 'ft.aliyuncs.com',
    me-east-1 = 'ft.aliyuncs.com',
    rus-west-1-pop = 'ft.aliyuncs.com',
    us-west-1 = 'ft.aliyuncs.com',
  };
  checkConfig(config);
  @endpoint = getEndpoint('ft', @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 BatchAuditTest01Request {
  name?: string(name='Name'),
  batchAuditTest01?: string(name='BatchAuditTest01'),
  demo01?: string(name='Demo01'),
  test010101?: boolean(name='Test010101'),
}

model BatchAuditTest01ResponseBody = {
  name?: string(name='Name'),
  requestId?: string(name='RequestId'),
  demo01?: {
    demo011?: {
      demo011?: [ 
      {
        demo0111?: string(name='Demo0111'),
      }
    ](name='Demo011')
    }(name='Demo011'),
  }(name='Demo01'),
}

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

async function batchAuditTest01WithOptions(request: BatchAuditTest01Request, runtime: Util.RuntimeOptions): BatchAuditTest01Response {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('BatchAuditTest01', '2018-07-13', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function batchAuditTest01(request: BatchAuditTest01Request): BatchAuditTest01Response {
  var runtime = new Util.RuntimeOptions{};
  return batchAuditTest01WithOptions(request, runtime);
}

model FTApiAliasApiRequest {
  name?: string(name='Name'),
}

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

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

async function fTApiAliasApiWithOptions(request: FTApiAliasApiRequest, runtime: Util.RuntimeOptions): FTApiAliasApiResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('FTApiAliasApi', '2018-07-13', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function fTApiAliasApi(request: FTApiAliasApiRequest): FTApiAliasApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return fTApiAliasApiWithOptions(request, runtime);
}

model FtDynamicAddressDubboRequest {
  intValue?: int32(name='IntValue'),
  stringValue?: string(name='StringValue'),
}

model FtDynamicAddressDubboResponseBody = {
  requestId?: string(name='RequestId'),
  stringValue?: string(name='StringValue'),
  intValue?: int32(name='IntValue'),
}

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

async function ftDynamicAddressDubboWithOptions(request: FtDynamicAddressDubboRequest, runtime: Util.RuntimeOptions): FtDynamicAddressDubboResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('FtDynamicAddressDubbo', '2018-07-13', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function ftDynamicAddressDubbo(request: FtDynamicAddressDubboRequest): FtDynamicAddressDubboResponse {
  var runtime = new Util.RuntimeOptions{};
  return ftDynamicAddressDubboWithOptions(request, runtime);
}

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

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

async function ftDynamicAddressHsfWithOptions(runtime: Util.RuntimeOptions): FtDynamicAddressHsfResponse {
  var req = new OpenApi.OpenApiRequest{};
  return doRPCRequest('FtDynamicAddressHsf', '2018-07-13', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function ftDynamicAddressHsf(): FtDynamicAddressHsfResponse {
  var runtime = new Util.RuntimeOptions{};
  return ftDynamicAddressHsfWithOptions(runtime);
}

model FtDynamicAddressHttpVpcRequest {
  stringValue?: map[string]any(name='StringValue'),
  defaultValue?: map[string]any(name='DefaultValue'),
  otherParam?: map[string]any(name='OtherParam'),
  booleanParam?: boolean(name='BooleanParam'),
  p1?: string(name='P1'),
}

model FtDynamicAddressHttpVpcShrinkRequest {
  stringValueShrink?: string(name='StringValue'),
  defaultValueShrink?: string(name='DefaultValue'),
  otherParamShrink?: string(name='OtherParam'),
  booleanParam?: boolean(name='BooleanParam'),
  p1?: string(name='P1'),
}

model FtDynamicAddressHttpVpcResponseBody = {
  serviceRpcSign?: string(name='ServiceRpcSign'),
  params?: string(name='Params'),
}

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

async function ftDynamicAddressHttpVpcWithOptions(tmpReq: FtDynamicAddressHttpVpcRequest, runtime: Util.RuntimeOptions): FtDynamicAddressHttpVpcResponse {
  Util.validateModel(tmpReq);
  var request = new FtDynamicAddressHttpVpcShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.stringValue)) {
    request.stringValueShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.stringValue, 'StringValue', 'json');
  }
  if (!Util.isUnset(tmpReq.defaultValue)) {
    request.defaultValueShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.defaultValue, 'DefaultValue', 'json');
  }
  if (!Util.isUnset(tmpReq.otherParam)) {
    request.otherParamShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.otherParam, 'OtherParam', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('FtDynamicAddressHttpVpc', '2018-07-13', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function ftDynamicAddressHttpVpc(request: FtDynamicAddressHttpVpcRequest): FtDynamicAddressHttpVpcResponse {
  var runtime = new Util.RuntimeOptions{};
  return ftDynamicAddressHttpVpcWithOptions(request, runtime);
}

model FtEagleEyeRequest {
  name?: string(name='Name'),
}

model FtEagleEyeResponseBody = {
  requestId?: string(name='RequestId'),
  name?: string(name='Name'),
  eagleEyeTraceId?: string(name='eagleEyeTraceId'),
}

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

async function ftEagleEyeWithOptions(request: FtEagleEyeRequest, runtime: Util.RuntimeOptions): FtEagleEyeResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('FtEagleEye', '2018-07-13', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function ftEagleEye(request: FtEagleEyeRequest): FtEagleEyeResponse {
  var runtime = new Util.RuntimeOptions{};
  return ftEagleEyeWithOptions(request, runtime);
}

model FtFlowSpecialRequest {
  name?: string(name='Name'),
}

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

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

async function ftFlowSpecialWithOptions(request: FtFlowSpecialRequest, runtime: Util.RuntimeOptions): FtFlowSpecialResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('FtFlowSpecial', '2018-07-13', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function ftFlowSpecial(request: FtFlowSpecialRequest): FtFlowSpecialResponse {
  var runtime = new Util.RuntimeOptions{};
  return ftFlowSpecialWithOptions(request, runtime);
}

model FtGatedLaunchPolicy4Request {
  isGatedLaunch?: string(name='IsGatedLaunch'),
}

model FtGatedLaunchPolicy4ResponseBody = {
  isGatedLaunch?: string(name='IsGatedLaunch'),
  requestId?: string(name='RequestId'),
}

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

async function ftGatedLaunchPolicy4WithOptions(request: FtGatedLaunchPolicy4Request, runtime: Util.RuntimeOptions): FtGatedLaunchPolicy4Response {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('FtGatedLaunchPolicy4', '2018-07-13', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function ftGatedLaunchPolicy4(request: FtGatedLaunchPolicy4Request): FtGatedLaunchPolicy4Response {
  var runtime = new Util.RuntimeOptions{};
  return ftGatedLaunchPolicy4WithOptions(request, runtime);
}

model FtIpFlowControlRequest {
  name?: string(name='Name'),
}

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

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

async function ftIpFlowControlWithOptions(request: FtIpFlowControlRequest, runtime: Util.RuntimeOptions): FtIpFlowControlResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('FtIpFlowControl', '2018-07-13', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function ftIpFlowControl(request: FtIpFlowControlRequest): FtIpFlowControlResponse {
  var runtime = new Util.RuntimeOptions{};
  return ftIpFlowControlWithOptions(request, runtime);
}

model FtParamListRequest {
  name?: string(name='Name'),
  disk?: [ 
    {
      type?: [ string ](name='Type'),
      size?: [ string ](name='Size'),
    }
  ](name='Disk'),
}

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

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

async function ftParamListWithOptions(request: FtParamListRequest, runtime: Util.RuntimeOptions): FtParamListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('FtParamList', '2018-07-13', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function ftParamList(request: FtParamListRequest): FtParamListResponse {
  var runtime = new Util.RuntimeOptions{};
  return ftParamListWithOptions(request, runtime);
}

model TestFlowStrategy01Request {
  names?: map[string]any(name='Names'),
}

model TestFlowStrategy01ShrinkRequest {
  namesShrink?: string(name='Names'),
}

model TestFlowStrategy01ResponseBody = {
  requestId?: string(name='RequestId'),
  list?: [ string ](name='List'),
  names?: [ string ](name='Names'),
}

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

async function testFlowStrategy01WithOptions(tmpReq: TestFlowStrategy01Request, runtime: Util.RuntimeOptions): TestFlowStrategy01Response {
  Util.validateModel(tmpReq);
  var request = new TestFlowStrategy01ShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.names)) {
    request.namesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.names, 'Names', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('TestFlowStrategy01', '2018-07-13', 'HTTPS', 'PUT', 'AK', 'json', req, runtime);
}

async function testFlowStrategy01(request: TestFlowStrategy01Request): TestFlowStrategy01Response {
  var runtime = new Util.RuntimeOptions{};
  return testFlowStrategy01WithOptions(request, runtime);
}

model TestHttpApiRequest {
  stringValue?: map[string]any(name='StringValue'),
  defaultValue?: map[string]any(name='DefaultValue'),
  otherParam?: map[string]any(name='OtherParam'),
  booleanParam?: boolean(name='BooleanParam'),
}

model TestHttpApiShrinkRequest {
  stringValueShrink?: string(name='StringValue'),
  defaultValueShrink?: string(name='DefaultValue'),
  otherParamShrink?: string(name='OtherParam'),
  booleanParam?: boolean(name='BooleanParam'),
}

model TestHttpApiResponseBody = {
  serviceRpcSign?: string(name='ServiceRpcSign'),
  params?: string(name='Params'),
}

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

async function testHttpApiWithOptions(tmpReq: TestHttpApiRequest, runtime: Util.RuntimeOptions): TestHttpApiResponse {
  Util.validateModel(tmpReq);
  var request = new TestHttpApiShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.stringValue)) {
    request.stringValueShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.stringValue, 'StringValue', 'json');
  }
  if (!Util.isUnset(tmpReq.defaultValue)) {
    request.defaultValueShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.defaultValue, 'DefaultValue', 'json');
  }
  if (!Util.isUnset(tmpReq.otherParam)) {
    request.otherParamShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.otherParam, 'OtherParam', 'json');
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('TestHttpApi', '2018-07-13', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function testHttpApi(request: TestHttpApiRequest): TestHttpApiResponse {
  var runtime = new Util.RuntimeOptions{};
  return testHttpApiWithOptions(request, runtime);
}

