@autorest/powershell 4.0.0-dev.3 → 4.0.0-dev.4
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 +36 -33
- package/.rush/temp/shrinkwrap-deps.json +13 -19
- package/dist/cmdlets/class.d.ts +1 -0
- package/dist/cmdlets/class.d.ts.map +1 -1
- package/dist/cmdlets/class.js +128 -79
- package/dist/cmdlets/class.js.map +1 -1
- package/dist/cmdlets/namespace.d.ts.map +1 -1
- package/dist/cmdlets/namespace.js +2 -1
- package/dist/cmdlets/namespace.js.map +1 -1
- package/dist/enums/namespace.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 +32 -0
- package/dist/generators/inputhandler.custom.js.map +1 -0
- package/dist/generators/psm1.js +1 -1
- package/dist/generators/psm1.js.map +1 -1
- package/dist/internal/project.d.ts +11 -9
- package/dist/internal/project.d.ts.map +1 -1
- package/dist/internal/project.js +5 -2
- package/dist/internal/project.js.map +1 -1
- package/dist/llcsharp/clientruntime.d.ts +2 -0
- package/dist/llcsharp/clientruntime.d.ts.map +1 -1
- package/dist/llcsharp/clientruntime.js +2 -0
- package/dist/llcsharp/clientruntime.js.map +1 -1
- package/dist/llcsharp/enums/enum.js +1 -1
- package/dist/llcsharp/enums/enum.js.map +1 -1
- package/dist/llcsharp/model/interface.d.ts.map +1 -1
- package/dist/llcsharp/model/interface.js.map +1 -1
- package/dist/llcsharp/model/model-class.js +7 -8
- package/dist/llcsharp/model/model-class.js.map +1 -1
- package/dist/llcsharp/operation/method.d.ts.map +1 -1
- package/dist/llcsharp/operation/method.js +6 -6
- package/dist/llcsharp/operation/method.js.map +1 -1
- package/dist/llcsharp/project.d.ts.map +1 -1
- package/dist/llcsharp/project.js +2 -1
- package/dist/llcsharp/project.js.map +1 -1
- package/dist/llcsharp/schema/date-time.d.ts.map +1 -1
- package/dist/llcsharp/schema/date-time.js.map +1 -1
- package/dist/llcsharp/schema/password.js +1 -1
- package/dist/llcsharp/schema/password.js.map +1 -1
- package/dist/llcsharp/schema/primitive.js.map +1 -1
- package/dist/llcsharp/schema/string.d.ts.map +1 -1
- package/dist/llcsharp/schema/string.js.map +1 -1
- package/dist/models/model-extensions.js +6 -6
- package/dist/models/model-extensions.js.map +1 -1
- package/dist/module/module-class.js.map +1 -1
- package/dist/plugins/create-commands-v2.d.ts.map +1 -1
- package/dist/plugins/create-commands-v2.js.map +1 -1
- package/dist/plugins/cs-namer-v2.js +1 -1
- package/dist/plugins/cs-namer-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 +65 -10
- package/dist/plugins/modifiers-v2.js.map +1 -1
- package/dist/plugins/plugin-tweak-m4-model.js +2 -2
- package/dist/plugins/plugin-tweak-m4-model.js.map +1 -1
- package/dist/plugins/plugin-tweak-model-azure-v2.js.map +1 -1
- package/dist/plugins/plugin-tweak-model.js +2 -2
- 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 +2 -0
- package/dist/plugins/powershell-v2.js.map +1 -1
- 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.map +1 -1
- package/dist/utils/powershell-comment.js +10 -10
- package/dist/utils/powershell-comment.js.map +1 -1
- package/package.json +3 -3
- package/resources/psruntime/BuildTime/Models/PsMarkdownTypes.cs +2 -2
- package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +5 -1
- package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +2 -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
|
@@ -262,7 +262,11 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
262
262
|
var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList();
|
|
263
263
|
var parameterName = defaultInfo.ParameterGroup.ParameterName;
|
|
264
264
|
sb.AppendLine();
|
|
265
|
-
|
|
265
|
+
var setCondition = " ";
|
|
266
|
+
if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) {
|
|
267
|
+
setCondition = $" -and {defaultInfo.SetCondition}";
|
|
268
|
+
}
|
|
269
|
+
sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{");
|
|
266
270
|
sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}");
|
|
267
271
|
sb.Append($"{Indent}{Indent}}}");
|
|
268
272
|
}
|
|
@@ -425,6 +425,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
425
425
|
public string Name { get; }
|
|
426
426
|
public string Description { get; }
|
|
427
427
|
public string Script { get; }
|
|
428
|
+
public string SetCondition { get; }
|
|
428
429
|
public ParameterGroup ParameterGroup { get; }
|
|
429
430
|
|
|
430
431
|
public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup)
|
|
@@ -432,6 +433,7 @@ namespace Microsoft.Rest.ClientRuntime.PowerShell
|
|
|
432
433
|
Name = infoAttribute.Name;
|
|
433
434
|
Description = infoAttribute.Description;
|
|
434
435
|
Script = infoAttribute.Script;
|
|
436
|
+
SetCondition = infoAttribute.SetCondition;
|
|
435
437
|
ParameterGroup = parameterGroup;
|
|
436
438
|
}
|
|
437
439
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
|
|
6
|
+
namespace Microsoft.Rest.ClientRuntime
|
|
7
|
+
{
|
|
8
|
+
|
|
9
|
+
using System;
|
|
10
|
+
using System.Linq;
|
|
11
|
+
using System.Collections;
|
|
12
|
+
using System.Collections.Generic;
|
|
13
|
+
using System.Net.Http;
|
|
14
|
+
using System.Threading;
|
|
15
|
+
using System.Threading.Tasks;
|
|
16
|
+
using GetEventData = System.Func<EventData>;
|
|
17
|
+
using static Microsoft.Rest.ClientRuntime.Extensions;
|
|
18
|
+
|
|
19
|
+
/// <summary>
|
|
20
|
+
/// The IContext Interface defines the communication mechanism for input customization.
|
|
21
|
+
/// </summary>
|
|
22
|
+
/// <remarks>
|
|
23
|
+
/// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation.
|
|
24
|
+
/// </remarks>
|
|
25
|
+
public interface IContext
|
|
26
|
+
{
|
|
27
|
+
System.Management.Automation.InvocationInfo InvocationInformation { get; set; }
|
|
28
|
+
System.Threading.CancellationTokenSource CancellationTokenSource { get; set; }
|
|
29
|
+
System.Collections.Generic.IDictionary<String, Object> ExtensibleParameters { get; }
|
|
30
|
+
HttpPipeline Pipeline { get; set; }
|
|
31
|
+
Microsoft.RestClient Client { get; }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
|
|
6
|
+
using System;
|
|
7
|
+
using System.Collections.Generic;
|
|
8
|
+
|
|
9
|
+
namespace Microsoft.Rest.ClientRuntime.Cmdlets
|
|
10
|
+
{
|
|
11
|
+
public abstract class InputHandler
|
|
12
|
+
{
|
|
13
|
+
protected InputHandler NextHandler = null;
|
|
14
|
+
|
|
15
|
+
public void SetNextHandler(InputHandler nextHandler)
|
|
16
|
+
{
|
|
17
|
+
this.NextHandler = nextHandler;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public abstract void Process(Microsoft.Rest.ClientRuntime.IContext context);
|
|
21
|
+
}
|
|
22
|
+
}
|