import Util;
import ROA;
import EndpointUtil;

extends ROA;

const version = '2015-09-01';

init(config: ROA.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpointHost = getEndpoint('ros', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpointHost);
}


model CreateChangeSetRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model CreateChangeSetResponseBody = {
  dummy: string(name='Dummy', description='Dummy'),
}

model CreateChangeSetResponse = {
  headers: map[string]string(name='headers', description='headers'),
  body: CreateChangeSetResponseBody(name='body', description='body'),
}

async function createChangeSetWithOptions(request: CreateChangeSetRequest, runtime: Util.RuntimeOptions): CreateChangeSetResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'POST', 'AK', `/changeSets`, null, request.headers, null, runtime);
}

async function createChangeSet(request: CreateChangeSetRequest): CreateChangeSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return createChangeSetWithOptions(request, runtime);
}

model DescribeChangeSetDetailRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model DescribeChangeSetDetailResponseBody = {
  dummy: string(name='Dummy', description='Dummy'),
}

model DescribeChangeSetDetailResponse = {
  headers: map[string]string(name='headers', description='headers'),
  body: DescribeChangeSetDetailResponseBody(name='body', description='body'),
}

async function describeChangeSetDetailWithOptions(stackName: string, stackId: string, changeSetName: string, request: DescribeChangeSetDetailRequest, runtime: Util.RuntimeOptions): DescribeChangeSetDetailResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/stacks/${stackName}/${stackId}/changeSets/${changeSetName}`, null, request.headers, null, runtime);
}

async function describeChangeSetDetail(stackName: string, stackId: string, changeSetName: string, request: DescribeChangeSetDetailRequest): DescribeChangeSetDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeChangeSetDetailWithOptions(stackName, stackId, changeSetName, request, runtime);
}

model DescribeChangeSetsRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model DescribeChangeSetsResponseBody = {
  dummy: string(name='Dummy', description='Dummy'),
}

model DescribeChangeSetsResponse = {
  headers: map[string]string(name='headers', description='headers'),
  body: DescribeChangeSetsResponseBody(name='body', description='body'),
}

async function describeChangeSetsWithOptions(stackName: string, stackId: string, request: DescribeChangeSetsRequest, runtime: Util.RuntimeOptions): DescribeChangeSetsResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/stacks/${stackName}/${stackId}/changeSets`, null, request.headers, null, runtime);
}

async function describeChangeSets(stackName: string, stackId: string, request: DescribeChangeSetsRequest): DescribeChangeSetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeChangeSetsWithOptions(stackName, stackId, request, runtime);
}

model ExecuteChangeSetRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model ExecuteChangeSetResponseBody = {
  dummy: string(name='Dummy', description='Dummy'),
}

model ExecuteChangeSetResponse = {
  headers: map[string]string(name='headers', description='headers'),
  body: ExecuteChangeSetResponseBody(name='body', description='body'),
}

async function executeChangeSetWithOptions(stackName: string, stackId: string, changeSetName: string, request: ExecuteChangeSetRequest, runtime: Util.RuntimeOptions): ExecuteChangeSetResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'PUT', 'AK', `/stacks/${stackName}/${stackId}/changeSets/${changeSetName}/execute`, null, request.headers, null, runtime);
}

async function executeChangeSet(stackName: string, stackId: string, changeSetName: string, request: ExecuteChangeSetRequest): ExecuteChangeSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return executeChangeSetWithOptions(stackName, stackId, changeSetName, request, runtime);
}

model DeleteChangeSetRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model DeleteChangeSetResponseBody = {
  dummy: string(name='Dummy', description='Dummy'),
}

model DeleteChangeSetResponse = {
  headers: map[string]string(name='headers', description='headers'),
  body: DeleteChangeSetResponseBody(name='body', description='body'),
}

async function deleteChangeSetWithOptions(stackName: string, stackId: string, changeSetName: string, request: DeleteChangeSetRequest, runtime: Util.RuntimeOptions): DeleteChangeSetResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'DELETE', 'AK', `/stacks/${stackName}/${stackId}/changeSets/${changeSetName}`, null, request.headers, null, runtime);
}

async function deleteChangeSet(stackName: string, stackId: string, changeSetName: string, request: DeleteChangeSetRequest): DeleteChangeSetResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteChangeSetWithOptions(stackName, stackId, changeSetName, request, runtime);
}

model ContinueCreateStackRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model ContinueCreateStackResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function continueCreateStackWithOptions(stackName: string, stackId: string, request: ContinueCreateStackRequest, runtime: Util.RuntimeOptions): ContinueCreateStackResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'POST', 'AK', `/stacks/${stackName}/${stackId}/continue`, null, request.headers, null, runtime);
}

async function continueCreateStack(stackName: string, stackId: string, request: ContinueCreateStackRequest): ContinueCreateStackResponse {
  var runtime = new Util.RuntimeOptions{};
  return continueCreateStackWithOptions(stackName, stackId, request, runtime);
}

model CancelUpdateStackRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model CancelUpdateStackResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function cancelUpdateStackWithOptions(stackName: string, stackId: string, request: CancelUpdateStackRequest, runtime: Util.RuntimeOptions): CancelUpdateStackResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'PUT', 'AK', `/stacks/${stackName}/${stackId}/cancel`, null, request.headers, null, runtime);
}

async function cancelUpdateStack(stackName: string, stackId: string, request: CancelUpdateStackRequest): CancelUpdateStackResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelUpdateStackWithOptions(stackName, stackId, request, runtime);
}

model GetStackPolicyRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model GetStackPolicyResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function getStackPolicyWithOptions(stackName: string, stackId: string, request: GetStackPolicyRequest, runtime: Util.RuntimeOptions): GetStackPolicyResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/stacks/${stackName}/${stackId}/policy`, null, request.headers, null, runtime);
}

async function getStackPolicy(stackName: string, stackId: string, request: GetStackPolicyRequest): GetStackPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return getStackPolicyWithOptions(stackName, stackId, request, runtime);
}

model SetStackPolicyRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model SetStackPolicyResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function setStackPolicyWithOptions(stackName: string, stackId: string, request: SetStackPolicyRequest, runtime: Util.RuntimeOptions): SetStackPolicyResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'POST', 'AK', `/stacks/${stackName}/${stackId}/policy`, null, request.headers, null, runtime);
}

async function setStackPolicy(stackName: string, stackId: string, request: SetStackPolicyRequest): SetStackPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return setStackPolicyWithOptions(stackName, stackId, request, runtime);
}

model UpdateStackRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model UpdateStackResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function updateStackWithOptions(stackName: string, stackId: string, request: UpdateStackRequest, runtime: Util.RuntimeOptions): UpdateStackResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'PUT', 'AK', `/stacks/${stackName}/${stackId}`, null, request.headers, null, runtime);
}

async function updateStack(stackName: string, stackId: string, request: UpdateStackRequest): UpdateStackResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateStackWithOptions(stackName, stackId, request, runtime);
}

model WaitConditionsQuery = {
  stackname: string(name='stackname', description='stackname'),
  stackid: string(name='stackid', description='stackid'),
  resource: string(name='resource', description='resource'),
  expire: string(name='expire', description='expire'),
  signature: string(name='signature', description='signature'),
}

model WaitConditionsRequest = {
  headers?: map[string]string(name='headers', description='headers'),
  query: WaitConditionsQuery(name='query', description='query'),
}

model WaitConditionsResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function waitConditionsWithOptions(request: WaitConditionsRequest, runtime: Util.RuntimeOptions): WaitConditionsResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'POST', 'Anonymous', `/waitcondition`, Util.stringifyMapValue(request.query), request.headers, null, runtime);
}

async function waitConditions(request: WaitConditionsRequest): WaitConditionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return waitConditionsWithOptions(request, runtime);
}

model InquiryStackRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model InquiryStackResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function inquiryStackWithOptions(request: InquiryStackRequest, runtime: Util.RuntimeOptions): InquiryStackResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'POST', 'AK', `/stacks/inquiry`, null, request.headers, null, runtime);
}

async function inquiryStack(request: InquiryStackRequest): InquiryStackResponse {
  var runtime = new Util.RuntimeOptions{};
  return inquiryStackWithOptions(request, runtime);
}

model PreviewStackRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model PreviewStackResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function previewStackWithOptions(request: PreviewStackRequest, runtime: Util.RuntimeOptions): PreviewStackResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'POST', 'AK', `/stacks/preview`, null, request.headers, null, runtime);
}

async function previewStack(request: PreviewStackRequest): PreviewStackResponse {
  var runtime = new Util.RuntimeOptions{};
  return previewStackWithOptions(request, runtime);
}

model DoActionsRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model DoActionsResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function doActionsWithOptions(stackName: string, stackId: string, request: DoActionsRequest, runtime: Util.RuntimeOptions): DoActionsResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'POST', 'AK', `/stacks/${stackName}/${stackId}/actions`, null, request.headers, null, runtime);
}

async function doActions(stackName: string, stackId: string, request: DoActionsRequest): DoActionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return doActionsWithOptions(stackName, stackId, request, runtime);
}

model DescribeRegionsRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

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

async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/regions`, null, request.headers, null, runtime);
}

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

model DescribeEventsQuery = {
  resourceStatus?: string(name='ResourceStatus', description='ResourceStatus'),
  resourceName?: string(name='ResourceName', description='ResourceName'),
  resourceType?: string(name='ResourceType', description='ResourceType'),
  pageSize?: integer(name='PageSize', description='Limit'),
  pageNumber?: integer(name='PageNumber', description='PageNumber'),
}

model DescribeEventsRequest = {
  headers?: map[string]string(name='headers', description='headers'),
  query?: DescribeEventsQuery(name='query', description='query'),
}

model DescribeEventsResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function describeEventsWithOptions(stackName: string, stackId: string, request: DescribeEventsRequest, runtime: Util.RuntimeOptions): DescribeEventsResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/stacks/${stackName}/${stackId}/events`, Util.stringifyMapValue(request.query), request.headers, null, runtime);
}

async function describeEvents(stackName: string, stackId: string, request: DescribeEventsRequest): DescribeEventsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeEventsWithOptions(stackName, stackId, request, runtime);
}

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

model DeleteStackRequest = {
  headers?: map[string]string(name='headers', description='headers'),
  query?: DeleteStackQuery(name='query', description='query'),
}

model DeleteStackResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function deleteStackWithOptions(stackName: string, stackId: string, request: DeleteStackRequest, runtime: Util.RuntimeOptions): DeleteStackResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'DELETE', 'AK', `/stacks/${stackName}/${stackId}`, Util.stringifyMapValue(request.query), request.headers, null, runtime);
}

async function deleteStack(stackName: string, stackId: string, request: DeleteStackRequest): DeleteStackResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteStackWithOptions(stackName, stackId, request, runtime);
}

model CreateStacksRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model CreateStacksResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function createStacksWithOptions(request: CreateStacksRequest, runtime: Util.RuntimeOptions): CreateStacksResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'POST', 'AK', `/stacks`, null, request.headers, null, runtime);
}

async function createStacks(request: CreateStacksRequest): CreateStacksResponse {
  var runtime = new Util.RuntimeOptions{};
  return createStacksWithOptions(request, runtime);
}

model AbandonStackRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model AbandonStackResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function abandonStackWithOptions(stackName: string, stackId: string, request: AbandonStackRequest, runtime: Util.RuntimeOptions): AbandonStackResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'DELETE', 'AK', `/stacks/${stackName}/${stackId}/abandon`, null, request.headers, null, runtime);
}

async function abandonStack(stackName: string, stackId: string, request: AbandonStackRequest): AbandonStackResponse {
  var runtime = new Util.RuntimeOptions{};
  return abandonStackWithOptions(stackName, stackId, request, runtime);
}

model DescribeResourceTypesQuery = {
  supportStatus?: string(name='SupportStatus', description='SupportStatus '),
}

model DescribeResourceTypesRequest = {
  headers?: map[string]string(name='headers', description='headers'),
  query?: DescribeResourceTypesQuery(name='query', description='query'),
}

model DescribeResourceTypesResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function describeResourceTypesWithOptions(request: DescribeResourceTypesRequest, runtime: Util.RuntimeOptions): DescribeResourceTypesResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/resource_types`, Util.stringifyMapValue(request.query), request.headers, null, runtime);
}

async function describeResourceTypes(request: DescribeResourceTypesRequest): DescribeResourceTypesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourceTypesWithOptions(request, runtime);
}

model DescribeResourceTypeDetailRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model DescribeResourceTypeDetailResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function describeResourceTypeDetailWithOptions(typeName: string, request: DescribeResourceTypeDetailRequest, runtime: Util.RuntimeOptions): DescribeResourceTypeDetailResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/resource_types/${typeName}`, null, request.headers, null, runtime);
}

async function describeResourceTypeDetail(typeName: string, request: DescribeResourceTypeDetailRequest): DescribeResourceTypeDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourceTypeDetailWithOptions(typeName, request, runtime);
}

model DescribeResourcesRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model DescribeResourcesResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function describeResourcesWithOptions(stackName: string, stackId: string, request: DescribeResourcesRequest, runtime: Util.RuntimeOptions): DescribeResourcesResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/stacks/${stackName}/${stackId}/resources`, null, request.headers, null, runtime);
}

async function describeResources(stackName: string, stackId: string, request: DescribeResourcesRequest): DescribeResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourcesWithOptions(stackName, stackId, request, runtime);
}

model DescribeResourceDetailRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model DescribeResourceDetailResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function describeResourceDetailWithOptions(stackName: string, stackId: string, resourceName: string, request: DescribeResourceDetailRequest, runtime: Util.RuntimeOptions): DescribeResourceDetailResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/stacks/${stackName}/${stackId}/resources/${resourceName}`, null, request.headers, null, runtime);
}

async function describeResourceDetail(stackName: string, stackId: string, resourceName: string, request: DescribeResourceDetailRequest): DescribeResourceDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourceDetailWithOptions(stackName, stackId, resourceName, request, runtime);
}

model DescribeResourceTypeTemplateRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model DescribeResourceTypeTemplateResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function describeResourceTypeTemplateWithOptions(typeName: string, request: DescribeResourceTypeTemplateRequest, runtime: Util.RuntimeOptions): DescribeResourceTypeTemplateResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/resource_types/${typeName}/template`, null, request.headers, null, runtime);
}

async function describeResourceTypeTemplate(typeName: string, request: DescribeResourceTypeTemplateRequest): DescribeResourceTypeTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourceTypeTemplateWithOptions(typeName, request, runtime);
}

model DescribeStacksQuery = {
  status?: string(name='Status', description='Status'),
  name?: string(name='Name', description='Name'),
  stackId?: string(name='StackId', description='Id'),
  pageSize?: integer(name='PageSize', description='Limit'),
  pageNumber?: integer(name='PageNumber', description='PageNumber'),
}

model DescribeStacksRequest = {
  headers?: map[string]string(name='headers', description='headers'),
  query?: DescribeStacksQuery(name='query', description='query'),
}

model DescribeStacksResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function describeStacksWithOptions(request: DescribeStacksRequest, runtime: Util.RuntimeOptions): DescribeStacksResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/stacks`, Util.stringifyMapValue(request.query), request.headers, null, runtime);
}

async function describeStacks(request: DescribeStacksRequest): DescribeStacksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeStacksWithOptions(request, runtime);
}

model DescribeStackDetailRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model DescribeStackDetailResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function describeStackDetailWithOptions(stackName: string, stackId: string, request: DescribeStackDetailRequest, runtime: Util.RuntimeOptions): DescribeStackDetailResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/stacks/${stackName}/${stackId}`, null, request.headers, null, runtime);
}

async function describeStackDetail(stackName: string, stackId: string, request: DescribeStackDetailRequest): DescribeStackDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeStackDetailWithOptions(stackName, stackId, request, runtime);
}

model ValidateTemplateRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model ValidateTemplateResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function validateTemplateWithOptions(request: ValidateTemplateRequest, runtime: Util.RuntimeOptions): ValidateTemplateResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'POST', 'AK', `/validate`, null, request.headers, null, runtime);
}

async function validateTemplate(request: ValidateTemplateRequest): ValidateTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return validateTemplateWithOptions(request, runtime);
}

model DescribeTemplateRequest = {
  headers?: map[string]string(name='headers', description='headers'),
}

model DescribeTemplateResponse = {
  headers: map[string]string(name='headers', description='headers'),
}

async function describeTemplateWithOptions(stackName: string, stackId: string, request: DescribeTemplateRequest, runtime: Util.RuntimeOptions): DescribeTemplateResponse {
  Util.validateModel(request);
  return doRequest('2015-09-01', 'HTTPS', 'GET', 'AK', `/stacks/${stackName}/${stackId}/template`, null, request.headers, null, runtime);
}

async function describeTemplate(stackName: string, stackId: string, request: DescribeTemplateRequest): DescribeTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTemplateWithOptions(stackName, stackId, request, runtime);
}

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);
}
