@autorest/powershell 4.0.0-dev.6 → 4.0.0-dev.8
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.
- package/.rush/temp/package-deps_build.json +70 -60
- package/.rush/temp/shrinkwrap-deps.json +2 -2
- package/autorest-configuration-for-sdk.md +14 -2
- package/autorest-configuration.md +2 -1
- package/dist/cmdlets/class.d.ts +3 -0
- package/dist/cmdlets/class.d.ts.map +1 -1
- package/dist/cmdlets/class.js +157 -33
- package/dist/cmdlets/class.js.map +1 -1
- package/dist/cmdlets/namespace.d.ts.map +1 -1
- package/dist/cmdlets/namespace.js +1 -0
- package/dist/cmdlets/namespace.js.map +1 -1
- package/dist/generators/psm1.js +1 -1
- package/dist/generators/script-cmdlet.js +1 -1
- package/dist/internal/powershell-declarations.d.ts +1 -0
- package/dist/internal/powershell-declarations.d.ts.map +1 -1
- package/dist/internal/powershell-declarations.js +2 -1
- package/dist/internal/powershell-declarations.js.map +1 -1
- package/dist/internal/project.d.ts +10 -2
- package/dist/internal/project.d.ts.map +1 -1
- package/dist/internal/project.js +31 -14
- package/dist/internal/project.js.map +1 -1
- package/dist/llcsharp/clientruntime.d.ts +1 -0
- package/dist/llcsharp/clientruntime.d.ts.map +1 -1
- package/dist/llcsharp/clientruntime.js +1 -0
- package/dist/llcsharp/clientruntime.js.map +1 -1
- package/dist/llcsharp/code-model.d.ts +1 -0
- package/dist/llcsharp/code-model.d.ts.map +1 -1
- package/dist/llcsharp/csharp-declarations.d.ts +1 -0
- package/dist/llcsharp/csharp-declarations.d.ts.map +1 -1
- package/dist/llcsharp/csharp-declarations.js +2 -1
- package/dist/llcsharp/csharp-declarations.js.map +1 -1
- package/dist/llcsharp/model/model-class.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class.js +27 -11
- package/dist/llcsharp/model/model-class.js.map +1 -1
- package/dist/llcsharp/operation/method.js +2 -1
- package/dist/llcsharp/operation/method.js.map +1 -1
- package/dist/llcsharp/schema/array.js +7 -7
- package/dist/llcsharp/schema/array.js.map +1 -1
- package/dist/llcsharp/schema/fixed-array.d.ts +42 -0
- package/dist/llcsharp/schema/fixed-array.d.ts.map +1 -0
- package/dist/llcsharp/schema/fixed-array.js +251 -0
- package/dist/llcsharp/schema/fixed-array.js.map +1 -0
- package/dist/llcsharp/schema/schema-resolver.d.ts +1 -1
- package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.js +9 -2
- package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -0
- package/dist/main.js.map +1 -1
- package/dist/plugins/cs-namer-v2.d.ts.map +1 -1
- package/dist/plugins/cs-namer-v2.js +10 -7
- package/dist/plugins/cs-namer-v2.js.map +1 -1
- package/dist/plugins/plugin-create-inline-properties.js +1 -1
- package/dist/plugins/plugin-create-inline-properties.js.map +1 -1
- package/dist/plugins/powershell-v2.d.ts.map +1 -1
- package/dist/plugins/powershell-v2.js +5 -10
- package/dist/plugins/powershell-v2.js.map +1 -1
- package/dist/plugins/sdk-create-inline-properties.d.ts +4 -0
- package/dist/plugins/sdk-create-inline-properties.d.ts.map +1 -0
- package/dist/plugins/sdk-create-inline-properties.js +552 -0
- package/dist/plugins/sdk-create-inline-properties.js.map +1 -0
- package/dist/plugins/sdk-cs-namer.d.ts.map +1 -1
- package/dist/plugins/sdk-cs-namer.js +186 -14
- package/dist/plugins/sdk-cs-namer.js.map +1 -1
- package/dist/plugins/sdk-cs-simplifier.d.ts +3 -0
- package/dist/plugins/sdk-cs-simplifier.d.ts.map +1 -0
- package/dist/plugins/sdk-cs-simplifier.js +154 -0
- package/dist/plugins/sdk-cs-simplifier.js.map +1 -0
- package/dist/plugins/sdk-generate.d.ts.map +1 -1
- package/dist/plugins/sdk-generate.js +49 -3
- package/dist/plugins/sdk-generate.js.map +1 -1
- package/dist/plugins/sdk-tweak-model.d.ts.map +1 -1
- package/dist/plugins/sdk-tweak-model.js +196 -37
- package/dist/plugins/sdk-tweak-model.js.map +1 -1
- package/dist/sdk/project.d.ts +1 -0
- package/dist/sdk/project.d.ts.map +1 -1
- package/dist/sdk/project.js +11 -0
- package/dist/sdk/project.js.map +1 -1
- package/dist/sdk/utility.d.ts +27 -0
- package/dist/sdk/utility.d.ts.map +1 -1
- package/dist/sdk/utility.js +402 -5
- package/dist/sdk/utility.js.map +1 -1
- package/dist/utils/SdkModel.d.ts.map +1 -1
- package/dist/utils/SdkModel.js.map +1 -1
- package/dist/utils/TrieNode.d.ts +10 -0
- package/dist/utils/TrieNode.d.ts.map +1 -0
- package/dist/utils/TrieNode.js +45 -0
- package/dist/utils/TrieNode.js.map +1 -0
- package/dist/utils/WrapComments.d.ts +2 -0
- package/dist/utils/WrapComments.d.ts.map +1 -0
- package/dist/utils/WrapComments.js +46 -0
- package/dist/utils/WrapComments.js.map +1 -0
- package/dist/utils/code-namer.d.ts +3 -0
- package/dist/utils/code-namer.d.ts.map +1 -0
- package/dist/utils/code-namer.js +38 -0
- package/dist/utils/code-namer.js.map +1 -0
- package/dist/utils/schema.d.ts +4 -0
- package/dist/utils/schema.d.ts.map +1 -1
- package/dist/utils/schema.js +28 -1
- package/dist/utils/schema.js.map +1 -1
- package/package.json +1 -1
- package/resources/assets/build-module.ps1 +10 -2
- package/resources/assets/create-model-cmdlets.ps1 +51 -10
- package/resources/assets/custom/README.md +1 -1
- package/resources/assets/docs/README.md +1 -1
- package/resources/assets/exports/README.md +1 -1
- package/resources/assets/generate-portal-ux.ps1 +379 -0
- package/resources/assets/how-to.md +1 -1
- package/resources/assets/internal/README.md +1 -1
- package/resources/assets/tools/Resources/custom/New-AzDeployment.ps1 +1 -1
- package/resources/assets/tools/Resources/docs/README.md +1 -1
- package/resources/assets/tools/Resources/how-to.md +1 -1
- package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec +1 -1
- package/resources/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 +1 -1
- package/resources/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml +34 -34
- package/resources/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt +1 -1
- package/resources/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp +1 -1
- package/resources/psruntime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +3 -1
- package/resources/psruntime/BuildTime/PsAttributes.cs +12 -0
- package/resources/psruntime/BuildTime/PsExtensions.cs +7 -0
- package/resources/psruntime/TypeConverterExtensions.cs +50 -0
- package/resources/runtime/csharp/json/Nodes/Collections/XNodeArray.cs +5 -0
- package/resources/templates/azureMethod.ejs +3 -2
- package/resources/templates/azureMethodGroup.ejs +2 -1
- package/resources/templates/azureServiceClient.ejs +13 -4
- package/resources/templates/enum.ejs +73 -0
- package/resources/templates/exception.ejs +52 -0
- package/resources/templates/extensionMethod.ejs +22 -11
- package/resources/templates/extensions.ejs +4 -4
- package/resources/templates/longRunningOperationMethod.ejs +43 -0
- package/resources/templates/method.ejs +21 -2
- package/resources/templates/methodBodyRestCall.ejs +154 -20
- package/resources/templates/methodGroupInterface.ejs +28 -4
- package/resources/templates/model.ejs +133 -20
- package/resources/templates/page.ejs +40 -0
- package/resources/templates/serviceClientBody.ejs +12 -14
- package/resources/templates/serviceClientInterface.ejs +4 -3
- package/resources/templates/methodGroup.ejs +0 -7
|
@@ -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
|
-
|
|
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
|
-
<%#
|
|
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
|
-
|
|
37
|
-
<%
|
|
38
|
-
|
|
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
|
-
<%#
|
|
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
|
-
<%
|
|
45
|
-
this.<%-p.
|
|
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
|
-
<%#
|
|
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
|
-
<%
|
|
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
|
-
///
|
|
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
|
-
<%
|
|
64
|
-
<%type = p.schema.type
|
|
65
|
-
public <%-type %> <%-p.
|
|
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<%-
|
|
29
|
+
/// Gets the I<%- project.helper.PascalCase(key) %>Operations
|
|
29
30
|
/// </summary>
|
|
30
|
-
public virtual I<%-
|
|
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
|
-
|
|
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<%-
|
|
48
|
+
/// Gets the I<%- project.helper.PascalCase(key) %>Operations
|
|
48
49
|
/// </summary>
|
|
49
|
-
I<%-
|
|
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.-%>
|