Handle the case method group ends with Operations (#1255)
This commit is contained in:
Родитель
7b79c36156
Коммит
bd9ad4e254
|
@ -1,5 +1,5 @@
|
|||
<%- project.commentHeader %>
|
||||
<% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
|
||||
<% var key = project.helper.ConvertToValidMethodGroupKey(methodGroup.$key)-%>
|
||||
|
||||
namespace <%- project.namespace %>
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace <%- project.namespace %>
|
|||
private void Initialize()
|
||||
{
|
||||
<% project.model.operationGroups.filter(methodGroup => methodGroup.$key != '').forEach(function(methodGroup){ -%>
|
||||
<% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
|
||||
<% var key = project.helper.ConvertToValidMethodGroupKey(methodGroup.$key)-%>
|
||||
this.<%- project.helper.PascalCase(methodGroup.$key) %> = new <%- project.helper.PascalCase(key) %>Operations(this);
|
||||
<% }); -%>
|
||||
this.BaseUri = new System.Uri("https://management.azure.com");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
|
||||
<% var key = project.helper.ConvertToValidMethodGroupKey(methodGroup.$key)-%>
|
||||
<% var OperationsName = clientName != '' ? clientName : project.helper.PascalCase(key) + 'Operations'-%>
|
||||
<%# ToDo: currently assume the SyncMethodsGenerationMode is Essential type, and need to add support for other types -%>
|
||||
/// <summary>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%- project.commentHeader %>
|
||||
<% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
|
||||
<% var key = project.helper.ConvertToValidMethodGroupKey(methodGroup.$key)-%>
|
||||
namespace <%- project.namespace %>
|
||||
{
|
||||
<% project.model.usings.forEach(function(using){ -%>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%- project.commentHeader %>
|
||||
<% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
|
||||
<% var key = project.helper.ConvertToValidMethodGroupKey(methodGroup.$key)-%>
|
||||
|
||||
namespace <%- project.namespace %>
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<% }%>
|
||||
<%});-%>
|
||||
<% project.model.operationGroups.filter(methodGroup => methodGroup.$key != '').forEach(function(methodGroup){ -%>
|
||||
<% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
|
||||
<% var key = project.helper.ConvertToValidMethodGroupKey(methodGroup.$key)-%>
|
||||
/// <summary>
|
||||
/// Gets the I<%- project.helper.PascalCase(key) %>Operations
|
||||
/// </summary>
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace <%- project.namespace %>
|
|||
|
||||
<% }); -%>
|
||||
<% project.model.operationGroups.filter(methodGroup => methodGroup.$key != '').forEach(function(methodGroup){ -%>
|
||||
<% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
|
||||
<% var key = project.helper.ConvertToValidMethodGroupKey(methodGroup.$key)-%>
|
||||
/// <summary>
|
||||
/// Gets the I<%- project.helper.PascalCase(key) %>Operations
|
||||
/// </summary>
|
||||
|
|
|
@ -422,6 +422,10 @@ export class Helper {
|
|||
return false;
|
||||
}
|
||||
|
||||
public ConvertToValidMethodGroupKey(key: string): string {
|
||||
return key.replace(/Operations$/, '');
|
||||
}
|
||||
|
||||
private isCloudErrorName(name: string): boolean {
|
||||
// This is to work around the fact that some CloudError will be generated as CloudErrorAutoGenerated in m4
|
||||
const reg = new RegExp('^CloudErrorAutoGenerated\\d{0,1}$');
|
||||
|
|
Загрузка…
Ссылка в новой задаче