Skip to content

Commit 92577eb

Browse files
committed
Tsp - fixed a vis related issue
1 parent 50772a2 commit 92577eb

16 files changed

+74
-58
lines changed

packages/typespec-powershell/src/utils/modelUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ function getSchemaForModel(
883883
property.required = true;
884884
}
885885
const vis = getVisibility(program, prop);
886-
if (vis && vis.includes("read")) {
886+
if (vis) {
887887
if (vis.includes("read")) {
888888
if (vis.length === 1) {
889889
property.readOnly = true;

tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/AdditionalUnattendContent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public partial interface IAdditionalUnattendContent :
8888
[Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Info(
8989
Required = false,
9090
ReadOnly = false,
91-
Read = true,
91+
Read = false,
9292
Create = true,
9393
Update = true,
9494
Description = @"Specifies the XML formatted content that is added to the unattend.xml file for

tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/AdditionalUnattendContent.json.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ internal AdditionalUnattendContent(Microsoft.Azure.PowerShell.Cmdlets.ComputeFle
7070
{_passName = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString>("passName"), out var __jsonPassName) ? (string)__jsonPassName : (string)_passName;}
7171
{_componentName = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString>("componentName"), out var __jsonComponentName) ? (string)__jsonComponentName : (string)_componentName;}
7272
{_settingName = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString>("settingName"), out var __jsonSettingName) ? (string)__jsonSettingName : (string)_settingName;}
73-
{_content = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString>("content"), out var __jsonContent) ? new System.Net.NetworkCredential("",(string)__jsonContent).SecurePassword : _content;}
7473
AfterFromJson(json);
7574
}
7675

@@ -108,7 +107,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode ToJ
108107
AddIf( null != (((object)this._passName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString(this._passName.ToString()) : null, "passName" ,container.Add );
109108
AddIf( null != (((object)this._componentName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString(this._componentName.ToString()) : null, "componentName" ,container.Add );
110109
AddIf( null != (((object)this._settingName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString(this._settingName.ToString()) : null, "settingName" ,container.Add );
111-
AddIf( null != (((object)this._content)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._content))) : null, "content" ,container.Add );
110+
if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeUpdate)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeCreate))
111+
{
112+
AddIf( null != (((object)this._content)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._content))) : null, "content" ,container.Add );
113+
}
112114
AfterToJson(ref container);
113115
return container;
114116
}

tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public partial interface IVirtualMachineScaleSetExtension :
229229
[Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Info(
230230
Required = false,
231231
ReadOnly = false,
232-
Read = true,
232+
Read = false,
233233
Create = true,
234234
Update = true,
235235
Description = @"The extension can contain either protectedSettings or

tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public partial interface IVirtualMachineScaleSetExtensionProperties :
204204
[Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Info(
205205
Required = false,
206206
ReadOnly = false,
207-
Read = true,
207+
Read = false,
208208
Create = true,
209209
Update = true,
210210
Description = @"The extension can contain either protectedSettings or

tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetExtensionProperties.json.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode ToJ
9292
AddIf( null != this._autoUpgradeMinorVersion ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonBoolean((bool)this._autoUpgradeMinorVersion) : null, "autoUpgradeMinorVersion" ,container.Add );
9393
AddIf( null != this._enableAutomaticUpgrade ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonBoolean((bool)this._enableAutomaticUpgrade) : null, "enableAutomaticUpgrade" ,container.Add );
9494
AddIf( null != this._setting ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) this._setting.ToJson(null,serializationMode) : null, "settings" ,container.Add );
95-
AddIf( null != this._protectedSetting ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) this._protectedSetting.ToJson(null,serializationMode) : null, "protectedSettings" ,container.Add );
95+
if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeUpdate)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeCreate))
96+
{
97+
AddIf( null != this._protectedSetting ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) this._protectedSetting.ToJson(null,serializationMode) : null, "protectedSettings" ,container.Add );
98+
}
9699
if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeRead))
97100
{
98101
AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add );
@@ -131,7 +134,6 @@ internal VirtualMachineScaleSetExtensionProperties(Microsoft.Azure.PowerShell.Cm
131134
{_autoUpgradeMinorVersion = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonBoolean>("autoUpgradeMinorVersion"), out var __jsonAutoUpgradeMinorVersion) ? (bool?)__jsonAutoUpgradeMinorVersion : _autoUpgradeMinorVersion;}
132135
{_enableAutomaticUpgrade = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonBoolean>("enableAutomaticUpgrade"), out var __jsonEnableAutomaticUpgrade) ? (bool?)__jsonEnableAutomaticUpgrade : _enableAutomaticUpgrade;}
133136
{_setting = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject>("settings"), out var __jsonSettings) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.Settings.FromJson(__jsonSettings) : _setting;}
134-
{_protectedSetting = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject>("protectedSettings"), out var __jsonProtectedSettings) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.Settings.FromJson(__jsonProtectedSettings) : _protectedSetting;}
135137
{_provisioningState = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString>("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;}
136138
{_provisionAfterExtension = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonArray>("provisionAfterExtensions"), out var __jsonProvisionAfterExtensions) ? If( __jsonProvisionAfterExtensions as Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonArray, out var __v) ? new global::System.Func<System.Collections.Generic.List<string>>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _provisionAfterExtension;}
137139
{_suppressFailure = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonBoolean>("suppressFailures"), out var __jsonSuppressFailures) ? (bool?)__jsonSuppressFailures : _suppressFailure;}

tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetOSProfile.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ public partial interface IVirtualMachineScaleSetOSProfile :
323323
[Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Info(
324324
Required = false,
325325
ReadOnly = false,
326-
Read = true,
326+
Read = false,
327327
Create = true,
328328
Update = true,
329329
Description = @"Specifies the password of the administrator account. <br><br> **Minimum-length
@@ -412,7 +412,7 @@ scale set. This may only be set to False when no extensions are present on the
412412
[Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Info(
413413
Required = false,
414414
ReadOnly = false,
415-
Read = true,
415+
Read = false,
416416
Create = true,
417417
Update = true,
418418
Description = @"Specifies a base-64 encoded string of custom data. The base-64 encoded string

tests-upgrade/tests-emitter/AzureFleet.Management/target/generated/api/Models/VirtualMachineScaleSetOSProfile.json.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,14 @@ public Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode ToJ
8686
AddIf( null != this._linuxConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) this._linuxConfiguration.ToJson(null,serializationMode) : null, "linuxConfiguration" ,container.Add );
8787
AddIf( null != (((object)this._computerNamePrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString(this._computerNamePrefix.ToString()) : null, "computerNamePrefix" ,container.Add );
8888
AddIf( null != (((object)this._adminUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString(this._adminUsername.ToString()) : null, "adminUsername" ,container.Add );
89-
AddIf( null != (((object)this._adminPassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._adminPassword))) : null, "adminPassword" ,container.Add );
90-
AddIf( null != (((object)this._customData)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._customData))) : null, "customData" ,container.Add );
89+
if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeUpdate)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeCreate))
90+
{
91+
AddIf( null != (((object)this._adminPassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._adminPassword))) : null, "adminPassword" ,container.Add );
92+
}
93+
if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeUpdate)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.SerializationMode.IncludeCreate))
94+
{
95+
AddIf( null != (((object)this._customData)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._customData))) : null, "customData" ,container.Add );
96+
}
9197
if (null != this._secret)
9298
{
9399
var __w = new Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.XNodeArray();
@@ -119,8 +125,6 @@ internal VirtualMachineScaleSetOSProfile(Microsoft.Azure.PowerShell.Cmdlets.Comp
119125
{_linuxConfiguration = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonObject>("linuxConfiguration"), out var __jsonLinuxConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.LinuxConfiguration.FromJson(__jsonLinuxConfiguration) : _linuxConfiguration;}
120126
{_computerNamePrefix = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString>("computerNamePrefix"), out var __jsonComputerNamePrefix) ? (string)__jsonComputerNamePrefix : (string)_computerNamePrefix;}
121127
{_adminUsername = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString>("adminUsername"), out var __jsonAdminUsername) ? (string)__jsonAdminUsername : (string)_adminUsername;}
122-
{_adminPassword = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString>("adminPassword"), out var __jsonAdminPassword) ? new System.Net.NetworkCredential("",(string)__jsonAdminPassword).SecurePassword : _adminPassword;}
123-
{_customData = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonString>("customData"), out var __jsonCustomData) ? new System.Net.NetworkCredential("",(string)__jsonCustomData).SecurePassword : _customData;}
124128
{_secret = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonArray>("secrets"), out var __jsonSecrets) ? If( __jsonSecrets as Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonArray, out var __v) ? new global::System.Func<System.Collections.Generic.List<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVaultSecretGroup>>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.IVaultSecretGroup) (Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Models.VaultSecretGroup.FromJson(__u) )) ))() : null : _secret;}
125129
{_allowExtensionOperation = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonBoolean>("allowExtensionOperations"), out var __jsonAllowExtensionOperations) ? (bool?)__jsonAllowExtensionOperations : _allowExtensionOperation;}
126130
{_requireGuestProvisionSignal = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.ComputeFleet.Runtime.Json.JsonBoolean>("requireGuestProvisionSignal"), out var __jsonRequireGuestProvisionSignal) ? (bool?)__jsonRequireGuestProvisionSignal : _requireGuestProvisionSignal;}

tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/AdministratorProperties.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public partial interface IAdministratorProperties :
3939
[Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Info(
4040
Required = false,
4141
ReadOnly = false,
42-
Read = true,
42+
Read = false,
4343
Create = true,
4444
Update = true,
4545
Description = @"The administrator password.",

tests-upgrade/tests-emitter/DocumentDB.MongoCluster.Management/target/generated/api/Models/AdministratorProperties.json.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ internal AdministratorProperties(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster
6464
return;
6565
}
6666
{_userName = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonString>("userName"), out var __jsonUserName) ? (string)__jsonUserName : (string)_userName;}
67-
{_password = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonString>("password"), out var __jsonPassword) ? new System.Net.NetworkCredential("",(string)__jsonPassword).SecurePassword : _password;}
6867
AfterFromJson(json);
6968
}
7069

@@ -100,7 +99,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode ToJ
10099
return container;
101100
}
102101
AddIf( null != (((object)this._userName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonString(this._userName.ToString()) : null, "userName" ,container.Add );
103-
AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._password))) : null, "password" ,container.Add );
102+
if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.SerializationMode.IncludeUpdate)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.SerializationMode.IncludeCreate))
103+
{
104+
AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.MongoCluster.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._password))) : null, "password" ,container.Add );
105+
}
104106
AfterToJson(ref container);
105107
return container;
106108
}

0 commit comments

Comments
 (0)