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

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('agraphservice', @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 AgraphSearchServiceSgVpcPreRequest {
  secretKeyId?: string(name='secretKeyId', description='param0'),
  graphCode?: string(name='graphCode', description='param1'),
  nodeId?: string(name='nodeId', description='param2'),
}

model AgraphSearchServiceSgVpcPreResponseBody = {
  message?: string(name='Message', description='message'),
  data?: string(name='Data', description='data'),
  code?: int32(name='Code', description='code'),
  success?: boolean(name='Success', description='success'),
}

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

async function agraphSearchServiceSgVpcPreWithOptions(request: AgraphSearchServiceSgVpcPreRequest, runtime: Util.RuntimeOptions): AgraphSearchServiceSgVpcPreResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('AgraphSearchServiceSgVpcPre', '2021-09-14', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function agraphSearchServiceSgVpcPre(request: AgraphSearchServiceSgVpcPreRequest): AgraphSearchServiceSgVpcPreResponse {
  var runtime = new Util.RuntimeOptions{};
  return agraphSearchServiceSgVpcPreWithOptions(request, runtime);
}

model SearchSgVpcGraphServiceRequest {
  param0?: string(name='Param0', description='param0'),
  param1?: string(name='Param1', description='param1'),
  param2?: string(name='Param2', description='param2'),
}

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

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

async function searchSgVpcGraphServiceWithOptions(request: SearchSgVpcGraphServiceRequest, runtime: Util.RuntimeOptions): SearchSgVpcGraphServiceResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('SearchSgVpcGraphService', '2021-09-14', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function searchSgVpcGraphService(request: SearchSgVpcGraphServiceRequest): SearchSgVpcGraphServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchSgVpcGraphServiceWithOptions(request, runtime);
}

model SgVpcSearchServiceRequest {
  secretKeyId?: string(name='SecretKeyId', description='param0'),
  graphCode?: string(name='GraphCode', description='param1'),
  nodeId?: string(name='NodeId', description='param2'),
}

model SgVpcSearchServiceResponseBody = {
  message?: string(name='Message', description='message'),
  code?: int32(name='Code', description='code'),
  success?: boolean(name='Success', description='success'),
  requestId?: string(name='RequestId', description='RequestId'),
  data?: {
    groupCnt?: long(name='GroupCnt', description='groupCnt'),
    centerId?: string(name='CenterId', description='centerId'),
    groupInfo?: [ string ](name='GroupInfo', description='groupInfo'),
    groupId?: string(name='GroupId', description='groupId'),
    groupDetail?: map[string]string(name='GroupDetail', description='groupDetail'),
  }(name='Data', description='data'),
}

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

async function sgVpcSearchServiceWithOptions(request: SgVpcSearchServiceRequest, runtime: Util.RuntimeOptions): SgVpcSearchServiceResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = query,
  };
  return doRPCRequest('SgVpcSearchService', '2021-09-14', 'HTTPS', 'GET', 'AK', 'json', req, runtime);
}

async function sgVpcSearchService(request: SgVpcSearchServiceRequest): SgVpcSearchServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return sgVpcSearchServiceWithOptions(request, runtime);
}

