diff --git a/utils/armClientGenerator/generator.ts b/utils/armClientGenerator/generator.ts index 794b3c9df..af0895460 100644 --- a/utils/armClientGenerator/generator.ts +++ b/utils/armClientGenerator/generator.ts @@ -207,7 +207,7 @@ async function main() { const methodParameters = parametersFromPath(path).filter(p => !constructorParameters.includes(p)); outputClient.push(` /* ${operation.description} */ - async ${camelize(methodName)} ( + async ${sanitize(camelize(methodName))} ( ${methodParameters.map(p => `${p}: string`).join(",\n")} ${bodyParam(bodyParameter, "Types")} ) : Promise<${responseType(operation, "Types")}> { @@ -217,18 +217,6 @@ async function main() { } }).then((response) => response.json()) } `); - // clients[clientName].functions.push(` - // /* ${operation.description} */ - // async ${camelize(methodName)} ( - // ${parametersFromPath(path)} - // ${bodyParam(bodyParameter, "Types")} - // ) : Promise<${responseType(operation, "Types")}> { - // return window.fetch(\`https://management.azure.com${path.replace(/{/g, "${")}\`, { method: "${method}", ${ - // bodyParameter ? "body: JSON.stringify(body)" : "" - // } }).then((response) => response.json()) - // } - // `); - // outputClient.push(clients[client].join("\n\n")); } } outputClient.push(`}`); @@ -250,6 +238,13 @@ function buildBasePath(strings: string[]) { return arrFirstElem.substring(0, i); } +function sanitize(name: string) { + if (name === "delete") { + return "destroy"; + } + return name; +} + function buildConstructor(client: Client) { const params = constructorParams(client); if (params.length === 0) {