@autorest/powershell 4.0.674 → 4.0.675
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 +9 -9
- package/dist/cmdlets/class.d.ts +12 -0
- package/dist/cmdlets/class.d.ts.map +1 -1
- package/dist/cmdlets/class.js +145 -3
- package/dist/cmdlets/class.js.map +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/plugins/create-commands-v2.d.ts +8 -0
- package/dist/plugins/create-commands-v2.d.ts.map +1 -1
- package/dist/plugins/create-commands-v2.js +65 -25
- package/dist/plugins/create-commands-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 +1 -1
- package/dist/plugins/plugin-create-inline-properties.js.map +1 -1
- package/dist/utils/command-operation.d.ts +3 -1
- package/dist/utils/command-operation.d.ts.map +1 -1
- package/dist/utils/command-operation.js +2 -0
- package/dist/utils/command-operation.js.map +1 -1
- package/package.json +1 -1
- package/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +2 -2
- package/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs +2 -0
- package/resources/psruntime/BuildTime/Models/PsProxyTypes.cs +6 -8
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"powershell/autorest-configuration-for-sdk.md": "d6bd98068a88d8f9cb41b8a731cfea21d0787e4e",
|
|
8
8
|
"powershell/autorest-configuration.md": "3a47bf36e4b80be07ddfd20d77fabf82aacfd77f",
|
|
9
9
|
"powershell/changelog.md": "438e32cc7c4d86e08e32c2fd4085928c0e70b1b9",
|
|
10
|
-
"powershell/cmdlets/class.ts": "
|
|
10
|
+
"powershell/cmdlets/class.ts": "3fe81107f029b631582bd2ef732c6ec94a2411c6",
|
|
11
11
|
"powershell/cmdlets/namespace.ts": "70f1260b97aa3fcb92db47d7d75b70b74bdfc197",
|
|
12
12
|
"powershell/cmdlets/parameter.ts": "7c67fea43eded2c358ad802306dde505c8d0e30f",
|
|
13
13
|
"powershell/enums/namespace.ts": "1206b2c779837a0660b314059e312a472a145c87",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"powershell/generators/readme.ts": "b8563b454f6deaeb4d66424ebc278b90a5836776",
|
|
26
26
|
"powershell/generators/script-cmdlet.ts": "bf8a72600f7fc351176ff510cb85bc5f38378bfb",
|
|
27
27
|
"powershell/internal/name-inferrer.ts": "8270005536a5462b6f3e998a3df4c1f112b221ec",
|
|
28
|
-
"powershell/internal/powershell-declarations.ts": "
|
|
28
|
+
"powershell/internal/powershell-declarations.ts": "0cbb0c67b76cbefc1d962cd9952ca0c43cf693e5",
|
|
29
29
|
"powershell/internal/project.ts": "37685132eae32360b3953d300f464c76fbd99db9",
|
|
30
30
|
"powershell/internal/state.ts": "3dd5a4fed122d449840c4a5486acadefc37ec137",
|
|
31
31
|
"powershell/internal/verbs.ts": "c8fd6b534923b1dd1bd71be0f33936265468942e",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"powershell/models/model-extensions.ts": "f0c617b9bfb04b4424a853e1b1eecba9059ba788",
|
|
76
76
|
"powershell/module/module-class.ts": "2f8b0b4d28f59761dbe9a95bf7555c8ec0585387",
|
|
77
77
|
"powershell/module/module-namespace.ts": "f6afc90087e8d733f0323b0de8ba41d923955732",
|
|
78
|
-
"powershell/package.json": "
|
|
78
|
+
"powershell/package.json": "8e83a4727a586dc755df4c247e835bd1b7aa6413",
|
|
79
79
|
"powershell/plugins/add-azure-completers-v2.ts": "3b1ddf7a067dbac2f07561fb3f6cbf1b66e555aa",
|
|
80
|
-
"powershell/plugins/create-commands-v2.ts": "
|
|
80
|
+
"powershell/plugins/create-commands-v2.ts": "f32d1501654f58ebd8bfe30f2aa3937c4cac45c2",
|
|
81
81
|
"powershell/plugins/cs-namer-v2.ts": "1b64031416f18b604950012b5683758adefce535",
|
|
82
82
|
"powershell/plugins/llcsharp-v2.ts": "eab78c2dc3927bdc0af22e11c3a267d2acb1b857",
|
|
83
83
|
"powershell/plugins/modifiers-v2.ts": "8423baf0e2c28b049a4c4c2ae99bff0df70c2b5f",
|
|
84
|
-
"powershell/plugins/plugin-create-inline-properties.ts": "
|
|
84
|
+
"powershell/plugins/plugin-create-inline-properties.ts": "73a52468125e44bdd665c8145f36fb728ea211fd",
|
|
85
85
|
"powershell/plugins/plugin-tweak-m4-model.ts": "0d23ab1944df99c314c9cdd9d886d357f60bef56",
|
|
86
86
|
"powershell/plugins/plugin-tweak-model-azure-v2.ts": "1c639a94942e0a64d7f8c2a1700a7b32f8743eae",
|
|
87
87
|
"powershell/plugins/plugin-tweak-model.ts": "4b7303ea94664c9f13fd2f5306d2dae7fa1adbf9",
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
"powershell/resources/psruntime/BuildTime/Cmdlets/ExportFormatPs1xml.cs": "e974093cbafba7c6190c7c07219f84ed81bad063",
|
|
216
216
|
"powershell/resources/psruntime/BuildTime/Cmdlets/ExportHelpMarkdown.cs": "4c79464f693bbb6dbc798a6cec590e5fbf539656",
|
|
217
217
|
"powershell/resources/psruntime/BuildTime/Cmdlets/ExportModelSurface.cs": "e4af60bd7ad7b57a036474c5aed7c4cab4b1997d",
|
|
218
|
-
"powershell/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs": "
|
|
218
|
+
"powershell/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs": "f36346b8291eef621d487b090bd184cbd9fa3a9e",
|
|
219
219
|
"powershell/resources/psruntime/BuildTime/Cmdlets/ExportPsd1.cs": "b3833ffb92514646dc99611eaf5aab4e4a232664",
|
|
220
220
|
"powershell/resources/psruntime/BuildTime/Cmdlets/ExportTestStub.cs": "7402e85a799d19cba3eb2ad563ca792647ef9578",
|
|
221
221
|
"powershell/resources/psruntime/BuildTime/Cmdlets/GetCommonParameter.cs": "bf5c757829449599eee8ff1786b3198d703ed7a6",
|
|
@@ -227,8 +227,8 @@
|
|
|
227
227
|
"powershell/resources/psruntime/BuildTime/Models/PsHelpMarkdownOutputs.cs": "056be554968d76667c0659d169f674ef5dbb74ed",
|
|
228
228
|
"powershell/resources/psruntime/BuildTime/Models/PsHelpTypes.cs": "34d832146757eab7d8e1bd3feba5d411577f388a",
|
|
229
229
|
"powershell/resources/psruntime/BuildTime/Models/PsMarkdownTypes.cs": "c2c068932d2e4ab31a46d566e7b24f357f68c6f8",
|
|
230
|
-
"powershell/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs": "
|
|
231
|
-
"powershell/resources/psruntime/BuildTime/Models/PsProxyTypes.cs": "
|
|
230
|
+
"powershell/resources/psruntime/BuildTime/Models/PsProxyOutputs.cs": "7c04bdae14142b93a1ddde2afefa36a85585b00e",
|
|
231
|
+
"powershell/resources/psruntime/BuildTime/Models/PsProxyTypes.cs": "3c9b339661ee59ce34f68c7a8c04d6f6b5e30e17",
|
|
232
232
|
"powershell/resources/psruntime/BuildTime/PsAttributes.cs": "06d994f77ab1052048edccf0d2b6ba7e6021ce0a",
|
|
233
233
|
"powershell/resources/psruntime/BuildTime/PsExtensions.cs": "52083232ddc161a0f41496cbdf979d709c490194",
|
|
234
234
|
"powershell/resources/psruntime/BuildTime/PsHelpers.cs": "c9bae00316dedb24a93eeebf73b2728fe9447494",
|
|
@@ -367,7 +367,7 @@
|
|
|
367
367
|
"powershell/utils/SdkModel.ts": "e1ff27387dae3eac3f879c46ce58a5130059dc14",
|
|
368
368
|
"powershell/utils/TrieNode.ts": "9f87206d8703338aa443122e443ce37f0424e0d9",
|
|
369
369
|
"powershell/utils/code-namer.ts": "6fe8a2dea745562a2c5929e7878c3cc2eab566fe",
|
|
370
|
-
"powershell/utils/command-operation.ts": "
|
|
370
|
+
"powershell/utils/command-operation.ts": "b42869aedb2a24fe84fbdc099ab4c1bf994f7fb4",
|
|
371
371
|
"powershell/utils/components.ts": "3a9ea0061cdd20109fd736e9eac6bedda70f1ff7",
|
|
372
372
|
"powershell/utils/extensions.ts": "707de2c3eace1b105cf62bf9c98415199a1a3438",
|
|
373
373
|
"powershell/utils/http-definitions.ts": "cbf5a9cfd790e3f7b090d370eaedf3281d078c45",
|
package/dist/cmdlets/class.d.ts
CHANGED
|
@@ -40,6 +40,8 @@ export declare class CmdletClass extends Class {
|
|
|
40
40
|
private responses;
|
|
41
41
|
private callbackMethods;
|
|
42
42
|
private serializationMode;
|
|
43
|
+
private disableTransformIdentityType?;
|
|
44
|
+
private flattenUserAssignedIdentity?;
|
|
43
45
|
constructor(namespace: Namespace, operation: CommandOperation, state: State, objectInitializer?: DeepPartial<CmdletClass>);
|
|
44
46
|
init(): Promise<this>;
|
|
45
47
|
get headerComment(): string;
|
|
@@ -50,6 +52,16 @@ export declare class CmdletClass extends Class {
|
|
|
50
52
|
private NewImplementProcessRecord;
|
|
51
53
|
private NewImplementProcessRecordAsync;
|
|
52
54
|
private ImplementCall;
|
|
55
|
+
private ContainsSpecifiedParameter;
|
|
56
|
+
private ContainsIdentityTypeParameter;
|
|
57
|
+
private ContainsUserAssignedIdentityParameter;
|
|
58
|
+
private GetUserAssignedIdentityParameterElementType;
|
|
59
|
+
private GetUserAssignedIdentityPropertyTypeDeclaration;
|
|
60
|
+
private GetUserAssignedIdentityPropertyName;
|
|
61
|
+
private ManagedUserAssignedIdentityPreProcess;
|
|
62
|
+
private ManagedIdentityPreProcessForNewVerbCmdlet;
|
|
63
|
+
private ProcessGetResponseForManagedIdentityUpdateCmdlet;
|
|
64
|
+
private ManagedIdentityUpdateCmdletPreProcess;
|
|
53
65
|
private GetPutPreProcess;
|
|
54
66
|
private NewImplementResponseMethod;
|
|
55
67
|
private NewImplementSerialization;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../../cmdlets/class.ts"],"names":[],"mappings":"AAMA,OAAO,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c7B,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,0BAA0B;IA0ClC,OAAO,CAAC,cAAc;IAiFtB,OAAO,CAAC,yBAAyB;IAoFjC,OAAO,CAAC,8BAA8B;IAkHtC,OAAO,CAAG,aAAa;IAoLvB,OAAO,CAAC,0BAA0B;IAIlC,OAAO,CAAC,6BAA6B;IAIrC,OAAO,CAAC,qCAAqC;IAI7C,OAAO,CAAC,2CAA2C;IAInD,OAAO,CAAC,8CAA8C;IAKtD,OAAO,CAAC,mCAAmC;IAO3C,OAAO,CAAC,qCAAqC;IAc7C,OAAO,CAAC,yCAAyC;IA2BjD,OAAO,CAAC,gDAAgD;IAoCxD,OAAO,CAAC,qCAAqC;IAI7C,OAAO,CAAC,gBAAgB;IAyCxB,OAAO,CAAC,0BAA0B;IAwRlC,OAAO,CAAC,yBAAyB;IAoCjC,OAAO,CAAC,qBAAqB;IAK7B,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,uBAAuB;IAiJ/B,OAAO,CAAC,0BAA0B;IA4WlC;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,qBAAqB;CA0M9B"}
|
package/dist/cmdlets/class.js
CHANGED
|
@@ -358,6 +358,8 @@ class CmdletClass extends codegen_csharp_1.Class {
|
|
|
358
358
|
this.addCommonStuff();
|
|
359
359
|
this.description = (0, codegen_1.escapeString)(this.operation.details.csharp.description);
|
|
360
360
|
const $this = this;
|
|
361
|
+
this.disableTransformIdentityType = await $this.state.getValue('disable-transform-identity-type', false);
|
|
362
|
+
this.flattenUserAssignedIdentity = await $this.state.getValue('flatten-userassignedidentity', true);
|
|
361
363
|
this.add(new codegen_csharp_1.Method('BeginProcessing', codegen_csharp_1.dotnet.Void, {
|
|
362
364
|
override: codegen_csharp_1.Modifier.Override,
|
|
363
365
|
access: codegen_csharp_1.Access.Protected,
|
|
@@ -735,12 +737,18 @@ class CmdletClass extends codegen_csharp_1.Class {
|
|
|
735
737
|
// make the call.
|
|
736
738
|
let preProcess;
|
|
737
739
|
switch ($this.operation.commandType) {
|
|
740
|
+
case command_operation_1.CommandType.ManagedIdentityUpdate:
|
|
741
|
+
preProcess = $this.ContainsIdentityTypeParameter() ? $this.ManagedIdentityUpdateCmdletPreProcess : undefined;
|
|
742
|
+
break;
|
|
738
743
|
case command_operation_1.CommandType.GetPut:
|
|
739
744
|
preProcess = $this.GetPutPreProcess;
|
|
740
745
|
break;
|
|
746
|
+
case command_operation_1.CommandType.ManagedIdentityNew:
|
|
747
|
+
preProcess = $this.ContainsIdentityTypeParameter() && $this.ContainsUserAssignedIdentityParameter() ? $this.ManagedIdentityPreProcessForNewVerbCmdlet : undefined;
|
|
748
|
+
break;
|
|
741
749
|
case command_operation_1.CommandType.Atomic:
|
|
742
750
|
default:
|
|
743
|
-
preProcess = undefined;
|
|
751
|
+
preProcess = $this.ContainsUserAssignedIdentityParameter() ? $this.ManagedUserAssignedIdentityPreProcess : undefined;
|
|
744
752
|
break;
|
|
745
753
|
}
|
|
746
754
|
const actualCall = function* () {
|
|
@@ -948,7 +956,105 @@ class CmdletClass extends codegen_csharp_1.Class {
|
|
|
948
956
|
yield `await this.${$this.$('Client').invokeMethod(httpOperationName, ...parameters).implementation}`;
|
|
949
957
|
}
|
|
950
958
|
}
|
|
951
|
-
|
|
959
|
+
ContainsSpecifiedParameter(parameterName) {
|
|
960
|
+
var _a, _b, _c, _d;
|
|
961
|
+
return (_d = (_c = (_b = (_a = this.operation.details.csharp.virtualParameters) === null || _a === void 0 ? void 0 : _a.body) === null || _b === void 0 ? void 0 : _b.map(p => p.name)) === null || _c === void 0 ? void 0 : _c.includes(parameterName)) !== null && _d !== void 0 ? _d : false;
|
|
962
|
+
}
|
|
963
|
+
ContainsIdentityTypeParameter() {
|
|
964
|
+
return this.ContainsSpecifiedParameter('IdentityType');
|
|
965
|
+
}
|
|
966
|
+
ContainsUserAssignedIdentityParameter() {
|
|
967
|
+
return this.ContainsSpecifiedParameter('IdentityUserAssignedIdentity') || this.ContainsSpecifiedParameter('UserAssignedIdentity');
|
|
968
|
+
}
|
|
969
|
+
GetUserAssignedIdentityParameterElementType() {
|
|
970
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
971
|
+
return (_h = (_g = (_f = (_e = (_d = (_c = (_b = (_a = this.operation.details.csharp.virtualParameters) === null || _a === void 0 ? void 0 : _a.body) === null || _b === void 0 ? void 0 : _b.filter(p => p.name === 'UserAssignedIdentity' || p.name === 'IdentityUserAssignedIdentity')) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.schema) === null || _e === void 0 ? void 0 : _e.elementType) === null || _f === void 0 ? void 0 : _f.language) === null || _g === void 0 ? void 0 : _g.csharp) === null || _h === void 0 ? void 0 : _h.fullname;
|
|
972
|
+
}
|
|
973
|
+
GetUserAssignedIdentityPropertyTypeDeclaration() {
|
|
974
|
+
var _a, _b, _c;
|
|
975
|
+
const userAssignedIdentityParameter = this.properties.filter(p => p.name === 'UserAssignedIdentity' || p.name === 'IdentityUserAssignedIdentity');
|
|
976
|
+
return (_c = (_b = (_a = userAssignedIdentityParameter === null || userAssignedIdentityParameter === void 0 ? void 0 : userAssignedIdentityParameter[0]) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.declaration) !== null && _c !== void 0 ? _c : undefined;
|
|
977
|
+
}
|
|
978
|
+
GetUserAssignedIdentityPropertyName() {
|
|
979
|
+
var _a, _b, _c, _d;
|
|
980
|
+
const response = (_a = this.responses.filter(re => { var _a, _b; return (_b = (_a = re === null || re === void 0 ? void 0 : re.schema) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b['is-return-object']; })) === null || _a === void 0 ? void 0 : _a[0];
|
|
981
|
+
const props = (0, schema_1.getAllPublicVirtualProperties)((_b = response.schema.language.csharp) === null || _b === void 0 ? void 0 : _b.virtualProperties);
|
|
982
|
+
const userAssignedIdentityParameter = props === null || props === void 0 ? void 0 : props.filter(p => p.name === 'UserAssignedIdentity' || p.name === 'IdentityUserAssignedIdentity');
|
|
983
|
+
return (_d = (_c = userAssignedIdentityParameter === null || userAssignedIdentityParameter === void 0 ? void 0 : userAssignedIdentityParameter[0]) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : undefined;
|
|
984
|
+
}
|
|
985
|
+
ManagedUserAssignedIdentityPreProcess(cmdlet, pathParams = [], nonPathParams = [], viaIdentity = false) {
|
|
986
|
+
const $this = cmdlet;
|
|
987
|
+
if ($this.ContainsUserAssignedIdentityParameter() && $this.flattenUserAssignedIdentity) {
|
|
988
|
+
return (0, codegen_csharp_1.If)('this.UserAssignedIdentity?.Length > 0', function* () {
|
|
989
|
+
var _a;
|
|
990
|
+
yield '// calculate UserAssignedIdentity';
|
|
991
|
+
yield (0, codegen_csharp_1.ForEach)('id', 'this.UserAssignedIdentity', `${(_a = $this.bodyParameter) === null || _a === void 0 ? void 0 : _a.value}.${$this.GetUserAssignedIdentityPropertyName()}.Add(id, new ${$this.GetUserAssignedIdentityParameterElementType()}());`);
|
|
992
|
+
yield '';
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
return new codegen_csharp_1.Statements();
|
|
996
|
+
}
|
|
997
|
+
ManagedIdentityPreProcessForNewVerbCmdlet(cmdlet, pathParams, nonPathParams, viaIdentity) {
|
|
998
|
+
const $this = cmdlet;
|
|
999
|
+
const preProcessManagedIdentityParametersMethod = new codegen_csharp_1.Method('PreProcessManagedIdentityParameters', codegen_csharp_1.dotnet.Void, {
|
|
1000
|
+
access: codegen_csharp_1.Access.Private
|
|
1001
|
+
});
|
|
1002
|
+
const preProcessManagedIdentityParameters = function* () {
|
|
1003
|
+
yield $this.ManagedUserAssignedIdentityPreProcess($this);
|
|
1004
|
+
// if UserAssignedIdentity is a string array, use Length. Otherwise, use Count
|
|
1005
|
+
yield (0, codegen_csharp_1.If)(`this.UserAssignedIdentity?.${$this.flattenUserAssignedIdentity ? 'Length' : 'Count'} > 0`, function* () {
|
|
1006
|
+
var _a, _b, _c;
|
|
1007
|
+
yield '// calculate IdentityType';
|
|
1008
|
+
yield (0, codegen_csharp_1.If)(`"SystemAssigned".Equals(${(_a = $this.bodyParameter) === null || _a === void 0 ? void 0 : _a.value}.IdentityType, StringComparison.InvariantCultureIgnoreCase)`, `${(_b = $this.bodyParameter) === null || _b === void 0 ? void 0 : _b.value}.IdentityType = "SystemAssigned,UserAssigned";`);
|
|
1009
|
+
yield (0, codegen_csharp_1.Else)(`${(_c = $this.bodyParameter) === null || _c === void 0 ? void 0 : _c.value}.IdentityType = "UserAssigned";`);
|
|
1010
|
+
});
|
|
1011
|
+
};
|
|
1012
|
+
if (!$this.hasMethodWithSameDeclaration(preProcessManagedIdentityParametersMethod)) {
|
|
1013
|
+
preProcessManagedIdentityParametersMethod.add(preProcessManagedIdentityParameters);
|
|
1014
|
+
$this.add(preProcessManagedIdentityParametersMethod);
|
|
1015
|
+
}
|
|
1016
|
+
return new codegen_csharp_1.Statements(function* () {
|
|
1017
|
+
yield `this.${preProcessManagedIdentityParametersMethod.name}();`;
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
ProcessGetResponseForManagedIdentityUpdateCmdlet(cmdlet) {
|
|
1021
|
+
const $this = cmdlet;
|
|
1022
|
+
const containsUserAssignedIdentity = $this.ContainsUserAssignedIdentityParameter();
|
|
1023
|
+
const preProcessManagedIdentity = function* () {
|
|
1024
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1025
|
+
yield new codegen_csharp_1.LocalVariable('supportsSystemAssignedIdentity', codegen_csharp_1.dotnet.Bool, { initializer: (0, codegen_csharp_1.Or)('true == this.EnableSystemAssignedIdentity', `null == this.EnableSystemAssignedIdentity && true == ${(_a = $this.bodyParameter) === null || _a === void 0 ? void 0 : _a.value}?.IdentityType?.Contains("SystemAssigned")`) });
|
|
1026
|
+
yield new codegen_csharp_1.LocalVariable('supportsUserAssignedIdentity', codegen_csharp_1.dotnet.Bool, { initializer: `${codegen_csharp_1.dotnet.False}` });
|
|
1027
|
+
if (containsUserAssignedIdentity) {
|
|
1028
|
+
yield $this.ManagedUserAssignedIdentityPreProcess($this);
|
|
1029
|
+
yield `supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && ${$this.flattenUserAssignedIdentity ? 'this.UserAssignedIdentity?.Length' : `((${$this.GetUserAssignedIdentityPropertyTypeDeclaration()})this.MyInvocation?.BoundParameters["UserAssignedIdentity"])?.Count`} > 0 ||
|
|
1030
|
+
true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == ${(_b = $this.bodyParameter) === null || _b === void 0 ? void 0 : _b.value}.IdentityType?.Contains("UserAssigned");`;
|
|
1031
|
+
yield (0, codegen_csharp_1.If)('!supportsUserAssignedIdentity', function* () {
|
|
1032
|
+
var _a;
|
|
1033
|
+
yield `${(_a = $this.bodyParameter) === null || _a === void 0 ? void 0 : _a.value}.${$this.GetUserAssignedIdentityPropertyName()} = null;`;
|
|
1034
|
+
});
|
|
1035
|
+
yield '';
|
|
1036
|
+
}
|
|
1037
|
+
yield '// calculate IdentityType';
|
|
1038
|
+
yield (0, codegen_csharp_1.If)((0, codegen_csharp_1.And)('supportsUserAssignedIdentity', 'supportsSystemAssignedIdentity'), `${(_c = $this.bodyParameter) === null || _c === void 0 ? void 0 : _c.value}.IdentityType = "SystemAssigned,UserAssigned";`);
|
|
1039
|
+
yield (0, codegen_csharp_1.ElseIf)((0, codegen_csharp_1.And)('supportsUserAssignedIdentity', '!supportsSystemAssignedIdentity'), `${(_d = $this.bodyParameter) === null || _d === void 0 ? void 0 : _d.value}.IdentityType = "UserAssigned";`);
|
|
1040
|
+
yield (0, codegen_csharp_1.ElseIf)((0, codegen_csharp_1.And)('!supportsUserAssignedIdentity', 'supportsSystemAssignedIdentity'), `${(_e = $this.bodyParameter) === null || _e === void 0 ? void 0 : _e.value}.IdentityType = "SystemAssigned";`);
|
|
1041
|
+
yield (0, codegen_csharp_1.Else)(`${(_f = $this.bodyParameter) === null || _f === void 0 ? void 0 : _f.value}.IdentityType = "None";`);
|
|
1042
|
+
};
|
|
1043
|
+
const preProcessManagedIdentityMethod = new codegen_csharp_1.Method('PreProcessManagedIdentityParametersWithGetResult', codegen_csharp_1.dotnet.Void, {
|
|
1044
|
+
access: codegen_csharp_1.Access.Private
|
|
1045
|
+
});
|
|
1046
|
+
if (!$this.hasMethodWithSameDeclaration(preProcessManagedIdentityMethod)) {
|
|
1047
|
+
preProcessManagedIdentityMethod.add(preProcessManagedIdentity);
|
|
1048
|
+
$this.add(preProcessManagedIdentityMethod);
|
|
1049
|
+
}
|
|
1050
|
+
return new codegen_csharp_1.Statements(function* () {
|
|
1051
|
+
yield `this.${preProcessManagedIdentityMethod.name}();`;
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
ManagedIdentityUpdateCmdletPreProcess(cmdlet, pathParams, nonPathParams, viaIdentity) {
|
|
1055
|
+
return cmdlet.GetPutPreProcess(cmdlet, pathParams, nonPathParams, viaIdentity, cmdlet.ProcessGetResponseForManagedIdentityUpdateCmdlet);
|
|
1056
|
+
}
|
|
1057
|
+
GetPutPreProcess(cmdlet, pathParams, nonPathParams, viaIdentity, processGetResponse = undefined) {
|
|
952
1058
|
var _a, _b;
|
|
953
1059
|
const $this = cmdlet;
|
|
954
1060
|
const updateBodyMethod = new codegen_csharp_1.Method(`Update${(_a = $this.bodyParameter) === null || _a === void 0 ? void 0 : _a.value}`, codegen_csharp_1.dotnet.Void, {
|
|
@@ -975,8 +1081,16 @@ class CmdletClass extends codegen_csharp_1.Class {
|
|
|
975
1081
|
}
|
|
976
1082
|
const getPut = function* () {
|
|
977
1083
|
var _a;
|
|
978
|
-
yield `${(_a = $this.bodyParameter) === null || _a === void 0 ? void 0 : _a.value} = await this.${$this.$('Client').invokeMethod(httpOperationName, ...[...pathParams, ...nonPathParams]).implementation}`;
|
|
1084
|
+
yield `${(_a = $this.bodyParameter) === null || _a === void 0 ? void 0 : _a.value} = await this.${$this.$('Client').invokeMethod(httpOperationName, ...[...pathParams, ...nonPathParams]).implementation} `;
|
|
1085
|
+
// PreProcess body parameter
|
|
1086
|
+
if (processGetResponse) {
|
|
1087
|
+
yield processGetResponse($this);
|
|
1088
|
+
}
|
|
979
1089
|
yield `this.${updateBodyMethod.name}();`;
|
|
1090
|
+
/** Instance:
|
|
1091
|
+
* _requestBodyParametersBody = await this.Client.GrafanaGetWithResult(SubscriptionId, ResourceGroupName, Name, this, Pipeline);
|
|
1092
|
+
* this.Update_requestBodyParametersBody();
|
|
1093
|
+
* */
|
|
980
1094
|
};
|
|
981
1095
|
return new codegen_csharp_1.Statements(getPut);
|
|
982
1096
|
}
|
|
@@ -1481,6 +1595,34 @@ class CmdletClass extends codegen_csharp_1.Class {
|
|
|
1481
1595
|
const nullable = this.state.project.schemaDefinitionResolver.resolveTypeDeclaration(vSchema, !!vParam.origin.required, this.state).isNullable;
|
|
1482
1596
|
let cmdletParameter;
|
|
1483
1597
|
if (propertyType.schema.type !== codemodel_1.SchemaType.Array) {
|
|
1598
|
+
if (vParam.name === 'IdentityType' && !this.disableTransformIdentityType) {
|
|
1599
|
+
const enableSystemAssignedIdentity = new codegen_csharp_1.Property('EnableSystemAssignedIdentity', operation.details.csharp.verb.toLowerCase() === 'new' ? powershell_declarations_1.SwitchParameter : powershell_declarations_1.NullableBoolean, {
|
|
1600
|
+
set: operation.details.csharp.verb.toLowerCase() === 'new' ? (0, codegen_csharp_1.toExpression)(`${expandedBodyParameter.value}.${(0, model_class_1.getVirtualPropertyName)(vParam.origin) || vParam.origin.name} = value.IsPresent ? "SystemAssigned": null `) : undefined
|
|
1601
|
+
});
|
|
1602
|
+
enableSystemAssignedIdentity.description = 'Decides if enable a system assigned identity for the resource.';
|
|
1603
|
+
enableSystemAssignedIdentity.add(new codegen_csharp_1.Attribute(powershell_declarations_1.ParameterAttribute, { parameters: [new codegen_csharp_1.LiteralExpression(`Mandatory = ${vParam.required ? 'true' : 'false'}`), new codegen_csharp_1.LiteralExpression(`HelpMessage = "${(0, codegen_1.escapeString)(enableSystemAssignedIdentity.description || '.')}"`)] }));
|
|
1604
|
+
if ((0, linq_1.length)(vParam.alias) > 0) {
|
|
1605
|
+
enableSystemAssignedIdentity.add(new codegen_csharp_1.Attribute(powershell_declarations_1.Alias, { parameters: vParam.alias.map(x => '"' + x + '"') }));
|
|
1606
|
+
}
|
|
1607
|
+
this.add(enableSystemAssignedIdentity);
|
|
1608
|
+
continue;
|
|
1609
|
+
}
|
|
1610
|
+
if (vParam.name === 'IdentityUserAssignedIdentity' || vParam.name === 'UserAssignedIdentity') {
|
|
1611
|
+
if (this.flattenUserAssignedIdentity) {
|
|
1612
|
+
const userAssignedIdentity = new codegen_csharp_1.Property('UserAssignedIdentity', codegen_csharp_1.dotnet.StringArray);
|
|
1613
|
+
userAssignedIdentity.description = 'The array of user assigned identities associated with the resource. The elements in array will be ARM resource ids in the form: \'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.\'';
|
|
1614
|
+
userAssignedIdentity.add(new codegen_csharp_1.Attribute(powershell_declarations_1.ParameterAttribute, { parameters: [new codegen_csharp_1.LiteralExpression(`Mandatory = ${vParam.required ? 'true' : 'false'}`), new codegen_csharp_1.LiteralExpression(`HelpMessage = "${(0, codegen_1.escapeString)(userAssignedIdentity.description || '.')}"`)] }));
|
|
1615
|
+
userAssignedIdentity.add(new codegen_csharp_1.Attribute(powershell_declarations_1.AllowEmptyCollectionAttribute));
|
|
1616
|
+
if ((0, linq_1.length)(vParam.alias) > 0) {
|
|
1617
|
+
userAssignedIdentity.add(new codegen_csharp_1.Attribute(powershell_declarations_1.Alias, { parameters: vParam.alias.map(x => '"' + x + '"') }));
|
|
1618
|
+
}
|
|
1619
|
+
this.add(userAssignedIdentity);
|
|
1620
|
+
continue;
|
|
1621
|
+
}
|
|
1622
|
+
else {
|
|
1623
|
+
vParam.name = 'UserAssignedIdentity';
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1484
1626
|
cmdletParameter = new codegen_csharp_1.Property(vParam.name, propertyType, {
|
|
1485
1627
|
get: (0, codegen_csharp_1.toExpression)(`${expandedBodyParameter.value}.${(0, model_class_1.getVirtualPropertyName)(vParam.origin) || vParam.origin.name}${!nullable ? '' : ` ?? ${propertyType.defaultOfType}`}`),
|
|
1486
1628
|
// get: toExpression(`null == ${expandedBodyParameter.value}.${vParam.origin.name} ? ${propertyType.defaultOfType} : (${propertyType.declaration}) ${expandedBodyParameter.value}.${vParam.origin.name}`),
|