@autorest/powershell 4.0.0-dev.6 → 4.0.0-dev.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/.rush/temp/package-deps_build.json +42 -33
  2. package/.rush/temp/shrinkwrap-deps.json +2 -2
  3. package/autorest-configuration-for-sdk.md +14 -2
  4. package/autorest-configuration.md +1 -0
  5. package/dist/cmdlets/class.d.ts.map +1 -1
  6. package/dist/cmdlets/class.js +42 -6
  7. package/dist/cmdlets/class.js.map +1 -1
  8. package/dist/internal/powershell-declarations.d.ts +1 -0
  9. package/dist/internal/powershell-declarations.d.ts.map +1 -1
  10. package/dist/internal/powershell-declarations.js +2 -1
  11. package/dist/internal/powershell-declarations.js.map +1 -1
  12. package/dist/internal/project.d.ts +1 -0
  13. package/dist/internal/project.d.ts.map +1 -1
  14. package/dist/internal/project.js +27 -12
  15. package/dist/internal/project.js.map +1 -1
  16. package/dist/llcsharp/code-model.d.ts +1 -0
  17. package/dist/llcsharp/code-model.d.ts.map +1 -1
  18. package/dist/llcsharp/operation/method.js +2 -1
  19. package/dist/llcsharp/operation/method.js.map +1 -1
  20. package/dist/main.d.ts.map +1 -1
  21. package/dist/main.js +4 -0
  22. package/dist/main.js.map +1 -1
  23. package/dist/plugins/plugin-create-inline-properties.js +1 -1
  24. package/dist/plugins/plugin-create-inline-properties.js.map +1 -1
  25. package/dist/plugins/powershell-v2.d.ts.map +1 -1
  26. package/dist/plugins/powershell-v2.js +5 -10
  27. package/dist/plugins/powershell-v2.js.map +1 -1
  28. package/dist/plugins/sdk-create-inline-properties.d.ts +4 -0
  29. package/dist/plugins/sdk-create-inline-properties.d.ts.map +1 -0
  30. package/dist/plugins/sdk-create-inline-properties.js +526 -0
  31. package/dist/plugins/sdk-create-inline-properties.js.map +1 -0
  32. package/dist/plugins/sdk-cs-namer.d.ts.map +1 -1
  33. package/dist/plugins/sdk-cs-namer.js +178 -14
  34. package/dist/plugins/sdk-cs-namer.js.map +1 -1
  35. package/dist/plugins/sdk-cs-simplifier.d.ts +3 -0
  36. package/dist/plugins/sdk-cs-simplifier.d.ts.map +1 -0
  37. package/dist/plugins/sdk-cs-simplifier.js +154 -0
  38. package/dist/plugins/sdk-cs-simplifier.js.map +1 -0
  39. package/dist/plugins/sdk-generate.d.ts.map +1 -1
  40. package/dist/plugins/sdk-generate.js +49 -3
  41. package/dist/plugins/sdk-generate.js.map +1 -1
  42. package/dist/plugins/sdk-tweak-model.d.ts.map +1 -1
  43. package/dist/plugins/sdk-tweak-model.js +188 -37
  44. package/dist/plugins/sdk-tweak-model.js.map +1 -1
  45. package/dist/sdk/project.d.ts +1 -0
  46. package/dist/sdk/project.d.ts.map +1 -1
  47. package/dist/sdk/project.js +11 -0
  48. package/dist/sdk/project.js.map +1 -1
  49. package/dist/sdk/utility.d.ts +27 -0
  50. package/dist/sdk/utility.d.ts.map +1 -1
  51. package/dist/sdk/utility.js +402 -5
  52. package/dist/sdk/utility.js.map +1 -1
  53. package/dist/utils/SdkModel.d.ts.map +1 -1
  54. package/dist/utils/SdkModel.js.map +1 -1
  55. package/dist/utils/TrieNode.d.ts +10 -0
  56. package/dist/utils/TrieNode.d.ts.map +1 -0
  57. package/dist/utils/TrieNode.js +45 -0
  58. package/dist/utils/TrieNode.js.map +1 -0
  59. package/dist/utils/WrapComments.d.ts +2 -0
  60. package/dist/utils/WrapComments.d.ts.map +1 -0
  61. package/dist/utils/WrapComments.js +46 -0
  62. package/dist/utils/WrapComments.js.map +1 -0
  63. package/dist/utils/code-namer.d.ts +3 -0
  64. package/dist/utils/code-namer.d.ts.map +1 -0
  65. package/dist/utils/code-namer.js +38 -0
  66. package/dist/utils/code-namer.js.map +1 -0
  67. package/dist/utils/schema.d.ts +4 -0
  68. package/dist/utils/schema.d.ts.map +1 -1
  69. package/dist/utils/schema.js +28 -1
  70. package/dist/utils/schema.js.map +1 -1
  71. package/package.json +1 -1
  72. package/resources/assets/build-module.ps1 +9 -1
  73. package/resources/assets/generate-portal-ux.ps1 +379 -0
  74. package/resources/psruntime/BuildTime/PsAttributes.cs +7 -0
  75. package/resources/templates/azureMethod.ejs +3 -2
  76. package/resources/templates/azureMethodGroup.ejs +2 -1
  77. package/resources/templates/azureServiceClient.ejs +13 -4
  78. package/resources/templates/enum.ejs +73 -0
  79. package/resources/templates/exception.ejs +52 -0
  80. package/resources/templates/extensionMethod.ejs +22 -11
  81. package/resources/templates/extensions.ejs +4 -4
  82. package/resources/templates/longRunningOperationMethod.ejs +43 -0
  83. package/resources/templates/method.ejs +21 -2
  84. package/resources/templates/methodBodyRestCall.ejs +154 -20
  85. package/resources/templates/methodGroupInterface.ejs +28 -4
  86. package/resources/templates/model.ejs +133 -20
  87. package/resources/templates/page.ejs +40 -0
  88. package/resources/templates/serviceClientBody.ejs +12 -14
  89. package/resources/templates/serviceClientInterface.ejs +4 -3
  90. package/resources/templates/methodGroup.ejs +0 -7
@@ -1,4 +1,5 @@
1
1
  <%- project.commentHeader %>
2
+ <% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
2
3
 
3
4
  namespace <%- project.namespace %>
4
5
  {
@@ -6,7 +7,7 @@ namespace <%- project.namespace %>
6
7
  using <%- using %>;
7
8
  <% }); -%>
8
9
 
9
- <% var typeName = methodGroup.$key + 'Operations' -%>
10
+ <% var typeName = project.helper.PascalCase(key) + 'Operations' -%>
10
11
  /// <summary>
11
12
  /// <%- typeName %> operations.
12
13
  /// </summary>
@@ -23,31 +24,54 @@ namespace <%- project.namespace %>
23
24
  /// <%= method.language.default.description%>
24
25
  /// </remarks>
25
26
  <% };-%>
26
- <% method.parameters.filter(p=>p.implementation != 'Client').forEach(function(parameter){-%>
27
+ <% if(!method.language.default.pageable?.nextPageOperation) {-%>
28
+ <% method.parameters.filter(p=>p.implementation != 'Client' && !project.helper.IsConstantParameter(p)).forEach(function(parameter){-%>
27
29
  /// <param name='<%-parameter.language.default.name%>'>
28
30
  /// <%= parameter.language.default.description%>
29
31
  /// </param>
30
32
  <% }); -%>
33
+ <% (method.requests[0].parameters || []).filter(p=>p.protocol.http.in == 'body' && !project.helper.IsConstantParameter(p)).forEach(function(parameter){-%>
34
+ <%if(parameter.extensions && parameter.extensions['x-ms-client-flatten'] ) {-%>
35
+ <%project.helper.GetAllPublicVirtualProperties(parameter.schema.language.default.virtualProperties).filter(p => !project.helper.IsConstantProperty(p)).forEach(function(vp) {-%>
36
+ /// <param name='<%-vp.property.language.default.name%>'>
37
+ /// <%= vp.property.language.default.description%>
38
+ /// </param>
39
+ <%});-%>
40
+ <%} else {-%>
41
+ /// <param name='<%-parameter.language.default.name%>'>
42
+ /// <%= parameter.language.default.description%>
43
+ /// </param>
44
+ <%}-%>
45
+ <% });-%>
46
+ <% };-%>
47
+ <% if(method.language.default.pageable?.nextPageOperation) {-%>
48
+ /// <param name='nextPageLink'>
49
+ /// The NextLink from the previous successful call to List operation.
50
+ /// </param>
51
+ <% } -%>
31
52
  /// <param name='customHeaders'>
32
53
  /// The headers that will be added to request.
33
54
  /// </param>
34
55
  /// <param name='cancellationToken'>
56
+ /// The cancellation token.
35
57
  /// </param>
36
58
  <%# ToDo: Need to figure out whether we could hand code the exception here -%>
37
59
  /// <exception cref="Microsoft.Rest.Azure.CloudException">
60
+ /// Thrown when the operation returned an invalid status code
38
61
  /// </exception>
39
- <% if (method.responses.filter(r => r.schema).length > 0) {-%>
62
+ <% if ((method.responses || []).filter(r => r.schema).length > 0) {-%>
40
63
  /// <exception cref="Microsoft.Rest.SerializationException">
41
64
  /// Thrown when unable to deserialize the response
42
65
  /// </exception>
43
66
  <% }; -%>
44
- <% if (method.parameters.filter(p => p.required && p.nullable).length > 0) {-%>
67
+ <% if (method.parameters.filter(p => p.required && p.nullable).length > 0 || (method.requests[0].parameters || []).filter(p => p.required && p.nullable).length > 0) {-%>
45
68
  /// <exception cref="Microsoft.Rest.ValidationException">
46
69
  /// Thrown when a required parameter is null
47
70
  /// </exception>
48
71
  <% }; -%>
49
72
  <%# ToDo: support GetObsoleteAttribute, deprecated message?-%>
50
73
  System.Threading.Tasks.Task<<%-method.language.default.responseType %>> <%- method.language.default.name%>WithHttpMessagesAsync(<%-method.language.default.asyncMethodParameterDeclarationWithCustomHeader%>);
74
+
51
75
  <% }); -%>
52
76
  }
53
77
  }
@@ -7,47 +7,86 @@ namespace <%- project.namespace %>.Models
7
7
  <%# ToDo: need to populate effectiveDocumentation in the model-%>
8
8
  <% if (model.language.default.description) {-%>
9
9
  /// <summary>
10
- /// <%=model.language.default.description%>
10
+ /// <%=wrapComments(' ', '/// ', model.language.default.description)%>
11
11
  /// </summary>
12
12
  <% }-%>
13
13
  <% if (model.summary && model.language.default.description) { -%>
14
14
  /// <remarks>
15
- /// <%=model.language.default.description %>
15
+ /// <%=wrapComments(' ', '/// ', model.language.default.description)%>
16
16
  /// </remarks>
17
17
  <% } -%>
18
18
  <%# ToDo: support NeedsPolymorphicConverter-%>
19
- <%# ToDo: support NeedsTransformationConverter-%>
19
+ <% if (model.discriminatorValue || model.discriminator) {-%>
20
+ [Newtonsoft.Json.JsonObject("<%-model.discriminatorValue || project.helper.PascalCase(model.language.default.name)%>")]
21
+ <% } -%>
22
+ <% if(project.helper.NeedsTransformationConverter(model)) {-%>
23
+ [Microsoft.Rest.Serialization.JsonTransformation]
24
+ <% }-%>
20
25
  <%# ToDo: support ObsoleteAttribute-%>
21
- public partial class <%-model.language.default.name%><%- model.parents ? " : " + model.parents.immediate[0].language.default.name: ""%>
26
+ public partial class <%-model.language.default.name%><%- (model.extensions && model.extensions["x-ms-azure-resource"]) ? " : Microsoft.Rest.Azure.IResource": (model.parents && model.parents.immediate.length == 1) ? " : " + model.parents.immediate[0].language.default.name: ""%>
22
27
  {
23
28
  /// <summary>
24
29
  /// Initializes a new instance of the <%= model.language.default.name%> class.
25
30
  /// </summary>
26
31
  public <%- model.language.default.name%>()
27
32
  {
28
- <%#ToDo support for object model that contains ContainsConstantProperties-%>
33
+ <%#support for object model that contains ContainsConstantProperties-%>
34
+ <% if (model.properties || model.parents) {-%>
35
+ <%project.helper.GetAllPublicVirtualProperties(model.language.default.virtualProperties).filter(p => p.required && p.property.schema.type === 'object' && project.helper.HasConstantProperty(p.property.schema)).forEach(function(p) {-%>
36
+ this.<%-p.name%> = new <%-p.property.schema.language.csharp.fullname%>();
37
+ <%});-%>
38
+ <%}-%>
29
39
  CustomInit();
30
40
  }
31
41
  <%#ToDo support for constructorParameters in the model, the constructorParameter is mapped to properties for the time being%>
32
- <% if (model.properties) {-%>
42
+ <% if ((model.properties || []).filter(p => !p.isDiscriminator).length > 0 || model.parents) {-%>
33
43
  /// <summary>
34
44
  /// Initializes a new instance of the <%=model.language.default.name%> class.
35
45
  /// </summary>
36
- <%#ToDo support for constructorParametersDocumentation in the model, priority 0-%>
37
- <%model.properties.forEach(function(p) {-%>
38
- /// <param name="<%-p.language.default.name%>"><%-p.language.default.description%></param>
46
+ <%project.helper.GetAllPublicVirtualProperties(model.language.default.virtualProperties).filter(p => !project.helper.IsConstantProperty(p)).forEach(function(p) {-%>
47
+ <%
48
+ var additionInfo = '';
49
+ if (p.property.schema.type == 'sealed-choice' || p.property.schema.type == 'choice')
50
+ {
51
+ additionInfo = ' Possible values include: ';
52
+ choices = p.property.schema.choices.map(c => `'${c.value}'`);
53
+ additionInfo = additionInfo + choices.join(', ');
54
+ }
55
+ %>
56
+ /// <param name="<%-project.helper.CamelCase(p.name)%>"><%=wrapComments(' ', '/// ', p.property.language.default.description)%>
57
+ /// <%-wrapComments(' ', '/// ', additionInfo)%></param>
39
58
  <%});-%>
40
59
  public <%- model.language.default.name%>(<%-model.language.default.constructorParametersDeclaration%>)
41
- <%#ToDo support for BaseConstructorCall in the model-%>
60
+ <%# If there is only one direct parent, will implement it as parent%>
61
+ <% var publicVirtualProperties = project.helper.GetAllPublicVirtualProperties(model.language.default.virtualProperties);
62
+ if (model.language.default.baseConstructorCall) {
63
+ publicVirtualProperties = project.helper.GetAllPublicVirtualPropertiesWithoutInherited(model.language.default.virtualProperties);
64
+ -%>
65
+ : <%-model.language.default.baseConstructorCall%>
66
+ <%}-%>
42
67
  {
43
68
  <%#ToDo support for InstanceProperties in the model, non const properties, priority 0-%>
44
- <%model.properties.forEach(function(p) {-%>
45
- this.<%-p.language.csharp.name%> = <%-p.language.default.name%>;
69
+ <%publicVirtualProperties.filter(p => !project.helper.IsConstantProperty(p)).forEach(function(p) {-%>
70
+ this.<%-p.name%> = <%-project.helper.CamelCase(p.name)%>;
46
71
  <%});-%>
47
72
  CustomInit();
48
73
  }
49
74
  <% };-%>
50
- <%#ToDo support for ClassProperties in the model, const properties-%>
75
+ <%#Below is support for ClassProperties in the model, const properties-%>
76
+ <% const constantProperties = (publicVirtualProperties || []).filter(p => p.property.schema.type === 'constant' || project.helper.IsConstantProperty(p));
77
+ if (constantProperties.length > 0) {-%>
78
+ /// <summary>
79
+ /// Static constructor for <%-model.language.default.name%> class.
80
+ /// </summary>
81
+ static <%-model.language.default.name%>()
82
+ {
83
+ <% constantProperties.forEach(function(p) {
84
+ const quote = p.property.schema.choiceType.type !== 'string' ? '' : '"';
85
+ -%>
86
+ <%-p.name%> = <%-quote + p.property.schema.choices[0].value + quote%>;
87
+ <%});-%>
88
+ }
89
+ <% } -%>
51
90
 
52
91
  /// <summary>
53
92
  /// An initialization method that performs custom operations like setting defaults
@@ -55,17 +94,91 @@ namespace <%- project.namespace %>.Models
55
94
  partial void CustomInit();
56
95
 
57
96
  <%#ToDo support for InstanceProperties in the model, non const properties, priority 0, line 407-%>
58
- <% if (model.properties) { model.properties.filter(p => p.schema.type != 'constant').forEach(function(p){-%>
97
+ <% (publicVirtualProperties || []).filter(p => p.property.schema.type != 'constant' && !project.helper.IsConstantProperty(p)).forEach(function(p){-%>
98
+ <%
99
+ var additionInfo = '';
100
+ if (p.property.schema.type == 'sealed-choice' || p.property.schema.type == 'choice')
101
+ {
102
+ additionInfo = ' Possible values include: ';
103
+ choices = p.property.schema.choices.map(c => `'${c.value}'`);
104
+ additionInfo = additionInfo + choices.join(', ');
105
+ }
106
+ %>
107
+ /// <summary>
108
+ /// <%=wrapComments(' ', '/// ', p.property.language.csharp.formattedPropertySummary)%><%=additionInfo%>
109
+ /// </summary>
110
+ <% (p.property.schema.language.csharp.jsonConverters || []).forEach(function(ct) {-%>
111
+ [Newtonsoft.Json.JsonConverter(typeof(<%-ct%>))]
112
+ <% });-%>
113
+ <% if (model.extensions && model.extensions['x-ms-parameter-grouping']) {-%>
114
+ [Newtonsoft.Json.JsonIgnore]
115
+ <%} else if (p.property.language.default.flavor) {-%>
116
+ <%
117
+ switch(p.property.language.default.flavor) {
118
+ case 'additionalProperties':-%>
119
+ [Newtonsoft.Json.JsonExtensionData]
120
+ <% break;
121
+ default:
122
+ break;
123
+ }-%>
124
+ <% } else {-%>
125
+ [Newtonsoft.Json.JsonProperty(PropertyName = "<%-p.serializedName%>")]
126
+ <% } -%>
127
+ <% var type = p.property.schema.language.csharp.fullname-%>
128
+ <%type = (!project.helper.IsValueType(p.property.schema.type) && !project.helper.IsEnum(p.property.schema) && !(p.property.schema.choiceType && project.helper.IsValueType(p.property.schema.choiceType.type))) || p.required ? type : type + '?'-%>
129
+ public <%-type %> <%-p.name%> {get; <%- p.readOnly ? "private " : ""-%>set; }
130
+ <% }); -%>
131
+ <%#Below is support for ClassProperties in the model, const properties -%>
132
+ <% (publicVirtualProperties || []).filter(p => p.property.schema.type === 'constant' || project.helper.IsConstantProperty(p)).forEach(function(p){-%>
59
133
  /// <summary>
60
- /// <%-p.language.csharp.formattedPropertySummary%>
134
+ /// <%=p.property.language.csharp.formattedPropertySummary%>
61
135
  /// </summary>
136
+ <% (p.property.schema.language.csharp.jsonConverters || []).forEach(function(ct) {-%>
137
+ [Newtonsoft.Json.JsonConverter(typeof(<%-ct%>))]
138
+ <% });-%>
139
+ <% if (model.extensions && model.extensions['x-ms-parameter-grouping']) {-%>
140
+ [Newtonsoft.Json.JsonIgnore]
141
+ <% } else {-%>
62
142
  [Newtonsoft.Json.JsonProperty(PropertyName = "<%-p.serializedName%>")]
63
- <% var type = p.schema.language.csharp.fullname-%>
64
- <%type = p.schema.type == 'object' || type == 'string' ? type : type + '?'-%>
65
- public <%-type %> <%-p.language.csharp.name%> {get; <%- p.readOnly ? "private " : ""-%>set; }
66
- <% });} -%>
67
- <%#ToDo support for ClassProperties in the model, const properties -%>
143
+ <% } -%>
144
+ <% var type = p.property.schema.type === 'constant' ? p.property.schema.language.csharp.fullname : project.helper.GetCsharpType(p.property.schema.choiceType)-%>
145
+ public static <%-type %> <%-p.name%> {get; private set; }
146
+ <%});-%>
68
147
  <%#ToDo support for ShouldValidateChain-%>
148
+ <% if (project.helper.ShouldValidateChain(model)) {
149
+ var methodQualifier = model.parents && model.parents.immediate.length == 1 && project.helper.ShouldValidateChain(model.parents.immediate[0]) ? "override" : "virtual";
150
+ var anythingToValidate = false;-%>
151
+ /// <summary>
152
+ /// Validate the object.
153
+ /// </summary>
154
+ /// <exception cref="Microsoft.Rest.ValidationException">
155
+ /// Thrown if validation fails
156
+ /// </exception>
157
+ public <%-methodQualifier%> void Validate()
158
+ {
159
+ <% if (model.parents && model.parents.immediate.length == 1 && project.helper.ShouldValidateChain(model.parents.immediate[0])) {
160
+ anythingToValidate = true;
161
+ -%>
162
+ base.Validate();
163
+ <% } -%>
164
+ <%publicVirtualProperties.filter(p=> p.required && !p.readOnly && !project.helper.IsValueType(p.property.schema.type) && !project.helper.IsConstantProperty(p) && !project.helper.IsEnum(p.property.schema)).forEach(function(p) {
165
+ anythingToValidate = true;
166
+ -%>
167
+ if (this.<%-p.name%> == null)
168
+ {
169
+ throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "<%-p.name%>");
170
+ }
171
+ <%});-%>
172
+ <%publicVirtualProperties.filter(p=> project.helper.HasConstrains(p.property.schema) || !project.helper.IsValueType(p.property.schema.type)).forEach(function(p) {
173
+ anythingToValidate = true;
174
+ -%>
175
+ <%-project.helper.ValidateType(p.property.schema, model, `this.${p.name}`, !project.helper.IsValueType(p.property.schema.type) || !p.required)%>
176
+ <% }); -%>
177
+ <% if(!anythingToValidate) { -%>
178
+ //Nothing to validate
179
+ <% } -%>
180
+ }
181
+ <% } -%>
69
182
  <%#ToDo support for ShouldGenerateXmlSerialization, guess we do not need to support it-%>
70
183
  }
71
184
  }
@@ -0,0 +1,40 @@
1
+ <%- project.commentHeader %>
2
+
3
+ namespace <%- project.namespace %>.Models
4
+ {
5
+
6
+ /// <summary>
7
+ /// Defines a page in Azure responses.
8
+ /// </summary>
9
+ /// <typeparam name="T">Type of the page content items</typeparam>
10
+ [Newtonsoft.Json.JsonObject]
11
+ public class <%-page.className%><T> : Microsoft.Rest.Azure.IPage<T>
12
+ {
13
+ /// <summary>
14
+ /// Gets the link to the next page.
15
+ /// </summary>
16
+ [Newtonsoft.Json.JsonProperty("<%-page.nextLinkName%>")]
17
+ public System.String NextPageLink { get; private set; }
18
+
19
+ [Newtonsoft.Json.JsonProperty("<%-page.itemName%>")]
20
+ private System.Collections.Generic.IList<T> Items{ get; set; }
21
+
22
+ /// <summary>
23
+ /// Returns an enumerator that iterates through the collection.
24
+ /// </summary>
25
+ /// <returns>A an enumerator that can be used to iterate through the collection.</returns>
26
+ public System.Collections.Generic.IEnumerator<T> GetEnumerator()
27
+ {
28
+ return (Items == null) ? System.Linq.Enumerable.Empty<T>().GetEnumerator() : Items.GetEnumerator();
29
+ }
30
+
31
+ /// <summary>
32
+ /// Returns an enumerator that iterates through the collection.
33
+ /// </summary>
34
+ /// <returns>A an enumerator that can be used to iterate through the collection.</returns>
35
+ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
36
+ {
37
+ return GetEnumerator();
38
+ }
39
+ }
40
+ }
@@ -11,7 +11,7 @@
11
11
  /// Gets or sets json deserialization settings.
12
12
  /// </summary>
13
13
  public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; }
14
- <% project.model.globalParameters.filter(p=>p.language.default.name != '$host').forEach(function(parameter) {-%>
14
+ <% (project.model.globalParameters || []).filter(p=>p.language.default.name != '$host').forEach(function(parameter) {-%>
15
15
  /// <summary>
16
16
  /// <%=parameter.language.default.description%>
17
17
  /// </summary>
@@ -24,10 +24,11 @@
24
24
  <% }%>
25
25
  <%});-%>
26
26
  <% project.model.operationGroups.forEach(function(methodGroup){ -%>
27
+ <% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
27
28
  /// <summary>
28
- /// Gets the I<%- methodGroup.$key %>Operations
29
+ /// Gets the I<%- project.helper.PascalCase(key) %>Operations
29
30
  /// </summary>
30
- public virtual I<%- methodGroup.$key %>Operations <%- methodGroup.$key %> { get; private set; }
31
+ public virtual I<%- project.helper.PascalCase(key) %>Operations <%- project.helper.PascalCase(methodGroup.$key) %> { get; private set; }
31
32
  <% }); -%>
32
33
  /// <summary>
33
34
  /// Initializes a new instance of the <%-project.model.info.title%> class.
@@ -112,13 +113,13 @@
112
113
  this.BaseUri = baseUri;
113
114
  }
114
115
  <% } -%>
115
- <% var parameters = project.model.globalParameters.filter(p => p.required && p.readOnly)
116
+ <% var parameters = (project.model.globalParameters || []).filter(p => p.required && p.readOnly)
116
117
  if (parameters.length > 0) {-%>
117
118
  /// <summary>
118
119
  /// Initializes a new instance of the <%-project.model.info.title%> class.
119
120
  /// </summary>
120
- <%parameters.forEach(function(parameter){-%>
121
- /// <param name='<%-project.helper.CamelCase(parameter.language.default.name)%>'
121
+ <%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter){-%>
122
+ /// <param name='<%-project.helper.CamelCase(parameter.language.default.name)%>'>
122
123
  /// Required. <%-parameter.language.default.description%>
123
124
  /// </param>
124
125
  <%});-%>
@@ -150,7 +151,7 @@ if (parameters.length > 0) {-%>
150
151
  /// <summary>
151
152
  /// Initializes a new instance of the <%-project.model.info.title%> class.
152
153
  /// </summary>
153
- <%parameters.forEach(function(parameter) {-%>
154
+ <%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter) {-%>
154
155
  /// <param name="<%-project.helper.CamelCase(parameter.language.default.name)%>">
155
156
  /// Required. <%-parameter.language.default.description%>
156
157
  /// </param>
@@ -184,7 +185,7 @@ if (parameters.length > 0) {-%>
184
185
  /// <summary>
185
186
  /// Initializes a new instance of the <%-project.model.info.title%> class.
186
187
  /// </summary>
187
- <%parameters.forEach(function(parameter) {-%>
188
+ <%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter) {-%>
188
189
  /// <param name="<%-project.helper.CamelCase(parameter.language.default.name)%>">
189
190
  /// Required. <%-parameter.language.default.description%>
190
191
  /// </param>
@@ -224,14 +225,11 @@ if (parameters.length > 0) {-%>
224
225
  /// <param name='baseUri'>
225
226
  /// Optional. The base URI of the service.
226
227
  /// </param>
227
- <%parameters.forEach(function(parameter) {-%>
228
+ <%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter) {-%>
228
229
  /// <param name="<%-project.helper.CamelCase(parameter.language.default.name)%>">
229
230
  /// Required. <%-parameter.language.default.description%>
230
231
  /// </param>
231
232
  <%});-%>
232
- /// <param name='rootHandler'>
233
- /// Optional. The http client handler used to handle http transport.
234
- /// </param>
235
233
  /// <param name='handlers'>
236
234
  /// Optional. The delegating handlers to add to the http client pipeline.
237
235
  /// </param>
@@ -267,7 +265,7 @@ if (parameters.length > 0) {-%>
267
265
  /// <param name='baseUri'>
268
266
  /// Optional. The base URI of the service.
269
267
  /// </param>
270
- <%parameters.forEach(function(parameter) {-%>
268
+ <%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter) {-%>
271
269
  /// <param name="<%-project.helper.CamelCase(parameter.language.default.name)%>">
272
270
  /// Required. <%-parameter.language.default.description%>
273
271
  /// </param>
@@ -302,4 +300,4 @@ if (parameters.length > 0) {-%>
302
300
  <%});-%>
303
301
  }
304
302
  <%}-%>
305
- <% }-%>
303
+ <% }-%>
@@ -28,7 +28,7 @@ namespace <%- project.namespace %>
28
28
  /// </summary>
29
29
  Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; }
30
30
 
31
- <% project.model.globalParameters.filter(p => p.language.default.name != '$host').forEach(function(parameter){ -%>
31
+ <% (project.model.globalParameters || []).filter(p => p.language.default.name != '$host').forEach(function(parameter){ -%>
32
32
  /// <summary>
33
33
  /// <%- parameter.language.default.description %>
34
34
  /// </summary>
@@ -43,10 +43,11 @@ namespace <%- project.namespace %>
43
43
 
44
44
  <% }); -%>
45
45
  <% project.model.operationGroups.forEach(function(methodGroup){ -%>
46
+ <% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
46
47
  /// <summary>
47
- /// Gets the I<%- methodGroup.$key %>Operations
48
+ /// Gets the I<%- project.helper.PascalCase(key) %>Operations
48
49
  /// </summary>
49
- I<%- methodGroup.$key %>Operations <%- methodGroup.$key %> { get; }
50
+ I<%- project.helper.PascalCase(key) %>Operations <%- project.helper.PascalCase(methodGroup.$key) %> { get; }
50
51
 
51
52
  <% }); -%>
52
53
  <%# ToDo: Add method whose group is empty, and need to check in which case the group is empty.-%>
@@ -1,7 +0,0 @@
1
- namespace Microsoft.Azure.PowerShell.Cmdlets {
2
- <% methodGroup.operations.forEach(function(method){ %>
3
- <%- include('method', {method: method}) -%>
4
-
5
- <% }); %>
6
- }
7
-