@autorest/powershell 4.0.0-dev.1 → 4.0.0-dev.11
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 +94 -60
- package/.rush/temp/shrinkwrap-deps.json +22 -22
- package/autorest-configuration-for-sdk.md +122 -0
- package/autorest-configuration.md +4 -2
- package/dist/cmdlets/class.d.ts +1 -0
- package/dist/cmdlets/class.d.ts.map +1 -1
- package/dist/cmdlets/class.js +218 -82
- package/dist/cmdlets/class.js.map +1 -1
- package/dist/cmdlets/namespace.d.ts.map +1 -1
- package/dist/cmdlets/namespace.js +3 -1
- package/dist/cmdlets/namespace.js.map +1 -1
- package/dist/cmdlets/parameter.js +1 -0
- package/dist/cmdlets/parameter.js.map +1 -1
- package/dist/enums/namespace.js +2 -1
- package/dist/enums/namespace.js.map +1 -1
- package/dist/file-formats/md-file.js +1 -0
- package/dist/file-formats/md-file.js.map +1 -1
- package/dist/file-formats/psd-file.js +1 -0
- package/dist/file-formats/psd-file.js.map +1 -1
- package/dist/file-formats/psscript-file.js +1 -0
- package/dist/file-formats/psscript-file.js.map +1 -1
- package/dist/generators/csproj.js +1 -0
- package/dist/generators/csproj.js.map +1 -1
- package/dist/generators/gitattributes.js +1 -0
- package/dist/generators/gitattributes.js.map +1 -1
- package/dist/generators/gitignore.js +1 -0
- package/dist/generators/gitignore.js.map +1 -1
- package/dist/generators/inputhandler.custom.d.ts +3 -0
- package/dist/generators/inputhandler.custom.d.ts.map +1 -0
- package/dist/generators/inputhandler.custom.js +33 -0
- package/dist/generators/inputhandler.custom.js.map +1 -0
- package/dist/generators/nuspec.js +1 -0
- package/dist/generators/nuspec.js.map +1 -1
- package/dist/generators/psm1.custom.js +1 -0
- package/dist/generators/psm1.custom.js.map +1 -1
- package/dist/generators/psm1.internal.js +1 -0
- package/dist/generators/psm1.internal.js.map +1 -1
- package/dist/generators/psm1.js +3 -2
- package/dist/generators/psm1.js.map +1 -1
- package/dist/generators/readme.js +1 -0
- package/dist/generators/readme.js.map +1 -1
- package/dist/generators/script-cmdlet.js +2 -1
- package/dist/generators/script-cmdlet.js.map +1 -1
- package/dist/internal/name-inferrer.js +1 -0
- package/dist/internal/name-inferrer.js.map +1 -1
- package/dist/internal/powershell-declarations.d.ts +3 -0
- package/dist/internal/powershell-declarations.d.ts.map +1 -1
- package/dist/internal/powershell-declarations.js +3 -0
- package/dist/internal/powershell-declarations.js.map +1 -1
- package/dist/internal/project.d.ts +14 -9
- package/dist/internal/project.d.ts.map +1 -1
- package/dist/internal/project.js +34 -12
- package/dist/internal/project.js.map +1 -1
- package/dist/internal/state.js +1 -0
- package/dist/internal/state.js.map +1 -1
- package/dist/internal/verbs.js +1 -0
- package/dist/internal/verbs.js.map +1 -1
- package/dist/llcsharp/clientruntime.d.ts +3 -0
- package/dist/llcsharp/clientruntime.d.ts.map +1 -1
- package/dist/llcsharp/clientruntime.js +4 -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.js +1 -0
- package/dist/llcsharp/csharp-declarations.js.map +1 -1
- package/dist/llcsharp/enums/enum.js +2 -1
- package/dist/llcsharp/enums/enum.js.map +1 -1
- package/dist/llcsharp/enums/namespace.js +1 -0
- package/dist/llcsharp/enums/namespace.js.map +1 -1
- package/dist/llcsharp/exports.js +23 -13
- package/dist/llcsharp/exports.js.map +1 -1
- package/dist/llcsharp/generator.js +1 -0
- package/dist/llcsharp/generator.js.map +1 -1
- package/dist/llcsharp/messages.js +1 -0
- package/dist/llcsharp/messages.js.map +1 -1
- package/dist/llcsharp/model/idictionary.js +1 -0
- package/dist/llcsharp/model/idictionary.js.map +1 -1
- package/dist/llcsharp/model/interface.d.ts.map +1 -1
- package/dist/llcsharp/model/interface.js +2 -1
- package/dist/llcsharp/model/interface.js.map +1 -1
- package/dist/llcsharp/model/model-class-dictionary.js +1 -0
- package/dist/llcsharp/model/model-class-dictionary.js.map +1 -1
- package/dist/llcsharp/model/model-class-json.d.ts.map +1 -1
- package/dist/llcsharp/model/model-class-json.js +12 -2
- package/dist/llcsharp/model/model-class-json.js.map +1 -1
- package/dist/llcsharp/model/model-class-serializer.js +1 -0
- package/dist/llcsharp/model/model-class-serializer.js.map +1 -1
- package/dist/llcsharp/model/model-class.js +11 -10
- package/dist/llcsharp/model/model-class.js.map +1 -1
- package/dist/llcsharp/model/namespace.js +1 -0
- package/dist/llcsharp/model/namespace.js.map +1 -1
- package/dist/llcsharp/model/property.js +1 -0
- package/dist/llcsharp/model/property.js.map +1 -1
- package/dist/llcsharp/operation/api-class.js +1 -0
- package/dist/llcsharp/operation/api-class.js.map +1 -1
- package/dist/llcsharp/operation/method.d.ts.map +1 -1
- package/dist/llcsharp/operation/method.js +21 -27
- package/dist/llcsharp/operation/method.js.map +1 -1
- package/dist/llcsharp/operation/namespace.js +1 -0
- package/dist/llcsharp/operation/namespace.js.map +1 -1
- package/dist/llcsharp/operation/parameter.js +1 -0
- package/dist/llcsharp/operation/parameter.js.map +1 -1
- package/dist/llcsharp/project.d.ts.map +1 -1
- package/dist/llcsharp/project.js +3 -1
- package/dist/llcsharp/project.js.map +1 -1
- package/dist/llcsharp/schema/Uuid.js +1 -0
- package/dist/llcsharp/schema/Uuid.js.map +1 -1
- package/dist/llcsharp/schema/array.js +1 -0
- package/dist/llcsharp/schema/array.js.map +1 -1
- package/dist/llcsharp/schema/binary.js +1 -0
- package/dist/llcsharp/schema/binary.js.map +1 -1
- package/dist/llcsharp/schema/boolean.js +1 -0
- package/dist/llcsharp/schema/boolean.js.map +1 -1
- package/dist/llcsharp/schema/byte-array.js +1 -0
- package/dist/llcsharp/schema/byte-array.js.map +1 -1
- package/dist/llcsharp/schema/char.js +1 -0
- package/dist/llcsharp/schema/char.js.map +1 -1
- package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
- package/dist/llcsharp/schema/date-time.js +1 -0
- package/dist/llcsharp/schema/date-time.js.map +1 -1
- package/dist/llcsharp/schema/date.js +1 -0
- package/dist/llcsharp/schema/date.js.map +1 -1
- package/dist/llcsharp/schema/duration.js +1 -0
- package/dist/llcsharp/schema/duration.js.map +1 -1
- package/dist/llcsharp/schema/enum.js +1 -0
- package/dist/llcsharp/schema/enum.js.map +1 -1
- package/dist/llcsharp/schema/integer.js +1 -0
- package/dist/llcsharp/schema/integer.js.map +1 -1
- package/dist/llcsharp/schema/object.js +1 -0
- package/dist/llcsharp/schema/object.js.map +1 -1
- package/dist/llcsharp/schema/password.js +2 -1
- package/dist/llcsharp/schema/password.js.map +1 -1
- package/dist/llcsharp/schema/primitive.js +1 -0
- package/dist/llcsharp/schema/primitive.js.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.d.ts +2 -3
- package/dist/llcsharp/schema/schema-resolver.d.ts.map +1 -1
- package/dist/llcsharp/schema/schema-resolver.js +4 -0
- package/dist/llcsharp/schema/schema-resolver.js.map +1 -1
- package/dist/llcsharp/schema/string.d.ts.map +1 -1
- package/dist/llcsharp/schema/string.js +1 -0
- package/dist/llcsharp/schema/string.js.map +1 -1
- package/dist/llcsharp/schema/uri.d.ts +10 -0
- package/dist/llcsharp/schema/uri.d.ts.map +1 -0
- package/dist/llcsharp/schema/uri.js +25 -0
- package/dist/llcsharp/schema/uri.js.map +1 -0
- package/dist/llcsharp/validations.js +1 -0
- package/dist/llcsharp/validations.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +11 -0
- package/dist/main.js.map +1 -1
- package/dist/models/model-extensions.js +7 -6
- package/dist/models/model-extensions.js.map +1 -1
- package/dist/module/module-class.js +2 -1
- package/dist/module/module-class.js.map +1 -1
- package/dist/module/module-namespace.js +1 -0
- package/dist/module/module-namespace.js.map +1 -1
- package/dist/plugins/add-azure-completers-v2.js +1 -0
- package/dist/plugins/add-azure-completers-v2.js.map +1 -1
- package/dist/plugins/create-commands-v2.d.ts.map +1 -1
- package/dist/plugins/create-commands-v2.js +6 -4
- package/dist/plugins/create-commands-v2.js.map +1 -1
- package/dist/plugins/cs-namer-v2.js +4 -3
- package/dist/plugins/cs-namer-v2.js.map +1 -1
- package/dist/plugins/llcsharp-v2.js +1 -0
- package/dist/plugins/llcsharp-v2.js.map +1 -1
- package/dist/plugins/modifiers-v2.d.ts +4 -0
- package/dist/plugins/modifiers-v2.d.ts.map +1 -1
- package/dist/plugins/modifiers-v2.js +69 -13
- package/dist/plugins/modifiers-v2.js.map +1 -1
- package/dist/plugins/plugin-create-inline-properties.d.ts.map +1 -1
- package/dist/plugins/plugin-create-inline-properties.js +16 -1
- package/dist/plugins/plugin-create-inline-properties.js.map +1 -1
- package/dist/plugins/plugin-tweak-m4-model.js +4 -3
- package/dist/plugins/plugin-tweak-m4-model.js.map +1 -1
- package/dist/plugins/plugin-tweak-model-azure-v2.js +4 -3
- package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -1
- package/dist/plugins/plugin-tweak-model.js +15 -14
- package/dist/plugins/plugin-tweak-model.js.map +1 -1
- package/dist/plugins/powershell-v2.d.ts.map +1 -1
- package/dist/plugins/powershell-v2.js +8 -2
- package/dist/plugins/powershell-v2.js.map +1 -1
- package/dist/plugins/ps-namer-v2.js +1 -0
- package/dist/plugins/ps-namer-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 +3 -0
- package/dist/plugins/sdk-cs-namer.d.ts.map +1 -0
- package/dist/plugins/sdk-cs-namer.js +385 -0
- package/dist/plugins/sdk-cs-namer.js.map +1 -0
- 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 +3 -0
- package/dist/plugins/sdk-generate.d.ts.map +1 -0
- package/dist/plugins/sdk-generate.js +106 -0
- package/dist/plugins/sdk-generate.js.map +1 -0
- package/dist/plugins/sdk-tweak-model.d.ts +3 -0
- package/dist/plugins/sdk-tweak-model.d.ts.map +1 -0
- package/dist/plugins/sdk-tweak-model.js +357 -0
- package/dist/plugins/sdk-tweak-model.js.map +1 -0
- package/dist/sdk/project.d.ts +45 -0
- package/dist/sdk/project.d.ts.map +1 -0
- package/dist/sdk/project.js +56 -0
- package/dist/sdk/project.js.map +1 -0
- package/dist/sdk/state.d.ts +23 -0
- package/dist/sdk/state.d.ts.map +1 -0
- package/dist/sdk/state.js +28 -0
- package/dist/sdk/state.js.map +1 -0
- package/dist/sdk/utility.d.ts +32 -0
- package/dist/sdk/utility.d.ts.map +1 -0
- package/dist/sdk/utility.js +414 -0
- package/dist/sdk/utility.js.map +1 -0
- package/dist/utils/PwshModel.js +1 -0
- package/dist/utils/PwshModel.js.map +1 -1
- package/dist/utils/SdkModel.d.ts +7 -0
- package/dist/utils/SdkModel.d.ts.map +1 -0
- package/dist/utils/SdkModel.js +17 -0
- package/dist/utils/SdkModel.js.map +1 -0
- 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/command-operation.d.ts +1 -0
- package/dist/utils/command-operation.d.ts.map +1 -1
- package/dist/utils/command-operation.js +2 -2
- package/dist/utils/command-operation.js.map +1 -1
- package/dist/utils/components.d.ts +2 -0
- package/dist/utils/components.d.ts.map +1 -1
- package/dist/utils/components.js +1 -0
- package/dist/utils/components.js.map +1 -1
- package/dist/utils/extensions.js +1 -0
- package/dist/utils/extensions.js.map +1 -1
- package/dist/utils/http-definitions.js +1 -0
- package/dist/utils/http-definitions.js.map +1 -1
- package/dist/utils/http-operation.js +1 -0
- package/dist/utils/http-operation.js.map +1 -1
- package/dist/utils/info.js +1 -0
- package/dist/utils/info.js.map +1 -1
- package/dist/utils/model-state.js +1 -0
- package/dist/utils/model-state.js.map +1 -1
- package/dist/utils/powershell-comment.js +11 -10
- package/dist/utils/powershell-comment.js.map +1 -1
- package/dist/utils/programatic-operation.js +2 -2
- package/dist/utils/programatic-operation.js.map +1 -1
- package/dist/utils/resolve-conflicts.js +1 -0
- package/dist/utils/resolve-conflicts.js.map +1 -1
- package/dist/utils/schema.d.ts +4 -0
- package/dist/utils/schema.d.ts.map +1 -1
- package/dist/utils/schema.js +28 -0
- package/dist/utils/schema.js.map +1 -1
- package/dist/utils/security-scheme.js +1 -0
- package/dist/utils/security-scheme.js.map +1 -1
- package/dist/utils/uid.js +1 -0
- package/dist/utils/uid.js.map +1 -1
- package/package.json +6 -5
- package/readme.md +5 -1
- package/resources/assets/build-module.ps1 +26 -2
- package/resources/assets/create-model-cmdlets.ps1 +8 -5
- 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/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/Attributes/ExternalDocsAttribute.cs +30 -0
- package/resources/psruntime/BuildTime/Models/PsMarkdownTypes.cs +39 -4
- package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +8 -2
- package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +6 -0
- package/resources/psruntime/BuildTime/PsAttributes.cs +7 -0
- package/resources/runtime/csharp/client/Context.cs +33 -0
- package/resources/runtime/csharp/client/InfoAttribute.cs +1 -0
- package/resources/runtime/csharp/client/InputHandler.cs +22 -0
- package/resources/runtime/csharp/pipeline/Events.cs +2 -2
- package/resources/templates/azureMethod.ejs +5 -0
- package/resources/templates/azureMethodGroup.ejs +46 -0
- package/resources/templates/azureServiceClient.ejs +80 -0
- package/resources/templates/enum.ejs +73 -0
- package/resources/templates/exception.ejs +52 -0
- package/resources/templates/extensionMethod.ejs +68 -0
- package/resources/templates/extensions.ejs +19 -0
- package/resources/templates/longRunningOperationMethod.ejs +43 -0
- package/resources/templates/method.ejs +65 -0
- package/resources/templates/methodBodyRestCall.ejs +317 -0
- package/resources/templates/methodGroupInterface.ejs +77 -0
- package/resources/templates/model.ejs +184 -0
- package/resources/templates/page.ejs +40 -0
- package/resources/templates/serviceClientBody.ejs +303 -0
- package/resources/templates/serviceClientInterface.ejs +55 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/// <summary>
|
|
2
|
+
/// The base URI of the service.
|
|
3
|
+
/// </summary>
|
|
4
|
+
<%# ToDo: Add support for customBaseUri, priority is low-%>
|
|
5
|
+
public System.Uri BaseUri { get; set; }
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// Gets or sets json serialization settings.
|
|
8
|
+
/// </summary>
|
|
9
|
+
public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; }
|
|
10
|
+
/// <summary>
|
|
11
|
+
/// Gets or sets json deserialization settings.
|
|
12
|
+
/// </summary>
|
|
13
|
+
public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; }
|
|
14
|
+
<% (project.model.globalParameters || []).filter(p=>p.language.default.name != '$host').forEach(function(parameter) {-%>
|
|
15
|
+
/// <summary>
|
|
16
|
+
/// <%=parameter.language.default.description%>
|
|
17
|
+
/// </summary>
|
|
18
|
+
<% var type = parameter.schema.type == 'constant' ? parameter.schema.valueType.language.csharp.fullname : parameter.schema.language.csharp.fullname-%>
|
|
19
|
+
<%type = type.includes('.') || type == 'string' ? type : type + '?'-%>
|
|
20
|
+
<% if (parameter.readOnly || parameter.schema.type == 'constant') {-%>
|
|
21
|
+
public <%- type %> <%- parameter.language.default.name%> { get; private set; }
|
|
22
|
+
<% } else {-%>
|
|
23
|
+
public <%- type %> <%- parameter.language.default.name%> { get; set;}
|
|
24
|
+
<% }%>
|
|
25
|
+
<%});-%>
|
|
26
|
+
<% project.model.operationGroups.forEach(function(methodGroup){ -%>
|
|
27
|
+
<% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
|
|
28
|
+
/// <summary>
|
|
29
|
+
/// Gets the I<%- project.helper.PascalCase(key) %>Operations
|
|
30
|
+
/// </summary>
|
|
31
|
+
public virtual I<%- project.helper.PascalCase(key) %>Operations <%- project.helper.PascalCase(methodGroup.$key) %> { get; private set; }
|
|
32
|
+
<% }); -%>
|
|
33
|
+
/// <summary>
|
|
34
|
+
/// Initializes a new instance of the <%-project.model.info.title%> class.
|
|
35
|
+
/// </summary>
|
|
36
|
+
/// <param name='httpClient'>
|
|
37
|
+
/// HttpClient to be used
|
|
38
|
+
/// </param>
|
|
39
|
+
/// <param name='disposeHttpClient'>
|
|
40
|
+
/// True: will dispose the provided httpClient on calling <%-project.model.info.title%>.Dispose(). False: will not dispose provided httpClient</param>
|
|
41
|
+
<%# ToDo: Add support for case that ContainsCredentials is false, low priority-%>
|
|
42
|
+
protected <%-project.model.info.title%>(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
|
|
43
|
+
{
|
|
44
|
+
this.Initialize();
|
|
45
|
+
}
|
|
46
|
+
/// <summary>
|
|
47
|
+
/// Initializes a new instance of the <%-project.model.info.title%> class.
|
|
48
|
+
/// </summary>
|
|
49
|
+
/// <param name='handlers'>
|
|
50
|
+
/// Optional. The delegating handlers to add to the http client pipeline.
|
|
51
|
+
/// </param>
|
|
52
|
+
protected <%-project.model.info.title%>(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers)
|
|
53
|
+
{
|
|
54
|
+
this.Initialize();
|
|
55
|
+
}
|
|
56
|
+
/// <summary>
|
|
57
|
+
/// Initializes a new instance of the <%-project.model.info.title%> class.
|
|
58
|
+
/// </summary>
|
|
59
|
+
/// <param name='rootHandler'>
|
|
60
|
+
/// Optional. The http client handler used to handle http transport.
|
|
61
|
+
/// </param>
|
|
62
|
+
/// <param name='handlers'>
|
|
63
|
+
/// Optional. The delegating handlers to add to the http client pipeline.
|
|
64
|
+
/// </param>
|
|
65
|
+
protected <%-project.model.info.title%>(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers)
|
|
66
|
+
{
|
|
67
|
+
this.Initialize();
|
|
68
|
+
}
|
|
69
|
+
<%# ToDo: following true means !IsCustomBaseUri, may need to implement IsCustomBaseUri, low priority -%>
|
|
70
|
+
<% if(true) {-%>
|
|
71
|
+
/// <summary>
|
|
72
|
+
/// Initializes a new instance of the <%-project.model.info.title%> class.
|
|
73
|
+
/// </summary>
|
|
74
|
+
/// <param name='baseUri'>
|
|
75
|
+
/// Optional. The base URI of the service.
|
|
76
|
+
/// </param>
|
|
77
|
+
/// <param name='handlers'>
|
|
78
|
+
/// Optional. The delegating handlers to add to the http client pipeline.
|
|
79
|
+
/// </param>
|
|
80
|
+
/// <exception cref="System.ArgumentNullException">
|
|
81
|
+
/// Thrown when a required parameter is null
|
|
82
|
+
/// </exception>
|
|
83
|
+
protected <%-project.model.info.title%>(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
|
|
84
|
+
{
|
|
85
|
+
if (baseUri == null)
|
|
86
|
+
{
|
|
87
|
+
throw new System.ArgumentNullException("baseUri");
|
|
88
|
+
}
|
|
89
|
+
this.BaseUri = baseUri;
|
|
90
|
+
}
|
|
91
|
+
/// <summary>
|
|
92
|
+
/// Initializes a new instance of the <%-project.model.info.title%> class.
|
|
93
|
+
/// </summary>
|
|
94
|
+
/// <param name='baseUri'>
|
|
95
|
+
/// Optional. The base URI of the service.
|
|
96
|
+
/// </param>
|
|
97
|
+
/// <param name='rootHandler'>
|
|
98
|
+
/// Optional. The http client handler used to handle http transport.
|
|
99
|
+
/// </param>
|
|
100
|
+
/// <param name='handlers'>
|
|
101
|
+
/// Optional. The delegating handlers to add to the http client pipeline.
|
|
102
|
+
/// </param>
|
|
103
|
+
/// <exception cref="System.ArgumentNullException">
|
|
104
|
+
/// Thrown when a required parameter is null
|
|
105
|
+
/// </exception>
|
|
106
|
+
protected <%-project.model.info.title%>(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
|
|
107
|
+
{
|
|
108
|
+
if (baseUri == null)
|
|
109
|
+
{
|
|
110
|
+
throw new System.ArgumentNullException("baseUri");
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
this.BaseUri = baseUri;
|
|
114
|
+
}
|
|
115
|
+
<% } -%>
|
|
116
|
+
<% var parameters = (project.model.globalParameters || []).filter(p => p.required && p.readOnly)
|
|
117
|
+
if (parameters.length > 0) {-%>
|
|
118
|
+
/// <summary>
|
|
119
|
+
/// Initializes a new instance of the <%-project.model.info.title%> class.
|
|
120
|
+
/// </summary>
|
|
121
|
+
<%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter){-%>
|
|
122
|
+
/// <param name='<%-project.helper.CamelCase(parameter.language.default.name)%>'>
|
|
123
|
+
/// Required. <%-parameter.language.default.description%>
|
|
124
|
+
/// </param>
|
|
125
|
+
<%});-%>
|
|
126
|
+
/// <param name='handlers'>
|
|
127
|
+
/// Optional. The delegating handlers to add to the http client pipeline.
|
|
128
|
+
/// </param>
|
|
129
|
+
/// <exception cref="System.ArgumentNullException">
|
|
130
|
+
/// Thrown when a required parameter is null
|
|
131
|
+
/// </exception>
|
|
132
|
+
<%# ToDo: assume the access is public, need to figure the logic of ConstructorVisibility-%>
|
|
133
|
+
public <%-project.model.info.title%>(<%-project.model.language.default.requiredConstructorParametersDeclaration%>, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
|
|
134
|
+
{
|
|
135
|
+
<%parameters.forEach(function(parameter) {-%>
|
|
136
|
+
if (<%-project.helper.CamelCase(parameter.language.default.name)%> == null)
|
|
137
|
+
{
|
|
138
|
+
throw new System.ArgumentNullException("<%-project.helper.CamelCase(parameter.language.default.name)%>");
|
|
139
|
+
}
|
|
140
|
+
<%});-%>
|
|
141
|
+
<%parameters.forEach(function(parameter) {-%>
|
|
142
|
+
this.<%-parameter.language.default.name%> = <%-project.helper.CamelCase(parameter.language.default.name)%>;
|
|
143
|
+
<%if(parameter.schema.language.csharp.fullname == 'Microsoft.Rest.ServiceClientCredentials') {-%>
|
|
144
|
+
if (this.Credentials != null)
|
|
145
|
+
{
|
|
146
|
+
this.Credentials.InitializeServiceClient(this);
|
|
147
|
+
}
|
|
148
|
+
<% }-%>
|
|
149
|
+
<%});-%>
|
|
150
|
+
}
|
|
151
|
+
/// <summary>
|
|
152
|
+
/// Initializes a new instance of the <%-project.model.info.title%> class.
|
|
153
|
+
/// </summary>
|
|
154
|
+
<%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter) {-%>
|
|
155
|
+
/// <param name="<%-project.helper.CamelCase(parameter.language.default.name)%>">
|
|
156
|
+
/// Required. <%-parameter.language.default.description%>
|
|
157
|
+
/// </param>
|
|
158
|
+
<%});-%>
|
|
159
|
+
/// <param name='httpClient'>
|
|
160
|
+
/// HttpClient to be used
|
|
161
|
+
/// </param>
|
|
162
|
+
/// <param name='disposeHttpClient'>
|
|
163
|
+
/// True: will dispose the provided httpClient on calling <%-project.model.info.title%>.Dispose(). False: will not dispose provided httpClient</param>
|
|
164
|
+
/// <exception cref="System.ArgumentNullException">
|
|
165
|
+
/// Thrown when a required parameter is null
|
|
166
|
+
/// </exception>
|
|
167
|
+
public <%-project.model.info.title%>(<%-project.model.language.default.requiredConstructorParametersDeclaration%>, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
|
|
168
|
+
{
|
|
169
|
+
<%parameters.forEach(function(parameter) {-%>
|
|
170
|
+
if (<%-project.helper.CamelCase(parameter.language.default.name)%> == null)
|
|
171
|
+
{
|
|
172
|
+
throw new System.ArgumentNullException("<%-project.helper.CamelCase(parameter.language.default.name)%>");
|
|
173
|
+
}
|
|
174
|
+
<%});-%>
|
|
175
|
+
<%parameters.forEach(function(parameter) {-%>
|
|
176
|
+
this.<%-parameter.language.default.name%> = <%-project.helper.CamelCase(parameter.language.default.name)%>;
|
|
177
|
+
<%if(parameter.schema.language.csharp.fullname == 'Microsoft.Rest.ServiceClientCredentials') {-%>
|
|
178
|
+
if (this.Credentials != null)
|
|
179
|
+
{
|
|
180
|
+
this.Credentials.InitializeServiceClient(this);
|
|
181
|
+
}
|
|
182
|
+
<% }-%>
|
|
183
|
+
<%});-%>
|
|
184
|
+
}
|
|
185
|
+
/// <summary>
|
|
186
|
+
/// Initializes a new instance of the <%-project.model.info.title%> class.
|
|
187
|
+
/// </summary>
|
|
188
|
+
<%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter) {-%>
|
|
189
|
+
/// <param name="<%-project.helper.CamelCase(parameter.language.default.name)%>">
|
|
190
|
+
/// Required. <%-parameter.language.default.description%>
|
|
191
|
+
/// </param>
|
|
192
|
+
<%});-%>
|
|
193
|
+
/// <param name='rootHandler'>
|
|
194
|
+
/// Optional. The http client handler used to handle http transport.
|
|
195
|
+
/// </param>
|
|
196
|
+
/// <param name='handlers'>
|
|
197
|
+
/// Optional. The delegating handlers to add to the http client pipeline.
|
|
198
|
+
/// </param>
|
|
199
|
+
/// <exception cref="System.ArgumentNullException">
|
|
200
|
+
/// Thrown when a required parameter is null
|
|
201
|
+
/// </exception>
|
|
202
|
+
public <%-project.model.info.title%>(<%-project.model.language.default.requiredConstructorParametersDeclaration%>, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
|
|
203
|
+
{
|
|
204
|
+
<%parameters.forEach(function(parameter) {-%>
|
|
205
|
+
if (<%-project.helper.CamelCase(parameter.language.default.name)%> == null)
|
|
206
|
+
{
|
|
207
|
+
throw new System.ArgumentNullException("<%-project.helper.CamelCase(parameter.language.default.name)%>");
|
|
208
|
+
}
|
|
209
|
+
<%});-%>
|
|
210
|
+
<%parameters.forEach(function(parameter) {-%>
|
|
211
|
+
this.<%-parameter.language.default.name%> = <%-project.helper.CamelCase(parameter.language.default.name)%>;
|
|
212
|
+
<%if(parameter.schema.language.csharp.fullname == 'Microsoft.Rest.ServiceClientCredentials') {-%>
|
|
213
|
+
if (this.Credentials != null)
|
|
214
|
+
{
|
|
215
|
+
this.Credentials.InitializeServiceClient(this);
|
|
216
|
+
}
|
|
217
|
+
<% }-%>
|
|
218
|
+
<%});-%>
|
|
219
|
+
}
|
|
220
|
+
<%# ToDo: following true means !IsCustomBaseUri, may need to implement IsCustomBaseUri, low priority -%>
|
|
221
|
+
<%if (true) {-%>
|
|
222
|
+
/// <summary>
|
|
223
|
+
/// Initializes a new instance of the <%-project.model.info.title%> class.
|
|
224
|
+
/// </summary>
|
|
225
|
+
/// <param name='baseUri'>
|
|
226
|
+
/// Optional. The base URI of the service.
|
|
227
|
+
/// </param>
|
|
228
|
+
<%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter) {-%>
|
|
229
|
+
/// <param name="<%-project.helper.CamelCase(parameter.language.default.name)%>">
|
|
230
|
+
/// Required. <%-parameter.language.default.description%>
|
|
231
|
+
/// </param>
|
|
232
|
+
<%});-%>
|
|
233
|
+
/// <param name='handlers'>
|
|
234
|
+
/// Optional. The delegating handlers to add to the http client pipeline.
|
|
235
|
+
/// </param>
|
|
236
|
+
/// <exception cref="System.ArgumentNullException">
|
|
237
|
+
/// Thrown when a required parameter is null
|
|
238
|
+
/// </exception>
|
|
239
|
+
public <%-project.model.info.title%>(System.Uri baseUri, <%-project.model.language.default.requiredConstructorParametersDeclaration%>, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers)
|
|
240
|
+
{
|
|
241
|
+
if (baseUri == null)
|
|
242
|
+
{
|
|
243
|
+
throw new System.ArgumentNullException("baseUri");
|
|
244
|
+
}
|
|
245
|
+
<%parameters.forEach(function(parameter) {-%>
|
|
246
|
+
if (<%-project.helper.CamelCase(parameter.language.default.name)%> == null)
|
|
247
|
+
{
|
|
248
|
+
throw new System.ArgumentNullException("<%-project.helper.CamelCase(parameter.language.default.name)%>");
|
|
249
|
+
}
|
|
250
|
+
<%});-%>
|
|
251
|
+
this.BaseUri = baseUri;
|
|
252
|
+
<%parameters.forEach(function(parameter) {-%>
|
|
253
|
+
this.<%-parameter.language.default.name%> = <%-project.helper.CamelCase(parameter.language.default.name)%>;
|
|
254
|
+
<%if(parameter.schema.language.csharp.fullname == 'Microsoft.Rest.ServiceClientCredentials') {-%>
|
|
255
|
+
if (this.Credentials != null)
|
|
256
|
+
{
|
|
257
|
+
this.Credentials.InitializeServiceClient(this);
|
|
258
|
+
}
|
|
259
|
+
<% }-%>
|
|
260
|
+
<%});-%>
|
|
261
|
+
}
|
|
262
|
+
/// <summary>
|
|
263
|
+
/// Initializes a new instance of the <%-project.model.info.title%> class.
|
|
264
|
+
/// </summary>
|
|
265
|
+
/// <param name='baseUri'>
|
|
266
|
+
/// Optional. The base URI of the service.
|
|
267
|
+
/// </param>
|
|
268
|
+
<%parameters.filter(p => !project.helper.IsConstantParameter(p)).forEach(function(parameter) {-%>
|
|
269
|
+
/// <param name="<%-project.helper.CamelCase(parameter.language.default.name)%>">
|
|
270
|
+
/// Required. <%-parameter.language.default.description%>
|
|
271
|
+
/// </param>
|
|
272
|
+
<%});-%>
|
|
273
|
+
/// <param name='rootHandler'>
|
|
274
|
+
/// Optional. The http client handler used to handle http transport.
|
|
275
|
+
/// </param>
|
|
276
|
+
/// <exception cref="System.ArgumentNullException">
|
|
277
|
+
/// Thrown when a required parameter is null
|
|
278
|
+
/// </exception>
|
|
279
|
+
public <%-project.model.info.title%>(System.Uri baseUri, <%-project.model.language.default.requiredConstructorParametersDeclaration%>, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers)
|
|
280
|
+
{
|
|
281
|
+
if (baseUri == null)
|
|
282
|
+
{
|
|
283
|
+
throw new System.ArgumentNullException("baseUri");
|
|
284
|
+
}
|
|
285
|
+
<%parameters.forEach(function(parameter) {-%>
|
|
286
|
+
if (<%-project.helper.CamelCase(parameter.language.default.name)%> == null)
|
|
287
|
+
{
|
|
288
|
+
throw new System.ArgumentNullException("<%-project.helper.CamelCase(parameter.language.default.name)%>");
|
|
289
|
+
}
|
|
290
|
+
<%});-%>
|
|
291
|
+
this.BaseUri = baseUri;
|
|
292
|
+
<%parameters.forEach(function(parameter) {-%>
|
|
293
|
+
this.<%-parameter.language.default.name%> = <%-project.helper.CamelCase(parameter.language.default.name)%>;
|
|
294
|
+
<%if(parameter.schema.language.csharp.fullname == 'Microsoft.Rest.ServiceClientCredentials') {-%>
|
|
295
|
+
if (this.Credentials != null)
|
|
296
|
+
{
|
|
297
|
+
this.Credentials.InitializeServiceClient(this);
|
|
298
|
+
}
|
|
299
|
+
<% }-%>
|
|
300
|
+
<%});-%>
|
|
301
|
+
}
|
|
302
|
+
<%}-%>
|
|
303
|
+
<% }-%>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<%- project.commentHeader %>
|
|
2
|
+
|
|
3
|
+
namespace <%- project.namespace %>
|
|
4
|
+
{
|
|
5
|
+
using Microsoft.Rest;
|
|
6
|
+
<% project.model.usings.forEach(function(using){ -%>
|
|
7
|
+
using <%- using %>;
|
|
8
|
+
<% }); -%>
|
|
9
|
+
|
|
10
|
+
/// <summary>
|
|
11
|
+
/// <%- project.model.info.description %>
|
|
12
|
+
/// </summary>
|
|
13
|
+
<% var client = project.model.info.title -%>
|
|
14
|
+
public partial interface I<%- client %> : System.IDisposable
|
|
15
|
+
{
|
|
16
|
+
/// <summary>
|
|
17
|
+
/// The base URI of the service.
|
|
18
|
+
/// </summary>
|
|
19
|
+
System.Uri BaseUri { get; set; }
|
|
20
|
+
|
|
21
|
+
/// <summary>
|
|
22
|
+
/// Gets or sets json serialization settings.
|
|
23
|
+
/// </summary>
|
|
24
|
+
Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; }
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
/// Gets or sets json deserialization settings.
|
|
28
|
+
/// </summary>
|
|
29
|
+
Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; }
|
|
30
|
+
|
|
31
|
+
<% (project.model.globalParameters || []).filter(p => p.language.default.name != '$host').forEach(function(parameter){ -%>
|
|
32
|
+
/// <summary>
|
|
33
|
+
/// <%- parameter.language.default.description %>
|
|
34
|
+
/// </summary>
|
|
35
|
+
<%# ToDo: need to use fullname instead of namespace + name -%>
|
|
36
|
+
<% var type = parameter.schema.type == 'constant' ? parameter.schema.valueType.language.csharp.fullname : parameter.schema.language.csharp.fullname-%>
|
|
37
|
+
<%type = type.includes('.') || type == 'string' ? type : type + '?'-%>
|
|
38
|
+
<% if (parameter.readOnly || parameter.schema.type == 'constant') {-%>
|
|
39
|
+
<%- type %> <%- parameter.language.default.name%> { get;}
|
|
40
|
+
<% } else {-%>
|
|
41
|
+
<%- type %> <%- parameter.language.default.name%> { get; set;}
|
|
42
|
+
<% }%>
|
|
43
|
+
|
|
44
|
+
<% }); -%>
|
|
45
|
+
<% project.model.operationGroups.forEach(function(methodGroup){ -%>
|
|
46
|
+
<% var key = methodGroup.$key == 'Operations' ? '' : methodGroup.$key-%>
|
|
47
|
+
/// <summary>
|
|
48
|
+
/// Gets the I<%- project.helper.PascalCase(key) %>Operations
|
|
49
|
+
/// </summary>
|
|
50
|
+
I<%- project.helper.PascalCase(key) %>Operations <%- project.helper.PascalCase(methodGroup.$key) %> { get; }
|
|
51
|
+
|
|
52
|
+
<% }); -%>
|
|
53
|
+
<%# ToDo: Add method whose group is empty, and need to check in which case the group is empty.-%>
|
|
54
|
+
}
|
|
55
|
+
}
|